kernel - Rejigger random number generator to be per-cpu 2/2
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 2 Feb 2020 07:45:16 +0000 (23:45 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 2 Feb 2020 07:45:16 +0000 (23:45 -0800)
commit3af807019f4261ab54dd1102b8fbc883847758d2
tree2d46df09b705f5dec81c682417f6e533dbd00994
parent1cb34a03363bd4f58f6d6756fdb48f44c09d23a4
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.
sys/kern/kern_nrandom.c
sys/sys/csprng.h
sys/sys/random.h