Lines Matching refs:buf

264     unsigned char buf[MBEDTLS_ENTROPY_MAX_GATHER];  in entropy_gather_internal()  local
280 buf, MBEDTLS_ENTROPY_MAX_GATHER, &olen ) ) != 0 ) in entropy_gather_internal()
291 buf, olen ) ) != 0 ) in entropy_gather_internal()
301 mbedtls_platform_zeroize( buf, sizeof( buf ) ); in entropy_gather_internal()
333 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_func() local
381 memset( buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE ); in mbedtls_entropy_func()
389 if( ( ret = mbedtls_sha512_finish_ret( &ctx->accumulator, buf ) ) != 0 ) in mbedtls_entropy_func()
399 if( ( ret = mbedtls_sha512_update_ret( &ctx->accumulator, buf, in mbedtls_entropy_func()
406 if( ( ret = mbedtls_sha512_ret( buf, MBEDTLS_ENTROPY_BLOCK_SIZE, in mbedtls_entropy_func()
407 buf, 0 ) ) != 0 ) in mbedtls_entropy_func()
410 if( ( ret = mbedtls_sha256_finish_ret( &ctx->accumulator, buf ) ) != 0 ) in mbedtls_entropy_func()
420 if( ( ret = mbedtls_sha256_update_ret( &ctx->accumulator, buf, in mbedtls_entropy_func()
427 if( ( ret = mbedtls_sha256_ret( buf, MBEDTLS_ENTROPY_BLOCK_SIZE, in mbedtls_entropy_func()
428 buf, 0 ) ) != 0 ) in mbedtls_entropy_func()
435 memcpy( output, buf, len ); in mbedtls_entropy_func()
440 mbedtls_platform_zeroize( buf, sizeof( buf ) ); in mbedtls_entropy_func()
454 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_update_nv_seed() local
457 if( ( ret = mbedtls_entropy_func( ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE ) ) != 0 ) in mbedtls_entropy_update_nv_seed()
460 if( mbedtls_nv_seed_write( buf, MBEDTLS_ENTROPY_BLOCK_SIZE ) < 0 ) in mbedtls_entropy_update_nv_seed()
464 memset( buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE ); in mbedtls_entropy_update_nv_seed()
465 ret = mbedtls_entropy_update_manual( ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE ); in mbedtls_entropy_update_nv_seed()
476 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_write_seed_file() local
478 if( ( ret = mbedtls_entropy_func( ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE ) ) != 0 ) in mbedtls_entropy_write_seed_file()
490 if( fwrite( buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f ) != MBEDTLS_ENTROPY_BLOCK_SIZE ) in mbedtls_entropy_write_seed_file()
499 mbedtls_platform_zeroize( buf, sizeof( buf ) ); in mbedtls_entropy_write_seed_file()
512 unsigned char buf[ MBEDTLS_ENTROPY_MAX_SEED_SIZE ]; in mbedtls_entropy_update_seed_file() local
524 if( fread( buf, 1, n, f ) != n ) in mbedtls_entropy_update_seed_file()
527 ret = mbedtls_entropy_update_manual( ctx, buf, n ); in mbedtls_entropy_update_seed_file()
531 mbedtls_platform_zeroize( buf, sizeof( buf ) ); in mbedtls_entropy_update_seed_file()
559 static int mbedtls_entropy_source_self_test_gather( unsigned char *buf, size_t buf_len ) in mbedtls_entropy_source_self_test_gather() argument
568 if( ( ret = mbedtls_hardware_poll( NULL, buf + entropy_len, in mbedtls_entropy_source_self_test_gather()
585 static int mbedtls_entropy_source_self_test_check_bits( const unsigned char *buf, in mbedtls_entropy_source_self_test_check_bits() argument
594 set &= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
595 unset |= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
665 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE] = { 0 }; in mbedtls_entropy_self_test() local
685 if( ( ret = mbedtls_entropy_update_manual( &ctx, buf, sizeof buf ) ) != 0 ) in mbedtls_entropy_self_test()
698 if( ( ret = mbedtls_entropy_func( &ctx, buf, sizeof( buf ) ) ) != 0 ) in mbedtls_entropy_self_test()
701 for( j = 0; j < sizeof( buf ); j++ ) in mbedtls_entropy_self_test()
702 acc[j] |= buf[j]; in mbedtls_entropy_self_test()
705 for( j = 0; j < sizeof( buf ); j++ ) in mbedtls_entropy_self_test()