Lines Matching refs:buf

165 static void hexdump(unsigned char *buf, unsigned int len)  in hexdump()  argument
169 buf, len, false); in hexdump()
172 static int __testmgr_alloc_buf(char *buf[XBUFSIZE], int order) in __testmgr_alloc_buf()
177 buf[i] = (char *)__get_free_pages(GFP_KERNEL, order); in __testmgr_alloc_buf()
178 if (!buf[i]) in __testmgr_alloc_buf()
186 free_pages((unsigned long)buf[i], order); in __testmgr_alloc_buf()
191 static int testmgr_alloc_buf(char *buf[XBUFSIZE]) in testmgr_alloc_buf()
193 return __testmgr_alloc_buf(buf, 0); in testmgr_alloc_buf()
196 static void __testmgr_free_buf(char *buf[XBUFSIZE], int order) in __testmgr_free_buf()
201 free_pages((unsigned long)buf[i], order); in __testmgr_free_buf()
204 static void testmgr_free_buf(char *buf[XBUFSIZE]) in testmgr_free_buf()
206 __testmgr_free_buf(buf, 0); in testmgr_free_buf()
940 static void flip_random_bit(struct rnd_state *rng, u8 *buf, size_t size) in flip_random_bit() argument
945 buf[bitpos / 8] ^= 1 << (bitpos % 8); in flip_random_bit()
949 static void flip_random_byte(struct rnd_state *rng, u8 *buf, size_t size) in flip_random_byte() argument
951 buf[prandom_u32_below(rng, size)] ^= 0xff; in flip_random_byte()
955 static void mutate_buffer(struct rnd_state *rng, u8 *buf, size_t size) in mutate_buffer() argument
965 flip_random_bit(rng, buf, size); in mutate_buffer()
972 flip_random_byte(rng, buf, size); in mutate_buffer()
977 static void generate_random_bytes(struct rnd_state *rng, u8 *buf, size_t count) in generate_random_bytes() argument
1001 memset(buf, b, count); in generate_random_bytes()
1002 mutate_buffer(rng, buf, count); in generate_random_bytes()
1009 buf[i] = b; in generate_random_bytes()
1010 mutate_buffer(rng, buf, count); in generate_random_bytes()
1014 prandom_bytes_state(rng, buf, count); in generate_random_bytes()
3583 unsigned char *buf = kzalloc(test->expectedlen, GFP_KERNEL); in drbg_cavs_test() local
3585 if (!buf) in drbg_cavs_test()
3590 kfree_sensitive(buf); in drbg_cavs_test()
3611 buf, test->expectedlen, &addtl, &test_data); in drbg_cavs_test()
3614 buf, test->expectedlen, &addtl); in drbg_cavs_test()
3626 buf, test->expectedlen, &addtl, &test_data); in drbg_cavs_test()
3629 buf, test->expectedlen, &addtl); in drbg_cavs_test()
3637 ret = memcmp(test->expected, buf, test->expectedlen); in drbg_cavs_test()
3641 kfree_sensitive(buf); in drbg_cavs_test()