The device is Octeon by Cavium which contains a RNG hardware unit. OS shows that the current entropy pool size is 4096 bytes but entropy_avail is very low. The device crypto modules has ansi_cprng.ko present only, no other RNG related .ko is present. Additionally, as per lsmod, no RNG related modules are loaded, even though the kernel configuration settings related to RNG are as following;


How to feed /dev/random from Octeon RNG and increase entropy_avail?



This will build the octeon-rng driver that automatically feeds the kernel entropy pool (by calling devm_hwrng_register).

| improve this answer | |
  • In addition CONFIG_HW_RANDOM is also required which will generate rng-core.ko as octeon-rng.ko depends on rng-core.ko. Having said that after loading both modules still the entropy remains less then 200, previously it was 143. – neutrino May 2 '19 at 8:22

When both rng modules octeon-rng & rng-core are loaded the /dev/hwrng device is created, /sys/class/misc/hw_random/rng_current & /sys/class/misc/hw_random/available will show name octeon. However another application rng-tools is required.

The command;

rngd -o /dev/random -r /dev/hwrng

will feed the kernel entropy from RNG and raise entropy_avail to approx 3000 bytes.

Further rngtest can be conducted for FIPS140-2 randomness test by command;

rngtest -c 1000 < /dev/random

Having said that still If some one can tell;

  • Why rngd command with verbose option on octeon shows that RNG is Intel hardware RNG.

  • Secondly in rngd command if only /dev/random is mentioned is it also effective for /dev/urandom.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.