Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2016 10:12:07 -0400
From:      Steve Kiernan <stevek@juniper.net>
To:        Jia-Shiun Li <jiashiun@gmail.com>
Cc:        "Jukka A. Ukkonen" <jau789@gmail.com>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: Random number generator on rpi
Message-ID:  <20160720101207.12d52ae7@juniper.net>
In-Reply-To: <CAHNYxxNwK55Sh2dv1XL5_r1p6rurTksZXmBpLhSKVYhtx_oBtA@mail.gmail.com>
References:  <CAHNYxxP8fqEdXsL2Jwu-=P4g9_w5P2pnJ-yOvtU1ssEP4ZpqCQ@mail.gmail.com> <5d8ec4d4-4c36-139d-6102-4fdb200fdf65@gmail.com> <CAHNYxxPQtyXZU4%2ByNAVEDPu60mpK87O-4xcCuniCW576-meY0g@mail.gmail.com> <790435eb-f3fc-8d4c-4231-e3cfbf93157b@gmail.com> <20160718115455.10fa95bb@juniper.net> <CAHNYxxNwK55Sh2dv1XL5_r1p6rurTksZXmBpLhSKVYhtx_oBtA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/hxGt/zePnr_NfQOfMP3yOp7
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Wed, 20 Jul 2016 16:11:44 +0800
Jia-Shiun Li <jiashiun@gmail.com> wrote:

> On Mon, Jul 18, 2016 at 11:54 PM, Steve Kiernan <stevek@juniper.net> wrot=
e:
>=20
> >
> > You might want to see my RPi rng driver review up on Phabricator.
> > It is interrupt driven, which keeps the CPU utilization down to a fract=
ion
> > of a percent, whereas using a callout or other method easily consumes m=
uch
> > more of the CPU.
> >
> > The review is here:
> > https://reviews.freebsd.org/D6888
> >
> > Note that for RBG (random bit generator) like the one in the RPi, they =
are
> > not really RNGs themselves but random bit sources that must be processed
> > by other algorithms to generate random numbers. So even if one were to =
grab
> > the data to test for "randomness", one would need to not assume the rnd=
test
> > would necessarily be appropriate, since the values returned by the RBG =
are
> > not to be used directly as random numbers without post-processing.
> >
> > -Steve
> > =20
>=20
>=20
> I saw it committed yesterday. Great & thanks!
>=20
> BTW does it have any other document other than
>   http://pastehtml.com/view/crkxyohmp.rtxt
> as mentioned in
>   https://www.raspberrypi.org/forums/viewtopic.php?f=3D29&t=3D19334&start=
=3D275 ?
>=20
> I cannot find any other source of info other than linux source and the
> above link...

There's not a lot of information available, but I know from working on
other Broadcom SoCs that have the same register setup for the RBG, it
appears to be based on the RBG100 design. I validated the settings from
empirical testing and what I know about the RBG100.

For example, the BCM56340 enterprise switching SoC has the same RBG in
it, except the one on the RPi appears to have a smaller FIFO. On the
BCM56340, the FIFO threshold default value is number of 32-bit words,
while on the RPi it appears to be number of bytes, but everything else
is the same. On the RPi it fires the interrupt when the number of words
available in the status register only has 4 32-bit words, instead of 16
that is seen on the switching SoC version.

-Steve

--Sig_/hxGt/zePnr_NfQOfMP3yOp7
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXj4a3AAoJEC6j1WNlVsksrYkQAK9TwO9SIcfMifKlJHG5b/bi
h5WLzTupvmLw0dldwCpDzQ+/+7+nxPBTUGov7Ql8h0w5VJS0yoZWM74iCkoMXGab
y/7gLsI/Lmh57bUNzTz8T4uzGzlhLGLeKWSbMpYOLYku5NHw1P9uXP/IrgEM5s04
wOwCMVe95gZZ6pwbwfCBAlRGig2NTfyI5QogklXOwbsOclSIaDe/qNOB8w+ICfiR
p4oNhXUKHIJCIiolVcSP8KnqMb+s+wb+99UJ+q38MsegA1z/bkS10Ta4Qo+fBD7z
i+zlV1vint+Gvbbz4ST+K58HjD/QJAU80uC2MmtlSlvGiCPSI9uSLRK8ph+xMc6j
tu/cAUAduIUTU4BN1ILTwV8YHtn/gA1F5M8BnRLGKJTM1Pm48xv71sh3L64UzsGO
0UA7eiL0FVUv/APb6sAawd7pe0EA8JRdjD0O9LfMy3SyH7hOUCINkzPI9p6hgsYR
FPgzBBPKXLw1eIh5Ke8o5wubCeWOcoQ1ikwYFQ0bllk6RDbXVQNoS3WHtllhWJOY
050Yuqwqww8HiRoxxCr1zMy5HoDszJxsRZGuL7i6gRF9a7yOG/pcqWBB5848O7R2
WdsOzwI8M7t2ZUfNt1yERixFufaxtuINRPo45NWvytpBX2xWSSgxlgP42g3Iu0CD
5l/4RUODPruTtkbDckFh
=8xdT
-----END PGP SIGNATURE-----

--Sig_/hxGt/zePnr_NfQOfMP3yOp7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160720101207.12d52ae7>