Lines Matching +full:mix +full:-
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
47 #include <crypto/rijndael/rijndael-api-fst.h>
74 nbytes -= chunklen; in fxrng_rng_keystream_internal()
86 uint128_t ctr; /* Native-endian. */ in fxrng_chacha_nonce_add64()
128 fxrng_rng_keystream_internal(&rng->rng_prf, newkey, sizeof(newkey)); in fxrng_rng_genrandom_internal()
131 memcpy(&ctx_copy, &rng->rng_prf, sizeof(ctx_copy)); in fxrng_rng_genrandom_internal()
139 fxrng_chacha_nonce_add64(&rng->rng_prf, blockcount); in fxrng_rng_genrandom_internal()
141 /* Re-key before dropping the lock. */ in fxrng_rng_genrandom_internal()
142 chacha_keysetup(&rng->rng_prf, newkey, sizeof(newkey) * 8); in fxrng_rng_genrandom_internal()
147 p_ctx = &rng->rng_prf; in fxrng_rng_genrandom_internal()
156 /* Re-key before exit. */ in fxrng_rng_genrandom_internal()
157 chacha_keysetup(&rng->rng_prf, newkey, sizeof(newkey) * 8); in fxrng_rng_genrandom_internal()
176 struct fxrng_hash mix; in fxrng_rng_reseed_internal() local
183 fxrng_hash_init(&mix); in fxrng_rng_reseed_internal()
185 fxrng_rng_keystream_internal(&rng->rng_prf, u.root_state, in fxrng_rng_reseed_internal()
187 fxrng_hash_update(&mix, u.root_state, sizeof(u.root_state)); in fxrng_rng_reseed_internal()
189 fxrng_hash_update(&mix, src, sz); in fxrng_rng_reseed_internal()
197 fxrng_hash_update(&mix, src, sz); in fxrng_rng_reseed_internal()
201 fxrng_hash_finish(&mix, u.hash_out, sizeof(u.hash_out)); in fxrng_rng_reseed_internal()
212 chacha_keysetup(&rng->rng_prf, u.hash_out, FX_CHACHA20_KEYSIZE * 8); in fxrng_rng_reseed_internal()
214 /* 'mix' zeroed by fxrng_hash_finish(). */ in fxrng_rng_reseed_internal()
221 * Directly reseed the root RNG from a first-time entropy source,
230 fxrng_rng_reseed_internal(rng, true, &event->he_somecounter, in fxrng_rng_src_reseed()
231 sizeof(event->he_somecounter), (const void *)event->he_entropy, in fxrng_rng_src_reseed()
232 (size_t)event->he_size, NULL); in fxrng_rng_src_reseed()