From: "H. Peter Anvin" <hpa@linux.intel.com>
To: Matt Mackall <mpm@selenic.com>
Cc: "Ted Ts'o" <tytso@mit.edu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
greg@kroah.com, w@1wt.eu, ewust@umich.edu, zakir@umich.edu,
nadiah@cs.ucsd.edu, jhalderm@umich.edu, tglx@linutronix.de,
davem@davemloft.net, mingo@kernel.org, hpa@zytor.com,
DJ Johnston <dj.johnston@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH RFC] random: Account for entropy loss due to overwrites
Date: Wed, 15 Aug 2012 13:37:23 -0700 [thread overview]
Message-ID: <502C0883.2030904@linux.intel.com> (raw)
In-Reply-To: <1345059051.32116.32.camel@calx>
On 08/15/2012 12:30 PM, Matt Mackall wrote:
> On Mon, 2012-08-13 at 10:26 -0700, H. Peter Anvin wrote:
>> From: "H. Peter Anvin" <hpa@linux.intel.com>
>>
>> When we write entropy into a non-empty pool, we currently don't
>> account at all for the fact that we will probabilistically overwrite
>> some of the entropy in that pool.
>
> Technically, no, nothing is overwritten. The key fact is that the mixing
> function is -reversible-. Thus, even if you mix in known data, you can't
> learn anything about the state and thus can't destroy any of the
> existing entropy.
>
> But you are correct, mixing new actual entropy is not purely additive
> (with saturation). For that to happen, we'd need an input mixing
> function with perfect maximal cascading. Instead we effectively cascade
> across somewhere between 6 and 64 bits. So the truth lies somewhere
> between linear and your exponential estimate (which would be the case
> for mixing a single bit into the pool with XOR), but much closer to
> linear due to combinatoric expansion.
>
I think you have it backwards; if the input was a FIFO, with no mixing
at all, and no reuse, the linear estimate would be correct. The mixing
into an already-existent and potentially-observed pool is what causes
the exponential estimate to apply... although it is assuming perfect
mixing. However, I believe it is still correct in the aggregate.
> On the other hand, I don't think this sort of thing matters at all.
> There is so much more fundamentally wrong with even trying to do entropy
> accounting in the first place that these sorts of details don't even
> matter. Instead we should stop fooling ourselves and just drop the
> pretense of accounting entirely. Now that we've got a much richer set of
> inputs, I think the time is ripe... but of course, I'm no longer the
> maintainer.
If we're going to fundamentally change the structure perhaps we should
actually take the suggestions long offered from the cryptographic
community, and look at structures like Fortuna.
-hpa
next prev parent reply other threads:[~2012-08-15 20:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-13 17:26 [PATCH RFC] random: Account for entropy loss due to overwrites H. Peter Anvin
2012-08-15 19:30 ` Matt Mackall
2012-08-15 20:37 ` H. Peter Anvin [this message]
2012-09-29 19:47 ` H. Peter Anvin
2012-10-16 4:08 ` Theodore Ts'o
2012-10-16 4:45 ` H. Peter Anvin
2012-10-16 15:53 ` Theodore Ts'o
2012-10-16 16:10 ` H. Peter Anvin
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=502C0883.2030904@linux.intel.com \
--to=hpa@linux.intel.com \
--cc=davem@davemloft.net \
--cc=dj.johnston@intel.com \
--cc=ewust@umich.edu \
--cc=greg@kroah.com \
--cc=hpa@zytor.com \
--cc=jhalderm@umich.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mpm@selenic.com \
--cc=nadiah@cs.ucsd.edu \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tytso@mit.edu \
--cc=w@1wt.eu \
--cc=zakir@umich.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.