Lines Matching refs:buf

234     unsigned char buf[MBEDTLS_ENTROPY_MAX_GATHER];  in entropy_gather_internal()  local
251 buf, MBEDTLS_ENTROPY_MAX_GATHER, &olen)) != 0) { in entropy_gather_internal()
260 buf, olen)) != 0) { in entropy_gather_internal()
272 mbedtls_platform_zeroize(buf, sizeof(buf)); in entropy_gather_internal()
306 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_func() local
355 memset(buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE); in mbedtls_entropy_func()
363 if ((ret = mbedtls_sha512_finish(&ctx->accumulator, buf)) != 0) { in mbedtls_entropy_func()
375 if ((ret = mbedtls_sha512_update(&ctx->accumulator, buf, in mbedtls_entropy_func()
383 if ((ret = mbedtls_sha512(buf, MBEDTLS_ENTROPY_BLOCK_SIZE, in mbedtls_entropy_func()
384 buf, 0)) != 0) { in mbedtls_entropy_func()
388 if ((ret = mbedtls_sha256_finish(&ctx->accumulator, buf)) != 0) { in mbedtls_entropy_func()
400 if ((ret = mbedtls_sha256_update(&ctx->accumulator, buf, in mbedtls_entropy_func()
408 if ((ret = mbedtls_sha256(buf, MBEDTLS_ENTROPY_BLOCK_SIZE, in mbedtls_entropy_func()
409 buf, 0)) != 0) { in mbedtls_entropy_func()
418 memcpy(output, buf, len); in mbedtls_entropy_func()
423 mbedtls_platform_zeroize(buf, sizeof(buf)); in mbedtls_entropy_func()
438 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_update_nv_seed() local
441 if ((ret = mbedtls_entropy_func(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE)) != 0) { in mbedtls_entropy_update_nv_seed()
445 if (mbedtls_nv_seed_write(buf, MBEDTLS_ENTROPY_BLOCK_SIZE) < 0) { in mbedtls_entropy_update_nv_seed()
450 memset(buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE); in mbedtls_entropy_update_nv_seed()
451 ret = mbedtls_entropy_update_manual(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE); in mbedtls_entropy_update_nv_seed()
462 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_write_seed_file() local
464 if ((ret = mbedtls_entropy_func(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE)) != 0) { in mbedtls_entropy_write_seed_file()
477 if (fwrite(buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f) != MBEDTLS_ENTROPY_BLOCK_SIZE) { in mbedtls_entropy_write_seed_file()
485 mbedtls_platform_zeroize(buf, sizeof(buf)); in mbedtls_entropy_write_seed_file()
499 unsigned char buf[MBEDTLS_ENTROPY_MAX_SEED_SIZE]; in mbedtls_entropy_update_seed_file() local
516 if (fread(buf, 1, n, f) != n) { in mbedtls_entropy_update_seed_file()
519 ret = mbedtls_entropy_update_manual(ctx, buf, n); in mbedtls_entropy_update_seed_file()
524 mbedtls_platform_zeroize(buf, sizeof(buf)); in mbedtls_entropy_update_seed_file()
551 static int mbedtls_entropy_source_self_test_gather(unsigned char *buf, size_t buf_len) in mbedtls_entropy_source_self_test_gather() argument
559 if ((ret = mbedtls_hardware_poll(NULL, buf + entropy_len, in mbedtls_entropy_source_self_test_gather()
576 static int mbedtls_entropy_source_self_test_check_bits(const unsigned char *buf, in mbedtls_entropy_source_self_test_check_bits() argument
584 set &= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
585 unset |= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
659 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE] = { 0 }; in mbedtls_entropy_self_test() local
680 if ((ret = mbedtls_entropy_update_manual(&ctx, buf, sizeof(buf))) != 0) { in mbedtls_entropy_self_test()
693 if ((ret = mbedtls_entropy_func(&ctx, buf, sizeof(buf))) != 0) { in mbedtls_entropy_self_test()
697 for (j = 0; j < sizeof(buf); j++) { in mbedtls_entropy_self_test()
698 acc[j] |= buf[j]; in mbedtls_entropy_self_test()
702 for (j = 0; j < sizeof(buf); j++) { in mbedtls_entropy_self_test()