freebsd-dev/sys
Conrad Meyer a3c41f8bfb Add "Fenestras X" alternative /dev/random implementation
Fortuna remains the default; no functional change to GENERIC.

Big picture:
- Scalable entropy generation with per-CPU, buffered local generators.
- "Push" system for reseeding child generators when root PRNG is
  reseeded.  (Design can be extended to arc4random(9) and userspace
  generators.)
- Similar entropy pooling system to Fortuna, but starts with a single
  pool to quickly bootstrap as much entropy as possible early on.
- Reseeding from pooled entropy based on time schedule.  The time
  interval starts small and grows exponentially until reaching a cap.
  Again, the goal is to have the RNG state depend on as much entropy as
  possible quickly, but still periodically incorporate new entropy for
  the same reasons as Fortuna.

Notable design choices in this implementation that differ from those
specified in the whitepaper:
- Blake2B instead of SHA-2 512 for entropy pooling
- Chacha20 instead of AES-CTR DRBG
- Initial seeding.  We support more platforms and not all of them use
  loader(8).  So we have to grab the initial entropy sources in kernel
  mode instead, as much as possible.  Fortuna didn't have any mechanism
  for this aside from the special case of loader-provided previous-boot
  entropy, so most of these sources remain TODO after this commit.

Reviewed by:	markm
Approved by:	csprng (markm)
Differential Revision:	https://reviews.freebsd.org/D22837
2020-10-10 21:45:59 +00:00
..
amd64 Create in-tree LINT files 2020-10-09 01:48:14 +00:00
arm arm: Check dtb version against the one we're expecting to find 2020-10-10 07:20:59 +00:00
arm64 Create in-tree LINT files 2020-10-09 01:48:14 +00:00
bsm bsm: add AUE_CLOSERANGE 2020-04-24 01:27:25 +00:00
cam cam: Add quirk for Samsung MZ7* behind a SATA-to-SAS interposer 2020-10-07 05:44:35 +00:00
cddl loader: zfs should support bootonce an nextboot 2020-09-21 09:01:10 +00:00
compat LinuxKPI: add a bitfield.h implementation. 2020-10-07 22:07:26 +00:00
conf Add "Fenestras X" alternative /dev/random implementation 2020-10-10 21:45:59 +00:00
contrib zfs: use cache_rename 2020-10-10 04:18:49 +00:00
crypto libmd: fix assembly optimized skein implementation 2020-10-01 21:05:50 +00:00
ddb ddb: clean up empty lines in .c and .h files 2020-09-01 22:14:30 +00:00
dev Add "Fenestras X" alternative /dev/random implementation 2020-10-10 21:45:59 +00:00
dts Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
fs cache: fix vexec panic when racing against vgone 2020-10-09 19:10:00 +00:00
gdb gdb(4): Don't escape GDB special characters at application layer 2020-09-30 14:55:54 +00:00
geom Move kernel env global variables, etc to sys/kenv.h 2020-10-07 06:16:37 +00:00
gnu Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
i386 Create in-tree LINT files 2020-10-09 01:48:14 +00:00
isa
kern vfs: support lockless dirfd lookups 2020-10-10 03:48:17 +00:00
kgssapi State kgssapi dependency on xdr. 2020-09-17 22:29:38 +00:00
libkern arm64: check for CRC32 support via HWCAP 2020-09-08 15:39:19 +00:00
mips Print symbol index for unsupported relocation types 2020-10-07 18:48:10 +00:00
modules modules/crypto: reenable assembly optimized skein implementation 2020-10-10 01:13:14 +00:00
net Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow. 2020-10-09 12:06:43 +00:00
net80211 net80211: whitespace 2020-10-07 22:52:24 +00:00
netgraph ng_l2tp: Fix callout synchronization in the rexmit timeout handler 2020-09-25 18:55:50 +00:00
netinet Stop sending tiny new data segments during SACK recovery 2020-10-09 12:44:56 +00:00
netinet6 Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow. 2020-10-09 12:06:43 +00:00
netipsec net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netpfil net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netsmb net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
nfs nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsclient nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsserver nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed infiniband: Appease Coverty 2020-08-31 16:17:28 +00:00
opencrypto Simplify swcr_authcompute() after removal of deprecated algorithms. 2020-10-06 18:07:52 +00:00
powerpc Create in-tree LINT files 2020-10-09 01:48:14 +00:00
riscv RISC-V LINT kernel config 2020-10-09 14:45:41 +00:00
rpc Fix a potential memory leak in the NFS over TLS handling code. 2020-09-05 00:50:52 +00:00
security mac_framework.h: fix build with DEBUG_VFS_LOCKS and !MAC 2020-09-03 20:30:52 +00:00
sys vfs: support lockless dirfd lookups 2020-10-10 03:48:17 +00:00
teken Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00
tests Add small tool to invoke kernel test framework tests. 2020-09-02 09:20:40 +00:00
tools Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
ufs Do not leak B_BARRIER. 2020-10-08 22:41:02 +00:00
vm Use unlocked page lookup for inmem() to avoid object lock contention 2020-10-09 23:49:42 +00:00
x86 timer_restore is now unused, remove it 2020-10-08 20:56:11 +00:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen xen: clean up empty lines in .c and .h files 2020-09-01 21:21:55 +00:00
Makefile