random: use hash function for crng_slow_load()
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 8 Feb 2022 18:23:17 +0000 (19:23 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 16 Feb 2022 23:00:08 +0000 (00:00 +0100)
commitfd438287358273f31c1f1827a099ae4ddcb9e179
tree43ae9e520b168c63757e5fe3d3ff00c757fd001b
parentf73c522c4c2094d1c434083ae362bbd4a2ed7348
random: use hash function for crng_slow_load()

Since we have a hash function that's really fast, and the goal of
crng_slow_load() is reportedly to "touch all of the crng's state", we
can just hash the old state together with the new state and call it a
day. This way we dont need to reason about another LFSR or worry about
various attacks there. This code is only ever used at early boot and
then never again.

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c