From: Corentin LABBE <clabbe.montjoie@gmail.com>
To: Sandy Harris <sandyinchina@gmail.com>
Cc: linux-crypto@vger.kernel.org
Subject: Re: Testing the PRNG driver of the Allwinner Security System A20
Date: Thu, 03 Jul 2014 08:57:22 +0200 [thread overview]
Message-ID: <53B4FED2.7000109@gmail.com> (raw)
In-Reply-To: <CACXcFmmSWP1MAAzX0A1jVoCNdex9EoJ50S9zdDgf-WuiwjSA5w@mail.gmail.com>
On 07/03/14 01:06, Sandy Harris wrote:
> On Tue, Jul 1, 2014 at 7:14 AM, Corentin LABBE
> <clabbe.montjoie@gmail.com> wrote:
>
>> I am writing the PRNG driver for the Allwinner Security System SoC A20.
>
> The datasheet my search turned up (v1, Feb. 2013) just says: "160-bit
> hardware PRNG with 192-bit seed" and gives no other details. Do you
> have more info, perhaps from a more recent version or talking to the
> company?
The datasheet I used give some register info, just enough for having some "random" number out of the device.
>
>> I didn't know how to test it, so ...
>
> Unless you have much more info, I see no point in enabling it or
> writing a driver. You need a true hardware RNG to seed it, so you need
> random(4) /dev/random anyway and can just use /dev/urandom for PRNG
> requirements.
>
> Using this device might have an advantage if it is much faster or less
> resource-hungry than urandom, but I see nothing in its documentation
> that indicates it is. Anyway, do your applications need that? And, if
> so, would an application-specific PRNG be better yet?
>
> Then there is the crucial question of trusting the device. Kerckhoff's Principle
> (http://en.citizendium.org/wiki/Kerckhoffs%27_Principle)
> has been a maxim for cryptographers since the 19th century; no-one
> should even consider trusting it until full design details are made
> public and reviewed.
>
> Even then, there might be serious doubts, since hardware can be very
> subtly sabotaged and an RNG is a tempting target for an intelligence
> agency.
> (http://arstechnica.com/security/2013/09/researchers-can-slip-an-undetectable-trojan-into-intels-ivy-bridge-cpus/)
> That article discusses Intel and the NSA, but similar worries apply
> elsewhere. Allwinner is a fabless company, so you also need to worry
> about whatever fab they use.
>
The question of trusting is the reason that my preliminary driver made the PRNG optionnal and I think the next version will be without it.
But for people who do not care (or do not have a real RNG requirement), the output speed is better than /dev/urandom
Here is a comparison of the output speed of rng-test:
with /dev/urandom
rngtest: input channel speed: (min=623.523; avg=17402.670; max=3906250.000)Kibits/s
with /dev/hwrng and ss-rng/sunxi-ss loaded
rngtest: input channel speed: (min=1.193; avg=113.604; max=4768.372)Mibits/s
So an average speed gain of x5
Apart from trusting, does the results of rng-test are good enough ?
Thanks for your answer
Regards
prev parent reply other threads:[~2014-07-03 6:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-01 11:14 Testing the PRNG driver of the Allwinner Security System A20 Corentin LABBE
2014-07-02 23:06 ` Sandy Harris
2014-07-03 6:57 ` Corentin LABBE [this message]
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=53B4FED2.7000109@gmail.com \
--to=clabbe.montjoie@gmail.com \
--cc=linux-crypto@vger.kernel.org \
--cc=sandyinchina@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).