Lines Matching refs:ret
170 int ret = 0; in block_cipher_df() local
215 ret = psa_generic_status_to_mbedtls(status); in block_cipher_df()
221 if ((ret = mbedtls_aes_setkey_enc(&aes_ctx, key, in block_cipher_df()
245 ret = psa_generic_status_to_mbedtls(status); in block_cipher_df()
249 if ((ret = mbedtls_aes_crypt_ecb(&aes_ctx, MBEDTLS_AES_ENCRYPT, in block_cipher_df()
272 ret = psa_generic_status_to_mbedtls(status); in block_cipher_df()
276 if ((ret = mbedtls_aes_setkey_enc(&aes_ctx, tmp, in block_cipher_df()
289 ret = psa_generic_status_to_mbedtls(status); in block_cipher_df()
293 if ((ret = mbedtls_aes_crypt_ecb(&aes_ctx, MBEDTLS_AES_ENCRYPT, in block_cipher_df()
314 if (0 != ret) { in block_cipher_df()
321 return ret; in block_cipher_df()
338 int ret = 0; in ctr_drbg_update_internal() local
359 ret = psa_generic_status_to_mbedtls(status); in ctr_drbg_update_internal()
363 if ((ret = mbedtls_aes_crypt_ecb(&ctx->aes_ctx, MBEDTLS_AES_ENCRYPT, in ctr_drbg_update_internal()
382 ret = psa_generic_status_to_mbedtls(status); in ctr_drbg_update_internal()
386 if ((ret = mbedtls_aes_setkey_enc(&ctx->aes_ctx, tmp, in ctr_drbg_update_internal()
396 return ret; in ctr_drbg_update_internal()
416 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_ctr_drbg_update() local
422 if ((ret = block_cipher_df(add_input, additional, add_len)) != 0) { in mbedtls_ctr_drbg_update()
425 if ((ret = ctr_drbg_update_internal(ctx, add_input)) != 0) { in mbedtls_ctr_drbg_update()
431 return ret; in mbedtls_ctr_drbg_update()
454 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_ctr_drbg_reseed_internal() local
489 if ((ret = block_cipher_df(seed, seed, seedlen)) != 0) { in mbedtls_ctr_drbg_reseed_internal()
494 if ((ret = ctr_drbg_update_internal(ctx, seed)) != 0) { in mbedtls_ctr_drbg_reseed_internal()
501 return ret; in mbedtls_ctr_drbg_reseed_internal()
541 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_ctr_drbg_seed() local
572 ret = psa_generic_status_to_mbedtls(status); in mbedtls_ctr_drbg_seed()
576 if ((ret = mbedtls_aes_setkey_enc(&ctx->aes_ctx, key, in mbedtls_ctr_drbg_seed()
578 return ret; in mbedtls_ctr_drbg_seed()
583 if ((ret = mbedtls_ctr_drbg_reseed_internal(ctx, custom, len, in mbedtls_ctr_drbg_seed()
585 return ret; in mbedtls_ctr_drbg_seed()
613 int ret = 0; in mbedtls_ctr_drbg_random_with_add() local
634 if ((ret = mbedtls_ctr_drbg_reseed(ctx, additional, add_len)) != 0) { in mbedtls_ctr_drbg_random_with_add()
635 return ret; in mbedtls_ctr_drbg_random_with_add()
641 if ((ret = block_cipher_df(locals.add_input, additional, add_len)) != 0) { in mbedtls_ctr_drbg_random_with_add()
644 if ((ret = ctr_drbg_update_internal(ctx, locals.add_input)) != 0) { in mbedtls_ctr_drbg_random_with_add()
665 ret = psa_generic_status_to_mbedtls(status); in mbedtls_ctr_drbg_random_with_add()
669 if ((ret = mbedtls_aes_crypt_ecb(&ctx->aes_ctx, MBEDTLS_AES_ENCRYPT, in mbedtls_ctr_drbg_random_with_add()
685 if ((ret = ctr_drbg_update_internal(ctx, locals.add_input)) != 0) { in mbedtls_ctr_drbg_random_with_add()
693 return ret; in mbedtls_ctr_drbg_random_with_add()
699 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_ctr_drbg_random() local
703 if ((ret = mbedtls_mutex_lock(&ctx->mutex)) != 0) { in mbedtls_ctr_drbg_random()
704 return ret; in mbedtls_ctr_drbg_random()
708 ret = mbedtls_ctr_drbg_random_with_add(ctx, output, output_len, NULL, 0); in mbedtls_ctr_drbg_random()
716 return ret; in mbedtls_ctr_drbg_random()
723 int ret = MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR; in mbedtls_ctr_drbg_write_seed_file() local
734 if ((ret = mbedtls_ctr_drbg_random(ctx, buf, in mbedtls_ctr_drbg_write_seed_file()
741 ret = MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR; in mbedtls_ctr_drbg_write_seed_file()
743 ret = 0; in mbedtls_ctr_drbg_write_seed_file()
750 return ret; in mbedtls_ctr_drbg_write_seed_file()
756 int ret = 0; in mbedtls_ctr_drbg_update_seed_file() local
771 ret = MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG; in mbedtls_ctr_drbg_update_seed_file()
775 ret = MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR; in mbedtls_ctr_drbg_update_seed_file()
781 ret = mbedtls_ctr_drbg_update(ctx, buf, n); in mbedtls_ctr_drbg_update_seed_file()
788 if (ret != 0) { in mbedtls_ctr_drbg_update_seed_file()
789 return ret; in mbedtls_ctr_drbg_update_seed_file()