Lines Matching refs:ret
135 int index, ret = 0; in mbedtls_entropy_add_source() local
138 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_add_source()
139 return( ret ); in mbedtls_entropy_add_source()
145 ret = MBEDTLS_ERR_ENTROPY_MAX_SOURCES; in mbedtls_entropy_add_source()
162 return( ret ); in mbedtls_entropy_add_source()
204 int ret; in mbedtls_entropy_update_manual() local
207 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_update_manual()
208 return( ret ); in mbedtls_entropy_update_manual()
211 ret = entropy_update( ctx, MBEDTLS_ENTROPY_SOURCE_MANUAL, data, len ); in mbedtls_entropy_update_manual()
218 return( ret ); in mbedtls_entropy_update_manual()
226 int ret, i, have_one_strong = 0; in entropy_gather_internal() local
242 if( ( ret = ctx->source[i].f_source( ctx->source[i].p_source, in entropy_gather_internal()
245 return( ret ); in entropy_gather_internal()
269 int ret; in mbedtls_entropy_gather() local
272 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_gather()
273 return( ret ); in mbedtls_entropy_gather()
276 ret = entropy_gather_internal( ctx ); in mbedtls_entropy_gather()
283 return( ret ); in mbedtls_entropy_gather()
288 int ret, count = 0, i, done; in mbedtls_entropy_func() local
302 if( ( ret = mbedtls_entropy_update_nv_seed( ctx ) ) != 0 ) in mbedtls_entropy_func()
303 return( ret ); in mbedtls_entropy_func()
308 if( ( ret = mbedtls_mutex_lock( &ctx->mutex ) ) != 0 ) in mbedtls_entropy_func()
309 return( ret ); in mbedtls_entropy_func()
319 ret = MBEDTLS_ERR_ENTROPY_SOURCE_FAILED; in mbedtls_entropy_func()
323 if( ( ret = entropy_gather_internal( ctx ) ) != 0 ) in mbedtls_entropy_func()
370 ret = 0; in mbedtls_entropy_func()
378 return( ret ); in mbedtls_entropy_func()
384 int ret = MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR; in mbedtls_entropy_update_nv_seed() local
388 if( ( ret = mbedtls_entropy_func( ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE ) ) != 0 ) in mbedtls_entropy_update_nv_seed()
389 return( ret ); in mbedtls_entropy_update_nv_seed()
405 int ret = MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR; in mbedtls_entropy_write_seed_file() local
412 if( ( ret = mbedtls_entropy_func( ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE ) ) != 0 ) in mbedtls_entropy_write_seed_file()
417 ret = MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR; in mbedtls_entropy_write_seed_file()
421 ret = 0; in mbedtls_entropy_write_seed_file()
425 return( ret ); in mbedtls_entropy_write_seed_file()
479 int ret = 0; in mbedtls_entropy_source_self_test_gather() local
486 if( ( ret = mbedtls_hardware_poll( NULL, buf + entropy_len, in mbedtls_entropy_source_self_test_gather()
488 return( ret ); in mbedtls_entropy_source_self_test_gather()
496 ret = 1; in mbedtls_entropy_source_self_test_gather()
499 return( ret ); in mbedtls_entropy_source_self_test_gather()
532 int ret = 0; in mbedtls_entropy_source_self_test() local
542 if( ( ret = mbedtls_entropy_source_self_test_gather( buf0, sizeof( buf0 ) ) ) != 0 ) in mbedtls_entropy_source_self_test()
544 if( ( ret = mbedtls_entropy_source_self_test_gather( buf1, sizeof( buf1 ) ) ) != 0 ) in mbedtls_entropy_source_self_test()
548 if( ( ret = mbedtls_entropy_source_self_test_check_bits( buf0, sizeof( buf0 ) ) ) != 0 ) in mbedtls_entropy_source_self_test()
550 if( ( ret = mbedtls_entropy_source_self_test_check_bits( buf1, sizeof( buf1 ) ) ) != 0 ) in mbedtls_entropy_source_self_test()
555 ret = memcmp( buf0, buf1, sizeof( buf0 ) ) == 0; in mbedtls_entropy_source_self_test()
560 if( ret != 0 ) in mbedtls_entropy_source_self_test()
568 return( ret != 0 ); in mbedtls_entropy_source_self_test()
580 int ret = 1; in mbedtls_entropy_self_test() local
595 if( ( ret = mbedtls_entropy_gather( &ctx ) ) != 0 ) in mbedtls_entropy_self_test()
598 ret = mbedtls_entropy_add_source( &ctx, entropy_dummy_source, NULL, 16, in mbedtls_entropy_self_test()
600 if( ret != 0 ) in mbedtls_entropy_self_test()
603 if( ( ret = mbedtls_entropy_update_manual( &ctx, buf, sizeof buf ) ) != 0 ) in mbedtls_entropy_self_test()
616 if( ( ret = mbedtls_entropy_func( &ctx, buf, sizeof( buf ) ) ) != 0 ) in mbedtls_entropy_self_test()
627 ret = 1; in mbedtls_entropy_self_test()
633 if( ( ret = mbedtls_entropy_source_self_test( 0 ) ) != 0 ) in mbedtls_entropy_self_test()
643 if( ret != 0 ) in mbedtls_entropy_self_test()
651 return( ret != 0 ); in mbedtls_entropy_self_test()