git: kernel - Rejigger random number generator to be per-cpu 2/2
Matthew Dillon
dillon at crater.dragonflybsd.org
Sat Feb 1 23:52:12 PST 2020
commit 3af807019f4261ab54dd1102b8fbc883847758d2
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Sat Feb 1 23:45:16 2020 -0800
kernel - Rejigger random number generator to be per-cpu 2/2
* The initializer tries to diverge each cpu's csprng a bit more
now. These initial conditions are not intended to produce secure
random numbers, but they should be reasonably secure by the time the
kernel is finished booting.
* Once the csprng is operational, do not always inject the same
entropy into both csprngs since that would make having two and
XOR'ing the results together kinda worthless.
* If RDRAND is available the csprng will get new injections 25 times
a second on each cpu. Without it, however, entropy injection is
relatively slow.
Summary of changes:
sys/kern/kern_nrandom.c | 55 ++++++++++++++++++++++++++++++++++++++-----------
sys/sys/csprng.h | 1 +
sys/sys/random.h | 5 ++++-
3 files changed, 48 insertions(+), 13 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3af807019f4261ab54dd1102b8fbc883847758d2
--
DragonFly BSD source repository
More information about the Commits
mailing list