]> git.ipfire.org Git - thirdparty/rng-tools.git/commit
rdrand: Fix the RDRAND data reduction
authorH. Peter Anvin <hpa@linux.intel.com>
Tue, 4 Mar 2014 23:04:40 +0000 (15:04 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Tue, 4 Mar 2014 23:11:48 +0000 (15:11 -0800)
commit3e89e082e8f716fec82f21ca888b36b70177712f
treebdd4eeb2ce34d463a992dae21c4275538b1a7ed9
parent3164d3ebb3d8feb27ca59d98c53306ab93f476b2
rdrand: Fix the RDRAND data reduction

The RDRAND data reduction function was not correct.  Specifically:

1. When using AESni, in order to guarantee at least one reseed event
   per reduction stripe we need to process the data in a different
   order.  This means writing it out all the data to a buffer before
   processing it, and then process it in much larger stripes.

2. When using gcrypt, we are only performing one reduction at a time,
   so only process enough input for one reduction and only generate
   that amount of output.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
rdrand_asm.S
rngd_rdrand.c