Lines Matching full:rng
36 * The Windows 10 RNG bears some similarity to Fortuna, which Ferguson was also
56 * interpretation of the document is that the Windows RNG infrastructure
145 struct fxrng_buffered_rng **pcpu_brng_p, *rng, *tmp; in _fxrng_alg_read() local
157 rng = (void *)atomic_load_acq_ptr((uintptr_t *)pcpu_brng_p); in _fxrng_alg_read()
164 if (__predict_false(rng == NULL)) { in _fxrng_alg_read()
190 rng = malloc_domainset(sizeof(*rng), M_ENTROPY, ds, in _fxrng_alg_read()
192 if (rng == NULL) { in _fxrng_alg_read()
194 rng = &fxrng_root; in _fxrng_alg_read()
198 fxrng_brng_init(rng); in _fxrng_alg_read()
211 FXRNG_BRNG_LOCK(rng); in _fxrng_alg_read()
212 FXRNG_BRNG_UNLOCK(rng); in _fxrng_alg_read()
215 sizeof(newkey), &rng->brng_generation); in _fxrng_alg_read()
218 fxrng_rng_setkey(&rng->brng_rng, newkey, sizeof(newkey)); in _fxrng_alg_read()
222 * We have a valid RNG. Try to install it, or grab the other in _fxrng_alg_read()
228 (uintptr_t *)&tmp, (uintptr_t)rng)) in _fxrng_alg_read()
239 free(rng, M_ENTROPY); in _fxrng_alg_read()
243 rng = tmp; in _fxrng_alg_read()
247 /* At this point we have a valid, initialized and seeded rng pointer. */ in _fxrng_alg_read()
248 FXRNG_BRNG_LOCK(rng); in _fxrng_alg_read()
250 *seed_version_out = rng->brng_generation; in _fxrng_alg_read()
251 fxrng_brng_read(rng, output, nbytes); in _fxrng_alg_read()
252 FXRNG_BRNG_ASSERT_NOT(rng); in _fxrng_alg_read()