From: Clemens Ladisch Subject: Re: [PATCH] CPU Jitter RNG: inclusion into kernel crypto API and /dev/random Date: Sat, 09 Nov 2013 23:04:49 +0100 Message-ID: <527EB181.2000602@ladisch.de> References: <2579337.FPgJGgHYdz@tauon> <9172761.DO0L6FkY0c@tauon> <20131106130432.GK14235@thunk.org> <3842150.yBzxVUWavK@tauon> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Theodore Ts'o , Pavel Machek , sandy harris , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Nicholas Mc Guire To: Stephan Mueller Return-path: In-Reply-To: <3842150.yBzxVUWavK@tauon> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org Stephan Mueller wrote: > Am Mittwoch, 6. November 2013, 08:04:32 schrieb Theodore Ts'o: >> On Wed, Nov 06, 2013 at 01:51:17PM +0100, Stephan Mueller wrote: >>>> That's unfortunate, since it leaves open the question of whether this >>>> jitter is something that could be at least somewhat predictable if you >>>> had a lot more information about the internal works of the CPU or not.... >>> >>> I do not understand that answer: I thought we are talking about the >>> search of non-predictable noise sources. If you cannot predict the >>> sequence even if you have the state of the CPU, that is what we are >>> looking for, is it not? >> >> I was asking the question about whether someone who knew more about >> the internal _workings_ of the CPU, note of the state of the CPU. >> This is not necessarily "the NSA guy", but someone who knows more >> about the internal workings of the Intel CPU (such as an Intel >> engineer --- and I've had Intel express misgivings about approaches >> which depend on "CPU jitter" approaches), or just someone who has >> spent a lot more time trying to examine the black box of the Intel CPU >> from the outside. > > I try to get more information from my contacts to other vendors. But I > am wondering what shall we do if the answer is (maybe even proven with > some test results) that they see the same issue themselves and have no > handle on it? > > I mean, what is it that I would need to test and demonstrate to prove or > disprove my RNG? You need to prove that the CPU will never get into an internal state where the loop execution times happen to form a predictable pattern. Alternatively, detect this so that the measurements can be thrown away. > We can certainly test very much, but one thing we cannot prove, and > that is the fundamental jitter, provided it is a result of quantum > fluctuations. Just as with any other noise source, basic fundamental > principles are hard if not impossible to test. You cannot test if the noise source was replaced with fake hardware. But if you know the characteristics of the noise source, you can test for likely failure modes, such as the output value being stuck or oscillating. In the case of CPU jitter measurements, you do not have direct access to the noise source; you measure it indirectly through the CPU's internal state. So you need to know how the delta times of a noisy CPU are different from the delta times of a CPU without or with unsuitable noise source. Regards, Clemens