Re: Lightweight support for instruction RNGs

Thor Lancelot Simon <[email protected]> Sat, 19 Dec 2015 19:46:47 -0500
Newsgroups gmane.os.netbsd.devel.crypto,gmane.os.netbsd.devel.kernel,gmane.os.netbsd.ports.x86-64,gmane.os.netbsd.ports.i386,gmane.os.netbsd.devel.security
Message-ID <[email protected]>
On Sat, Dec 19, 2015 at 04:42:54PM -0800, Alistair Crooks wrote:
> Have you tried running this with pkgsrc/math/dieharder? I'd be
> interested to see the results (the current version in pkgsrc -- 3.31.1
> -- is much better than the previous one, and displays its results in a
> much more useful way than previously). Not the be-all and end-all, but
> still worthwhile running it.

I have to ask, how would you hook it up and what exactly would be the
point?  If you want to run RDRAND output through dieharder, you don't
need to use the kernel for that -- the instruction is not a privileged
instruction.

And suppose you had a nasty tainted CPU where RDRAND actually just
fed you the output of AES-256 with a key known to the adversary.  That
output will pass statistical tests just fine -- all of them -- since
if the output of the cipher is distinguishable from truly random data
without knowledge of the key, that's a pretty good indicator there's
a problem with the cipher...

Thor