Re: Q for a new API for the random device driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 06, 2018 at 04:58:29PM +0200, Harald Freudenberger wrote:
> Had a short glimpse to the mentioned add_hwgenerator_randomness()
> and this looks in fact like the API I am looking for :-)
> Thanks Stephan, I'll write some code and check this out.

The more convenient interface would be structure things as a driver
under drivers/char/hw_random.  The virtio_rng.c driver is a relatively
simple one that you can use as a model.  That way you don't have
"push" randomness at the random pool.  Instead, a kernel thread,
implemnted in drivers/char/hw_random/core.c, will automatically "pull"
randomness from your hardware random number generator when the entropy
estimate in the entropy pool falls below the low watermark, and stop
when it goes above the high watermark.

The arch_get_random/arch_get_random_seed interfaces are intended for
this CPU's that have a high-efficiency RNG where getting entropy is
"free".  But if it is not free, then you only want to draw on the
hardware RNG when it is needed and that's what the hw_random
infrastructure will do automatically for you.

						- Ted



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux