dolphs
Posts: 21
Joined: Mon Jan 06, 2014 11:57 am

Hardware RNG on RPi2

Wed Jun 14, 2017 9:52 am

Hi,

Trying to find out if the bcm2835-rng module is needed to enable rng-tools daemon to feed the random data from the hardware RNG to the kernel entropy pool at /dev/random.

Had following in mind after installing rng-tools:

vi /etc/default/rng-tools # remove the # at the start of the line, thus HRNGDEVICE=/dev/hwrng
vi /etc/init.d/rng-tools # update: START="${START} -- -r ${HRNGDEVICE} ${RNGDOPTIONS} -o /dev/random -W90% -t1"
restart rng-tools daemon # systemctl daemon-reload && systemctl enable rng-tools && systemctl restart rng-tools

watch -n1 cat /proc/sys/kernel/random/entropy_avail # Indeed high: >4000

However on checking lsmod I do not see the module actually loaded so I wonder what is going on under the hood ?

:~# lsmod
Module Size Used by
ipt_MASQUERADE 1363 1
nf_nat_masquerade_ipv4 3123 1 ipt_MASQUERADE
iptable_nat 2320 1
nf_conntrack_ipv4 8890 1
nf_defrag_ipv4 1824 1 nf_conntrack_ipv4
nf_nat_ipv4 6071 1 iptable_nat
nf_nat 18854 2 nf_nat_masquerade_ipv4,nf_nat_ipv4
nf_conntrack 104800 4 nf_conntrack_ipv4,nf_nat_masquerade_ipv4,nf_nat_ipv4,nf_nat
tun 24067 2
bcm2835_gpiomem 3940 0
fixed 3285 0
uio_pdrv_genirq 3923 0
uio 10204 1 uio_pdrv_genirq
sch_fq 8034 3
tcp_htcp 3427 3
ip_tables 13161 1 iptable_nat
x_tables 20578 2 ip_tables,ipt_MASQUERADE


:~# find / -name "*rng"
/sys/devices/platform/soc/3f104000.rng
/sys/bus/platform/devices/3f104000.rng
/sys/bus/platform/drivers/bcm2835-rng
/sys/bus/platform/drivers/bcm2835-rng/3f104000.rng
/dev/hwrng


:~# uname -a
Linux <hostname> 4.9.31-v7+ #1005 SMP Thu Jun 8 13:02:15 BST 2017 armv7l GNU/Linux


:~# cat /etc/debian_version
9.0

Return to “Interfacing (DSI, CSI, I2C, etc.)”