]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
s390/prng: Adjust generation of entropy to produce real 256 bits.
authorHarald Freudenberger <freude@linux.vnet.ibm.com>
Tue, 20 Dec 2016 10:32:47 +0000 (11:32 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 31 Jan 2017 09:46:10 +0000 (10:46 +0100)
commitd34b1acb78af41b8b8d5c60972b6555ea19f7564
tree34bdf857eb6d03c5eb0a3d1c4a72090f7f66417b
parenta4f2779ecf2f42b0997fedef6fd20a931c40a3e3
s390/prng: Adjust generation of entropy to produce real 256 bits.

The generate_entropy function used a sha256 for compacting
together 256 bits of entropy into 32 bytes hash. However, it
is questionable if a sha256 can really be used here, as
potential collisions may reduce the max entropy fitting into
a 32 byte hash value. So this batch introduces the use of
sha512 instead and the required buffer adjustments for the
calling functions.

Further more the working buffer for the generate_entropy
function has been widened from one page to two pages. So now
1024 stckf invocations are used to gather 256 bits of
entropy. This has been done to be on the save side if the
jitters of stckf values isn't as good as supposed.

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/crypto/prng.c