Lines Matching refs:nbytes
163 size_t nbytes) in fxrng_brng_getbytes_internal() argument
169 if (__predict_false(nbytes == 0)) { in fxrng_brng_getbytes_internal()
175 if (rng->brng_avail_idx + nbytes <= sizeof(rng->brng_buffer)) { in fxrng_brng_getbytes_internal()
176 memcpy(buf, &rng->brng_buffer[rng->brng_avail_idx], nbytes); in fxrng_brng_getbytes_internal()
177 explicit_bzero(&rng->brng_buffer[rng->brng_avail_idx], nbytes); in fxrng_brng_getbytes_internal()
178 rng->brng_avail_idx += nbytes; in fxrng_brng_getbytes_internal()
184 if (nbytes < sizeof(rng->brng_buffer)) { in fxrng_brng_getbytes_internal()
190 ASSERT_DEBUG(nbytes > rem, "invariant"); in fxrng_brng_getbytes_internal()
195 nbytes -= rem; in fxrng_brng_getbytes_internal()
196 ASSERT_DEBUG(nbytes != 0, "invariant"); in fxrng_brng_getbytes_internal()
208 memcpy(buf, &rng->brng_buffer[rng->brng_avail_idx], nbytes); in fxrng_brng_getbytes_internal()
209 explicit_bzero(&rng->brng_buffer[rng->brng_avail_idx], nbytes); in fxrng_brng_getbytes_internal()
210 rng->brng_avail_idx += nbytes; in fxrng_brng_getbytes_internal()
216 fxrng_rng_genrandom_internal(&rng->brng_rng, buf, nbytes, true); in fxrng_brng_getbytes_internal()
252 fxrng_brng_read(struct fxrng_buffered_rng *rng, void *buf, size_t nbytes) in fxrng_brng_read() argument
311 fxrng_brng_getbytes_internal(rng, buf, nbytes); in fxrng_brng_read()