hardware RNG harvest rate

Ian Lepore ian at freebsd.org
Wed Sep 13 16:34:41 UTC 2017


While looking into updating the hardware rng driver for RPi 3 I
discovered that on the original wimpy RPi we're feeding
random_harvest_queue() with 16 bytes of generated data, 82 times a
second.  That seems like a lot of work for a wimpy processor, and
probably more than needed for good random numbers.

I looked at some other rng drivers, and I see them feeding in a few
bytes at a time at rates ranging from 100 Hz to once every 5 seconds.
 So no clear concensus there.  Some have this comment:

  /* MarkM: FIX!! Check that this does not swamp the harvester! */

A comment block above random_harvest_queue() warns, in part:

 * It is also illegal (and morally reprehensible) to insert any
 * high-rate data here.

So is there any simple "X bytes per second is good and more than Y is
wasted/harmful" advice available?

-- Ian



More information about the freebsd-arch mailing list