Linux cryptographic layer development
 help / color / mirror / Atom feed
From: "George Spelvin" <linux@horizon.com>
To: linux@horizon.com, smueller@chronox.de
Cc: herbert@gondor.apana.org.au, jarod@redhat.com,
	linux-crypto@vger.kernel.org, nhorman@tuxdriver.com
Subject: Re: Is ansi_cprng.c supposed to be an implmentation of X9.31?
Date: 1 Dec 2014 23:55:18 -0500	[thread overview]
Message-ID: <20141202045518.27813.qmail@ns.horizon.com> (raw)
In-Reply-To: <2067542.hCsFeEhKF1@tauon>

>> The other one, which I have to think *very* hard about, is whether
>> using the same seed material as /dev/random in this much weaker
>> cryptographic construction will introduce a flaw in *it*.

> I have no idea what you are referring to here. The caller is requred to 
> seed the DRNG. Typically that is done with a call to get_random_bytes. 
> As Neil mentioned, the X9.31 DRNG implementation does not seed itself.

Er, yes it does.  Not the key, but the IV vector V[].

Here's the closest thing I can find on-line to a direct quote
from the ANSI Spec:

http://www.untruth.org/~josh/security/ansi931rng.PDF

"Let DT be a date/time vector which is updated on each iteration."

This timestamp is a source of continuous reseed material.  The spec
doesn't impose specific resolution requirements, but it's hopefully
obvious that the finer, the better.  The goal is a vector which changes
per iteration.

There are limitations due to its finite entropy and lack of catastrophic
reseeding, as Kelsey & Schneier pointed out:

https://www.schneier.com/paper-prngs.html

but it is intended as an entropy source.

Hopefully very soon I'll have a patch series to post.  (Unfortunately,
I just managed to oops my kernel and need to reboot to continue testing.)

If I don't do much more, it'll be patch 13/17 in the series.  I think
the use of get_random_int() is a good compromise between the raw
random_get_entropy() timestamp and the (too heavy) get_random_bytes().

  reply	other threads:[~2014-12-02  4:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28 23:23 Is ansi_cprng.c supposed to be an implmentation of X9.31? George Spelvin
2014-11-29 17:58 ` Neil Horman
2014-11-29 19:32   ` George Spelvin
2014-11-30  1:16     ` Neil Horman
2014-11-30 14:36     ` Stephan Mueller
2014-12-02  4:55       ` George Spelvin [this message]
2014-12-02 13:22         ` Neil Horman
2014-12-02 17:56           ` George Spelvin
2014-11-30 14:31   ` Stephan Mueller
2014-11-30 14:26 ` Stephan Mueller
2014-12-02  5:39   ` George Spelvin
2014-12-02 13:44     ` Neil Horman
2014-12-02 19:43       ` George Spelvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141202045518.27813.qmail@ns.horizon.com \
    --to=linux@horizon.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jarod@redhat.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=smueller@chronox.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox