]> Pileus Git - ~andy/linux/commit
random: mix in architectural randomness earlier in extract_buf()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 21 Sep 2013 22:06:02 +0000 (18:06 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 10 Oct 2013 18:32:13 +0000 (14:32 -0400)
commit85a1f77716cf546d9b9c42e2848b5712f51ba1ee
tree80b598761ad54d8eab82eab20ca59c13b765b8f7
parent61875f30daf60305712e25b209ef41ced2635bad
random: mix in architectural randomness earlier in extract_buf()

Previously if CPU chip had a built-in random number generator (i.e.,
RDRAND on newer x86 chips), we mixed it in at the very end of
extract_buf() using an XOR operation.

We now mix it in right after the calculate a hash across the entire
pool.  This has the advantage that any contribution of entropy from
the CPU's HWRNG will get mixed back into the pool.  In addition, it
means that if the HWRNG has any defects (either accidentally or
maliciously introduced), this will be mitigated via the non-linear
transform of the SHA-1 hash function before we hand out generated
output.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
drivers/char/random.c