Lines Matching refs:buf
18 prng_sanitycheck(uint8_t *buf, size_t buf_size) in prng_sanitycheck() argument
21 qsort(buf, nblocks, BLOCK_SIZE, cmp); in prng_sanitycheck()
25 T_ASSERT_NE(memcmp(buf, buf + BLOCK_SIZE, BLOCK_SIZE), 0, "duplicate block"); in prng_sanitycheck()
26 buf += BLOCK_SIZE; in prng_sanitycheck()
33 uint8_t *buf = ((uint8_t *)ctx) + (BUF_SIZE * i); in prng_getentropy() local
37 T_ASSERT_POSIX_SUCCESS(getentropy(&buf[j], 256), "getentropy"); in prng_getentropy()
40 prng_sanitycheck(buf, BUF_SIZE); in prng_getentropy()
46 uint8_t *buf = ((uint8_t *)ctx) + (BUF_SIZE * i); in prng_devrandom() local
54 ssize_t m = read(fd, buf, n); in prng_devrandom()
59 buf += m; in prng_devrandom()
62 buf = ((uint8_t *)ctx) + (BUF_SIZE * i); in prng_devrandom()
63 prng_sanitycheck(buf, BUF_SIZE); in prng_devrandom()
70 uint8_t *buf = malloc(BUF_SIZE * ncpu); variable
72 T_ASSERT_NOTNULL(buf, "malloc");
74 dispatch_apply_f(ncpu, DISPATCH_APPLY_AUTO, buf, prng_getentropy);
76 dispatch_apply_f(ncpu, DISPATCH_APPLY_AUTO, buf, prng_devrandom);
78 prng_sanitycheck(buf, BUF_SIZE * ncpu);
80 free(buf);