Lines Matching defs:buf
127 static void ares_rc4_prng(ares_rand_rc4 *rc4_state, unsigned char *buf,
140 buf[cnt] = S[(S[i] + S[j]) % 256];
258 static void ares__rand_bytes_fetch(ares_rand_state *state, unsigned char *buf,
267 RtlGenRandom(buf, (ULONG)len);
270 arc4random_buf(buf, len);
278 ssize_t rv = getrandom(buf + bytes_read, n > 256 ? 256 : n, 0);
301 size_t rv = fread(buf + bytes_read, 1, len - bytes_read,
315 ares_rc4_prng(&state->state.rc4, buf, len);
325 void ares__rand_bytes(ares_rand_state *state, unsigned char *buf, size_t len)
338 memcpy(buf, state->cache + offset, len);
344 ares__rand_bytes_fetch(state, buf, len);