Lines Matching refs:buf

199     unsigned char buf[MBEDTLS_ENTROPY_MAX_GATHER];  in entropy_gather_internal()  local
216 buf, MBEDTLS_ENTROPY_MAX_GATHER, &olen)) != 0) { in entropy_gather_internal()
225 buf, olen)) != 0) { in entropy_gather_internal()
237 mbedtls_platform_zeroize(buf, sizeof(buf)); in entropy_gather_internal()
271 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_func() local
320 memset(buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE); in mbedtls_entropy_func()
327 if ((ret = mbedtls_md_finish(&ctx->accumulator, buf)) != 0) { in mbedtls_entropy_func()
345 if ((ret = mbedtls_md_update(&ctx->accumulator, buf, in mbedtls_entropy_func()
354 buf, MBEDTLS_ENTROPY_BLOCK_SIZE, buf)) != 0) { in mbedtls_entropy_func()
362 memcpy(output, buf, len); in mbedtls_entropy_func()
367 mbedtls_platform_zeroize(buf, sizeof(buf)); in mbedtls_entropy_func()
382 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_update_nv_seed() local
385 if ((ret = mbedtls_entropy_func(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE)) != 0) { in mbedtls_entropy_update_nv_seed()
389 if (mbedtls_nv_seed_write(buf, MBEDTLS_ENTROPY_BLOCK_SIZE) < 0) { in mbedtls_entropy_update_nv_seed()
394 memset(buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE); in mbedtls_entropy_update_nv_seed()
395 ret = mbedtls_entropy_update_manual(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE); in mbedtls_entropy_update_nv_seed()
406 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_write_seed_file() local
408 if ((ret = mbedtls_entropy_func(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE)) != 0) { in mbedtls_entropy_write_seed_file()
421 if (fwrite(buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f) != MBEDTLS_ENTROPY_BLOCK_SIZE) { in mbedtls_entropy_write_seed_file()
429 mbedtls_platform_zeroize(buf, sizeof(buf)); in mbedtls_entropy_write_seed_file()
443 unsigned char buf[MBEDTLS_ENTROPY_MAX_SEED_SIZE]; in mbedtls_entropy_update_seed_file() local
460 if (fread(buf, 1, n, f) != n) { in mbedtls_entropy_update_seed_file()
463 ret = mbedtls_entropy_update_manual(ctx, buf, n); in mbedtls_entropy_update_seed_file()
468 mbedtls_platform_zeroize(buf, sizeof(buf)); in mbedtls_entropy_update_seed_file()
495 static int mbedtls_entropy_source_self_test_gather(unsigned char *buf, size_t buf_len) in mbedtls_entropy_source_self_test_gather() argument
503 if ((ret = mbedtls_hardware_poll(NULL, buf + entropy_len, in mbedtls_entropy_source_self_test_gather()
520 static int mbedtls_entropy_source_self_test_check_bits(const unsigned char *buf, in mbedtls_entropy_source_self_test_check_bits() argument
528 set &= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
529 unset |= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
603 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE] = { 0 }; in mbedtls_entropy_self_test() local
624 if ((ret = mbedtls_entropy_update_manual(&ctx, buf, sizeof(buf))) != 0) { in mbedtls_entropy_self_test()
637 if ((ret = mbedtls_entropy_func(&ctx, buf, sizeof(buf))) != 0) { in mbedtls_entropy_self_test()
641 for (j = 0; j < sizeof(buf); j++) { in mbedtls_entropy_self_test()
642 acc[j] |= buf[j]; in mbedtls_entropy_self_test()
646 for (j = 0; j < sizeof(buf); j++) { in mbedtls_entropy_self_test()