Random number generator on rpi

Jia-Shiun Li jiashiun at gmail.com
Fri Jul 15 04:33:01 UTC 2016


sorry for replying so late. Turns out I need to attach rndtest device to
hook it on. Updated patch attached. Also commented some code lines in
rndtest to print report messages. You should be able to see repeated kernel
messages like below:

bcmrng0: rndtest: runs pass zeros interval 1 (2343 < 2543 < 2657)
bcmrng0: rndtest: runs pass zeros interval 2 (1135 < 1255 < 1365)
bcmrng0: rndtest: runs pass zeros interval 3 (542 < 624 < 708)
bcmrng0: rndtest: runs pass zeros interval 4 (251 < 301 < 373)
bcmrng0: rndtest: runs pass zeros interval 5 (111 < 158 < 201)
bcmrng0: rndtest: runs pass zeros interval 6 (111 < 149 < 201)
bcmrng0: rndtest: runs pass ones interval 1 (2343 < 2535 < 2657)
bcmrng0: rndtest: runs pass ones interval 2 (1135 < 1265 < 1365)
bcmrng0: rndtest: runs pass ones interval 3 (542 < 576 < 708)
bcmrng0: rndtest: runs pass ones interval 4 (251 < 315 < 373)
bcmrng0: rndtest: runs pass ones interval 5 (111 < 185 < 201)
bcmrng0: rndtest: runs pass ones interval 6 (111 < 153 < 201)
bcmrng0: rndtest: chi^2(4): pass (sum 1570182)
bcmrng0: rndtest: longruns pass (15 ones, 12 zeros)


by the rndtest result, guess I can safely conclude the hardware rng working
correctly?


On Thu, Jun 9, 2016 at 3:53 PM, Jukka A. Ukkonen <jau789 at gmail.com> wrote:

>
> So, does this somehow indicate that fortuna has attached the
> new random device as a source of true randomness?
>
> root at rpi2:~ # sysctl kern.random
> kern.random.fortuna.minpoolsize: 64
> kern.random.harvest.mask_symbolic:
>
> [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
> kern.random.harvest.mask_bin: 00111111111
> kern.random.harvest.mask: 511
> kern.random.random_sources:
>

The mask only reports environmental sources, not hardware rng sources.


-Jia-Shiun.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rpirng.patch
Type: application/octet-stream
Size: 8840 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20160715/08eba664/attachment.obj>


More information about the freebsd-arm mailing list