kernel - Update existing csprng
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 13 Jun 2014 04:47:45 +0000 (21:47 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 13 Jun 2014 04:47:45 +0000 (21:47 -0700)
commit8e0be529177cb8db1548a42d9e4c02c74ef94108
treea0eeede7805ae6757010d48868847a5234f4ae67
parent01bbe85e4d61e2e745b434724c0aa43f8cd63a2a
kernel - Update existing csprng

* Bring the current csprng up-to-date as per the author.  However, note
  that we will likely be making additional commits to add other csprng
  algorithms to the system.

  - Change stateIndex to a static instead of starting at 0 each time
    to improve security.

  - Move the L_SCHEDULE(keyLen) to the end.

  - Warm-up the IBAA in the entropy interrupt.  Author suggested warming
    it up before each read_random() but that creates a non-deterministic
    performance problem.

* Change read_random_unlimited() from L15_Byte() to IBAA_Byte().
  read_random() already uses IBAA_Byte().  That is, go with the
  heavier-weight csprng for everything (sysctl, /dev/urandom, /dev/random).
  Before only /dev/random was using the heavier-weight csprng.
sys/kern/kern_nrandom.c