enable use of the hwrng for kernel entropy pool

19 views
Skip to first unread message

Matthijs van Duin

unread,
Mar 12, 2018, 11:28:18 PM3/12/18
to BeagleBoard
Today I learned that the hardware rng, even though its driver was loaded, wasn't being used at all other than to create /dev/hwrng which isn't used by anything. The problem is that the driver neglects to declare a "quality" parameter that indicates the quality of the entropy it generates, which causes it to be ignored for the purposes of filling the kernel's entropy pool.

The fix was easy: add  rng_core.default_quality=1024  to the kernel parameters ("cmdline" variable in /boot/uEnv.txt) and reboot. Voila, you can now read more than 100 KB/s from /dev/random. (But note that you shouldn't be reading from /dev/random in the first place, use /dev/urandom or the getrandom() system call instead.)

If you don't fully trust the hwrng and want to be paranoid, you can set the quality parameter to a lower value. For example setting it to 100 will cause ten times as much data to be drawn from the hwrng and hashed together.

Matthijs
Reply all
Reply to author
Forward
0 new messages