random: credit architectural init the exact amount
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 12 May 2022 13:32:26 +0000 (15:32 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 18 May 2022 13:53:53 +0000 (15:53 +0200)
commit12e45a2a6308105469968951e6d563e8f4fea187
tree30bed7b967450540055573e2be8162489b64cde5
parent2f14062bb14b0fcfcc21e6dc7d5b5c0d25966164
random: credit architectural init the exact amount

RDRAND and RDSEED can fail sometimes, which is fine. We currently
initialize the RNG with 512 bits of RDRAND/RDSEED. We only need 256 bits
of those to succeed in order to initialize the RNG. Instead of the
current "all or nothing" approach, actually credit these contributions
the amount that is actually contributed.

Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c