Lines Matching refs:ret

70     int ret = MBEDTLS_ERR_MD_BAD_INPUT_DATA;  in mbedtls_hmac_drbg_update_ret()  local
75 if( ( ret = mbedtls_md_hmac_reset( &ctx->md_ctx ) ) != 0 ) in mbedtls_hmac_drbg_update_ret()
77 if( ( ret = mbedtls_md_hmac_update( &ctx->md_ctx, in mbedtls_hmac_drbg_update_ret()
80 if( ( ret = mbedtls_md_hmac_update( &ctx->md_ctx, in mbedtls_hmac_drbg_update_ret()
85 if( ( ret = mbedtls_md_hmac_update( &ctx->md_ctx, in mbedtls_hmac_drbg_update_ret()
89 if( ( ret = mbedtls_md_hmac_finish( &ctx->md_ctx, K ) ) != 0 ) in mbedtls_hmac_drbg_update_ret()
93 if( ( ret = mbedtls_md_hmac_starts( &ctx->md_ctx, K, md_len ) ) != 0 ) in mbedtls_hmac_drbg_update_ret()
95 if( ( ret = mbedtls_md_hmac_update( &ctx->md_ctx, in mbedtls_hmac_drbg_update_ret()
98 if( ( ret = mbedtls_md_hmac_finish( &ctx->md_ctx, ctx->V ) ) != 0 ) in mbedtls_hmac_drbg_update_ret()
104 return( ret ); in mbedtls_hmac_drbg_update_ret()
123 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_seed_buf() local
125 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed_buf()
126 return( ret ); in mbedtls_hmac_drbg_seed_buf()
137 if( ( ret = mbedtls_md_hmac_starts( &ctx->md_ctx, ctx->V, in mbedtls_hmac_drbg_seed_buf()
139 return( ret ); in mbedtls_hmac_drbg_seed_buf()
142 if( ( ret = mbedtls_hmac_drbg_update_ret( ctx, data, data_len ) ) != 0 ) in mbedtls_hmac_drbg_seed_buf()
143 return( ret ); in mbedtls_hmac_drbg_seed_buf()
159 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in hmac_drbg_reseed_core() local
180 if( ( ret = ctx->f_entropy( ctx->p_entropy, in hmac_drbg_reseed_core()
198 if( ( ret = ctx->f_entropy( ctx->p_entropy, in hmac_drbg_reseed_core()
217 if( ( ret = mbedtls_hmac_drbg_update_ret( ctx, seed, seedlen ) ) != 0 ) in hmac_drbg_reseed_core()
226 return( ret ); in hmac_drbg_reseed_core()
251 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_seed() local
254 if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 ) in mbedtls_hmac_drbg_seed()
255 return( ret ); in mbedtls_hmac_drbg_seed()
269 if( ( ret = mbedtls_md_hmac_starts( &ctx->md_ctx, ctx->V, md_size ) ) != 0 ) in mbedtls_hmac_drbg_seed()
270 return( ret ); in mbedtls_hmac_drbg_seed()
290 if( ( ret = hmac_drbg_reseed_core( ctx, custom, len, in mbedtls_hmac_drbg_seed()
293 return( ret ); in mbedtls_hmac_drbg_seed()
332 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_random_with_add() local
351 if( ( ret = mbedtls_hmac_drbg_reseed( ctx, additional, add_len ) ) != 0 ) in mbedtls_hmac_drbg_random_with_add()
352 return( ret ); in mbedtls_hmac_drbg_random_with_add()
360 if( ( ret = mbedtls_hmac_drbg_update_ret( ctx, in mbedtls_hmac_drbg_random_with_add()
370 if( ( ret = mbedtls_md_hmac_reset( &ctx->md_ctx ) ) != 0 ) in mbedtls_hmac_drbg_random_with_add()
372 if( ( ret = mbedtls_md_hmac_update( &ctx->md_ctx, in mbedtls_hmac_drbg_random_with_add()
375 if( ( ret = mbedtls_md_hmac_finish( &ctx->md_ctx, ctx->V ) ) != 0 ) in mbedtls_hmac_drbg_random_with_add()
384 if( ( ret = mbedtls_hmac_drbg_update_ret( ctx, in mbedtls_hmac_drbg_random_with_add()
393 return( ret ); in mbedtls_hmac_drbg_random_with_add()
401 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_random() local
405 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_hmac_drbg_random()
406 return( ret ); in mbedtls_hmac_drbg_random()
409 ret = mbedtls_hmac_drbg_random_with_add( ctx, output, out_len, NULL, 0 ); in mbedtls_hmac_drbg_random()
416 return( ret ); in mbedtls_hmac_drbg_random()
441 int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; in mbedtls_hmac_drbg_write_seed_file() local
448 if( ( ret = mbedtls_hmac_drbg_random( ctx, buf, sizeof( buf ) ) ) != 0 ) in mbedtls_hmac_drbg_write_seed_file()
453 ret = MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR; in mbedtls_hmac_drbg_write_seed_file()
457 ret = 0; in mbedtls_hmac_drbg_write_seed_file()
463 return( ret ); in mbedtls_hmac_drbg_write_seed_file()
468 int ret = 0; in mbedtls_hmac_drbg_update_seed_file() local
480 ret = MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG; in mbedtls_hmac_drbg_update_seed_file()
485 ret = MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR; in mbedtls_hmac_drbg_update_seed_file()
491 ret = mbedtls_hmac_drbg_update_ret( ctx, buf, n ); in mbedtls_hmac_drbg_update_seed_file()
497 if( ret != 0 ) in mbedtls_hmac_drbg_update_seed_file()
498 return( ret ); in mbedtls_hmac_drbg_update_seed_file()