Lines Matching refs:buf
203 unsigned char buf[MBEDTLS_ENTROPY_MAX_GATHER]; in entropy_gather_internal() local
220 buf, MBEDTLS_ENTROPY_MAX_GATHER, &olen)) != 0) { in entropy_gather_internal()
229 buf, olen)) != 0) { in entropy_gather_internal()
241 mbedtls_platform_zeroize(buf, sizeof(buf)); in entropy_gather_internal()
275 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_func() local
324 memset(buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE); in mbedtls_entropy_func()
331 if ((ret = mbedtls_md_finish(&ctx->accumulator, buf)) != 0) { in mbedtls_entropy_func()
349 if ((ret = mbedtls_md_update(&ctx->accumulator, buf, in mbedtls_entropy_func()
358 buf, MBEDTLS_ENTROPY_BLOCK_SIZE, buf)) != 0) { in mbedtls_entropy_func()
366 memcpy(output, buf, len); in mbedtls_entropy_func()
371 mbedtls_platform_zeroize(buf, sizeof(buf)); in mbedtls_entropy_func()
386 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE]; in mbedtls_entropy_update_nv_seed() local
389 if ((ret = mbedtls_entropy_func(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE)) != 0) { in mbedtls_entropy_update_nv_seed()
393 if (mbedtls_nv_seed_write(buf, MBEDTLS_ENTROPY_BLOCK_SIZE) < 0) { in mbedtls_entropy_update_nv_seed()
398 memset(buf, 0, MBEDTLS_ENTROPY_BLOCK_SIZE); in mbedtls_entropy_update_nv_seed()
399 ret = mbedtls_entropy_update_manual(ctx, buf, MBEDTLS_ENTROPY_BLOCK_SIZE); in mbedtls_entropy_update_nv_seed()
410 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()
425 if (fwrite(buf, 1, MBEDTLS_ENTROPY_BLOCK_SIZE, f) != MBEDTLS_ENTROPY_BLOCK_SIZE) { in mbedtls_entropy_write_seed_file()
433 mbedtls_platform_zeroize(buf, sizeof(buf)); in mbedtls_entropy_write_seed_file()
447 unsigned char buf[MBEDTLS_ENTROPY_MAX_SEED_SIZE]; in mbedtls_entropy_update_seed_file() local
464 if (fread(buf, 1, n, f) != n) { in mbedtls_entropy_update_seed_file()
467 ret = mbedtls_entropy_update_manual(ctx, buf, n); in mbedtls_entropy_update_seed_file()
472 mbedtls_platform_zeroize(buf, sizeof(buf)); in mbedtls_entropy_update_seed_file()
499 static int mbedtls_entropy_source_self_test_gather(unsigned char *buf, size_t buf_len) in mbedtls_entropy_source_self_test_gather() argument
507 if ((ret = mbedtls_hardware_poll(NULL, buf + entropy_len, in mbedtls_entropy_source_self_test_gather()
524 static int mbedtls_entropy_source_self_test_check_bits(const unsigned char *buf, in mbedtls_entropy_source_self_test_check_bits() argument
532 set &= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
533 unset |= buf[i]; in mbedtls_entropy_source_self_test_check_bits()
607 unsigned char buf[MBEDTLS_ENTROPY_BLOCK_SIZE] = { 0 }; in mbedtls_entropy_self_test() local
628 if ((ret = mbedtls_entropy_update_manual(&ctx, buf, sizeof(buf))) != 0) { in mbedtls_entropy_self_test()
641 if ((ret = mbedtls_entropy_func(&ctx, buf, sizeof(buf))) != 0) { in mbedtls_entropy_self_test()
645 for (j = 0; j < sizeof(buf); j++) { in mbedtls_entropy_self_test()
646 acc[j] |= buf[j]; in mbedtls_entropy_self_test()
650 for (j = 0; j < sizeof(buf); j++) { in mbedtls_entropy_self_test()