]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: drbg - Remove redundant reseeding based on random.c state
authorEric Biggers <ebiggers@kernel.org>
Mon, 20 Apr 2026 06:34:20 +0000 (23:34 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 7 May 2026 08:10:01 +0000 (16:10 +0800)
commita918c3680d2ea1d3c2df589397c0ffd4dac2ceaa
tree8fe78e778ca87be9fc69dcb26a5f2237aecdf2bf
parent005b19f18ea9fc51fc35fbcb27759ae83c7c89f8
crypto: drbg - Remove redundant reseeding based on random.c state

We're now incorporating 32 bytes from get_random_bytes() in the
additional input string on every request.  The additional input string
is processed with a call to drbg_hmac_update(), which is exactly how the
seed is processed.  Thus, in reality this is as good as a reseed.

From the perspective of FIPS 140-3, it isn't as good as a reseed.  But
it doesn't actually matter, because from FIPS's point of view
get_random_bytes() provides zero entropy anyway.

Thus, neither the reseed with more get_random_bytes() every 300s, nor
the logic that reseeds more frequently before rng_is_initialized(), is
actually needed anymore.  Remove it to simplify the code significantly.

(Technically the use of get_random_bytes() in drbg_seed() itself could
be removed too.  But it's safer to keep it there for now.)

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/drbg.c