public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Stephan Mueller <smueller@chronox.de>
Cc: "Theodore Ts'o" <tytso@mit.edu>, Pavel Machek <pavel@ucw.cz>,
	sandy harris <sandyinchina@gmail.com>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	Nicholas Mc Guire <der.herr@hofr.at>
Subject: Re: [PATCH] CPU Jitter RNG: inclusion into kernel crypto API and /dev/random
Date: Sun, 10 Nov 2013 21:28:06 +0100	[thread overview]
Message-ID: <527FEC56.5070306@ladisch.de> (raw)
In-Reply-To: <8100659.WdgUuKxd0z@myon.chronox.de>

Stephan Mueller wrote:
> Am Sonntag, 10. November 2013, 17:31:07 schrieb Clemens Ladisch:
>> In the case of CPUs, the jitter you observe in delta
>> times results in part from the complexities of the inner state, and in
>> part from real random noise.  The first part is deterministic and might
>> be predicted by anyone who has enough knowledge about the CPU's
>> internals.
>
> Right, and that is why I tried to eliminate the CPU mechanisms that may be
> having a deterministic impact. If I miss a mechanism or your have other
> suggestions, please help me.

Many CPUs allow to disable branch prediction, but this is very vendor
specific (try to find MSR documentation).  The biggest offender probably
is the out-of-order execution engine, which cannot be disabled.

>>> When you ask for testing of stuck values, what shall I really test for?
>>> Shall I test adjacent measurements for the same or alternating values?
>>
>> Same or alternating delta time values happen even on random CPUs.  You
>> need a theory of how random and non-random CPUs work, and how this
>> difference affects the delta times, before you can test for that.
>
> Are you telling me that I should invent a formula and apply it?

I was not implying that the theory has nothing to do with the physical
device.  It must correctly _describe_ the relevant physical processes.

>>> The test for the same values is caught with the Von-Neumann unbiaser.
>>
>> No, the von Neumann unbiaser is run on the whitened bitstream, i.e.,
>> _after_ the folding operation.
>
> The folding is whitened? How do you reach that conclusion? Yes, the folding is
> my (very simple) post-processing. But I am not calling it whitened as all
> statistical problems the underlying variations have *will* be still visible in
> the folded value.

If you don't want to call it "whitening", call it "randomness extraction"
instead.  But its input is a series of delta times like this:
  00000000000000000000000001010011
  00000000000000000000000010011010
  00000000000000000000000001011011
  00000000000000000000000001100100
  00000000000000000000000010111000
and the purpose of the folding is to remove these zero patterns.

> What would you expect me to do when I should do to come up with an entropy
> estimate that I not already have done?

I do not expect you (or anybody) to be able to come up with a correct
entropy estimate for CPU jitter.

> There are so many assessments on entropy I make, I am surprised that I
> am said to have no entropy assessment.

Again: Shannon entropy assumes that you have a sequence of independent
and identically distributed random variables.  And you cannot prove
these properties from the output; you need to know the process that
generates the values.


Regards,
Clemens

  reply	other threads:[~2013-11-10 20:28 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 18:38 [PATCH] CPU Jitter RNG: inclusion into kernel crypto API and /dev/random Stephan Mueller
2013-10-12  1:45 ` Sandy Harris
2013-10-12  3:28   ` Theodore Ts'o
2013-10-12 19:04     ` Stephan Mueller
2013-10-12 20:12   ` Stephan Mueller
     [not found]     ` <CACXcFm=_jmeKe2YYbHDi-jTGX-23hDsDeu_weWQkr2F_FpE_6g@mail.gmail.com>
2013-10-14 13:38       ` Fwd: " Sandy Harris
2013-10-14 14:12         ` Stephan Mueller
2013-10-14 14:26           ` Stephan Mueller
2013-10-14 14:14         ` Sandy Harris
2013-10-14 14:40           ` Stephan Mueller
2013-10-14 15:18             ` Sandy Harris
2013-10-14 15:26               ` Stephan Mueller
2013-10-14 15:46                 ` Sandy Harris
2013-10-14 21:33                 ` Sandy Harris
2013-10-15  6:23               ` Stephan Mueller
2013-10-28 15:40 ` Stephan Mueller
2013-10-28 16:06   ` Henrique de Moraes Holschuh
2013-10-28 16:15     ` Stephan Mueller
2013-10-28 21:45   ` Theodore Ts'o
2013-10-29  8:42     ` Stephan Mueller
2013-10-29 13:24       ` Theodore Ts'o
2013-10-29 14:00         ` Stephan Mueller
2013-10-29 22:25           ` Stephan Mueller
2013-11-02 11:01           ` Pavel Machek
2013-11-02 11:12             ` Pavel Machek
2013-11-03  7:20             ` Stephan Mueller
2013-11-03 12:41               ` Theodore Ts'o
2013-11-05 12:20                 ` Stephan Mueller
2013-11-06 11:49                   ` Stephan Mueller
2013-11-06 12:43                     ` Theodore Ts'o
2013-11-06 12:51                       ` Stephan Mueller
2013-11-06 13:04                         ` Theodore Ts'o
2013-11-06 13:24                           ` Pavel Machek
2013-11-07  0:36                             ` Nicholas Mc Guire
2013-11-07  5:21                           ` Stephan Mueller
2013-11-09 22:04                             ` Clemens Ladisch
2013-11-10  1:10                               ` Stephan Mueller
2013-11-10 16:31                                 ` Clemens Ladisch
2013-11-10 17:21                                   ` Stephan Mueller
2013-11-10 20:28                                     ` Clemens Ladisch [this message]
2013-11-13  3:12                                       ` Stephan Mueller
2013-11-13 11:51                                         ` Clemens Ladisch
2013-11-13 15:15                                           ` Stephan Mueller
2013-11-13 17:14                                             ` Pavel Machek
2013-11-14 10:51                                             ` Clemens Ladisch
2013-11-14 18:01                                               ` Stephan Mueller
2013-11-14 18:30                                                 ` Clemens Ladisch
2013-11-14 18:34                                                   ` Stephan Mueller
2013-11-11  2:58                                     ` H. Peter Anvin
2013-11-07  1:03                         ` Nicholas Mc Guire
2013-11-07  5:26                           ` Stephan Mueller
2013-11-09 22:04                             ` Clemens Ladisch
2013-11-10  1:16                               ` Stephan Mueller
2013-11-03 23:32               ` Pavel Machek
2013-11-05 12:25                 ` Stephan Mueller
2013-11-05 13:45                   ` Stephan Mueller
2013-11-06 11:42                     ` Stephan Mueller
2013-11-06 13:26                       ` Pavel Machek
2013-11-07  3:12                         ` Stephan Mueller
2013-11-13  3:37         ` [PATCH] CPU Jitter RNG: Executing time variation tests on bare metal Stephan Mueller
2013-10-30 12:59     ` [PATCH] CPU Jitter RNG: inclusion into kernel crypto API and /dev/random Sandy Harris

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=527FEC56.5070306@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=der.herr@hofr.at \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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