mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "George Spelvin" <linux@sciencehorizons.net>
To: smueller@chronox.de, tytso@mit.edu
Cc: andi@firstfloor.org, cryptography@lakedaemon.net,
	herbert@gondor.apana.org.au, hpa@linux.intel.com,
	joe@perches.com, jsd@av8n.com, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux@horizon.com, pavel@ucw.cz,
	sandyinchina@gmail.com
Subject: Re: [PATCH v5 0/7] /dev/random - a new approach
Date: 20 Jun 2016 14:44:03 -0400	[thread overview]
Message-ID: <20160620184403.21972.qmail@ns.sciencehorizons.net> (raw)
In-Reply-To: <1639356.ozYDPrS7jM@tauon.atsec.com>

> With that being said, wouldn't it make sense to:
> 
> - Get rid of the entropy heuristic entirely and just assume a fixed value of 
> entropy for a given event?

What does that gain you?  You can always impose an upper bound, but *some*
evidence that it's not a metronome is nice to have.

> - remove the high-res time stamp and the jiffies collection in 
> add_disk_randomness and add_input_randomness to not run into the correlation 
> issue?

Again, you can argue for setting the estimate to zero, but why *remove*
the timestamp?  Maybe you lose nothing,maybe you lose something, but it's definitely
a monotonic decrease.

> - In addition, let us credit the remaining information zero bits of entropy 
> and just use it to stir the input_pool.

Unfortunately, that is of limited use.  We mustn't remove more bits (of data,
as well as entropy) from the input pool that there are bits of entropy coming in.

So the extra uncounted entropy never goes anywhere and does very little good.
So any time the input pool is "full" (by counted entropy), then the uncounted
entropy has been squeezed out and thrown away.

> - Conversely, as we now would not have the correlation issue any more, let us 
> change the add_interrupt_randomness to credit each received interrupt one bit 
> of entropy or something in this vicinity?  Only if random_get_entropy returns 
> 0, let us drop the credited entropy rate to something like 1/10th or 1/20th 
> bit per event.

Baically, do you have a convincing argument that *eery* interrupt has
this?  Even those coming from strongly periodic signals like audio DMA
buffer fills?

> Hence, we cannot estimate the entropy level at runtime. All we can do is 
> having a good conservative estimate. And for such estimate, I feel that 
> throwing lots of code against that problem is not helpful.

I agree that the efficiency constraints preclude having a really
good solution.  But is it worth giving up?

For example, suppose wecome up with a decent estimator, but only use it
when we're low on entropy.  When things are comfortable, underestimate.

For example, a low-overhead entropy estimator can be derived from
Maurer's universal test.  There are all sort of conditions required to
get an accurate measurement of entropy, but violating them produces
a conservative *underestimate*, which is just fine for an on-line
entropy estimator.  You can hash non-binary inputs to save table space;
collisions cause an entropy underestimate.  You can use a limited-range
age counter (e.g. 1 byte); wraps cause entropy underestimate.  You need
to initialize the history table before measurements are accurate, but
initializing everything to zero causes an initial entropy underestimate.

  reply	other threads:[~2016-06-20 19:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-19 15:58 Stephan Mueller
2016-06-19 15:59 ` [PATCH v5 1/7] crypto: DRBG - externalize DRBG functions for LRNG Stephan Mueller
2016-06-19 15:59 ` [PATCH v5 2/7] random: conditionally compile code depending on LRNG Stephan Mueller
2016-06-19 16:00 ` [PATCH v5 3/7] crypto: Linux Random Number Generator Stephan Mueller
2016-06-19 16:58   ` Andi Kleen
2016-06-19 18:31     ` Stephan Mueller
2016-06-19 16:00 ` [PATCH v5 4/7] crypto: LRNG - enable compile Stephan Mueller
2016-06-19 16:01 ` Stephan Mueller
2016-06-19 16:01 ` [PATCH v5 6/7] crypto: isolate the chacha20_block function Stephan Mueller
2016-06-19 16:04 ` [PATCH v5 7/7] crypto: LRNG - add ChaCha20 support Stephan Mueller
2016-06-19 19:36 ` [PATCH v5 0/7] /dev/random - a new approach Pavel Machek
2016-06-19 20:47   ` Sandy Harris
2016-06-20  5:51   ` Stephan Mueller
2016-06-20  8:27     ` Pavel Machek
2016-06-20 15:28     ` Theodore Ts'o
2016-06-20 15:43       ` Stephan Mueller
2016-06-20 18:44         ` George Spelvin [this message]
2016-06-20 19:00           ` Stephan Mueller
2016-06-21  5:12             ` Theodore Ts'o
2016-06-21  5:17               ` Stephan Mueller
2016-06-21  7:12         ` Nikos Mavrogiannopoulos
2016-06-21  7:32           ` Stephan Mueller
2016-06-21 16:03             ` Austin S. Hemmelgarn
2016-06-21 16:28               ` Stephan Mueller
2016-06-21 18:22                 ` Austin S. Hemmelgarn
2016-06-21 18:46                   ` Stephan Mueller

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=20160620184403.21972.qmail@ns.sciencehorizons.net \
    --to=linux@sciencehorizons.net \
    --cc=andi@firstfloor.org \
    --cc=cryptography@lakedaemon.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@linux.intel.com \
    --cc=joe@perches.com \
    --cc=jsd@av8n.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=pavel@ucw.cz \
    --cc=sandyinchina@gmail.com \
    --cc=smueller@chronox.de \
    --cc=tytso@mit.edu \
    /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

all inboxes | Powered by JetHome®