Lines Matching refs:buf
227 unsigned char buf[MBEDTLS_ENTROPY_MAX_GATHER]; in entropy_gather_internal() local
243 buf, MBEDTLS_ENTROPY_MAX_GATHER, &olen ) ) != 0 ) in entropy_gather_internal()
253 entropy_update( ctx, (unsigned char) i, buf, olen ); in entropy_gather_internal()
290 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_func() local
333 memset( buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE ); in mbedtls_entropy_func()
336 mbedtls_sha512_finish( &ctx->accumulator, buf ); in mbedtls_entropy_func()
343 mbedtls_sha512_update( &ctx->accumulator, buf, MBEDTLS_ENTROPY_BLOCK_SIZE ); in mbedtls_entropy_func()
348 mbedtls_sha512( buf, MBEDTLS_ENTROPY_BLOCK_SIZE, buf, 0 ); in mbedtls_entropy_func()
350 mbedtls_sha256_finish( &ctx->accumulator, buf ); in mbedtls_entropy_func()
357 mbedtls_sha256_update( &ctx->accumulator, buf, MBEDTLS_ENTROPY_BLOCK_SIZE ); in mbedtls_entropy_func()
362 mbedtls_sha256( buf, MBEDTLS_ENTROPY_BLOCK_SIZE, buf, 0 ); in mbedtls_entropy_func()
368 memcpy( output, buf, len ); in mbedtls_entropy_func()
385 unsigned char buf[ MBEDTLS_ENTROPY_MAX_SEED_SIZE ]; 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()
391 if( mbedtls_nv_seed_write( buf, MBEDTLS_ENTROPY_BLOCK_SIZE ) < 0 ) in mbedtls_entropy_update_nv_seed()
395 memset( buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE ); in mbedtls_entropy_update_nv_seed()
396 mbedtls_entropy_update_manual( ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE ); in mbedtls_entropy_update_nv_seed()
407 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; 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()
415 if( fwrite( buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f ) != MBEDTLS_ENTROPY_BLOCK_SIZE ) in mbedtls_entropy_write_seed_file()
432 unsigned char buf[ MBEDTLS_ENTROPY_MAX_SEED_SIZE ]; in mbedtls_entropy_update_seed_file() local
444 if( fread( buf, 1, n, f ) != n ) in mbedtls_entropy_update_seed_file()
452 mbedtls_entropy_update_manual( ctx, buf, n ); in mbedtls_entropy_update_seed_file()
477 static int mbedtls_entropy_source_self_test_gather( unsigned char *buf, size_t buf_len ) in mbedtls_entropy_source_self_test_gather() argument
486 if( ( ret = mbedtls_hardware_poll( NULL, buf + entropy_len, in mbedtls_entropy_source_self_test_gather()
503 static int mbedtls_entropy_source_self_test_check_bits( const unsigned char *buf, in mbedtls_entropy_source_self_test_check_bits() argument
512 set &= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
513 unset |= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
583 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE] = { 0 }; in mbedtls_entropy_self_test() local
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()
619 for( j = 0; j < sizeof( buf ); j++ ) in mbedtls_entropy_self_test()
620 acc[j] |= buf[j]; in mbedtls_entropy_self_test()
623 for( j = 0; j < sizeof( buf ); j++ ) in mbedtls_entropy_self_test()