Random number generator on rpi
Jia-Shiun Li
jiashiun at gmail.com
Mon Jun 6 04:49:58 UTC 2016
Hi all,
I occasionally found that RPi has a mysterious undocumented random number
generator and Linux has a driver for it. [1]
Out of curiosity I wrote a simple driver according to the Linux one. It is
simple enough for me without prior rng knowledge to make it work. Or so it
appears. Patch is attached.
(Note you need to have the updated dtb file by copying
{OBJDIR}/{SRCDIR}/sys/{KERNCONF}/modules/{SRCDIR}/sys/modules/dtb/rpi/rpi{,2}.dtb
to your /boot/msdos)
Once booted the kernel will output the following line indicating it is
working:
bcmrng0: <BCM2708/2835 random number generator> mem 0x104000-0x10400f on
simplebus0
I only tested it on RPi2. Guess it will work fine on RPi too.
I tried to compile rndtest(4) together into the kernel, and it did not
output or complain about anything. According to the man page this should
mean the rng works fine, right? Or is there any other tools to verify the
quality of a rng?
[1]:
http://scruss.com/blog/2013/06/07/well-that-was-unexpected-the-raspberry-pis-hardware-random-number-generator/
-Jia-Shiun.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rpirng.patch
Type: application/octet-stream
Size: 6963 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20160606/64030820/attachment.obj>
More information about the freebsd-arm
mailing list