freebsd-dev/sys/contrib
Conrad Meyer 8a0edc914f Add prng(9) API
Add prng(9) as a replacement for random(9) in the kernel.

There are two major differences from random(9) and random(3):

- General prng(9) APIs (prng32(9), etc) do not guarantee an
  implementation or particular sequence; they should not be used for
  repeatable simulations.

- However, specific named API families are also exposed (for now: PCG),
  and those are expected to be repeatable (when so-guaranteed by the named
  algorithm).

Some minor differences from random(3) and earlier random(9):

- PRNG state for the general prng(9) APIs is per-CPU; this eliminates
  contention on PRNG state in SMP workloads.  Each PCPU generator in an
  SMP system produces a unique sequence.

- Better statistical properties than the Park-Miller ("minstd") PRNG
  (longer period, uniform distribution in all bits, passes
  BigCrush/PractRand analysis).

- Faster than Park-Miller ("minstd") PRNG -- no division is required to
  step PCG-family PRNGs.

For now, random(9) becomes a thin shim around prng32().  Eventually I
would like to mechanically switch consumers over to the explicit API.

Reviewed by:	kib, markj (previous version both)
Discussed with:	markm
Differential Revision:	https://reviews.freebsd.org/D25916
2020-08-13 20:48:14 +00:00
..
alpine-hal
ck Remove FreeBSD/armv4 specific bits from CK. 2020-04-13 23:16:32 +00:00
cloudabi Import the latest CloudABI definitions, v0.18. 2017-11-21 20:46:21 +00:00
dev MFV: r363292 2020-07-18 07:35:34 +00:00
edk2 Document upgrade procedure in FREEBSD-upgrade 2020-06-04 20:48:57 +00:00
ena-com Adjust ENA driver to the new HAL 2020-05-26 15:29:19 +00:00
ipfilter/netinet Fix incorrect byte order in ipfstat -f output. 2020-07-17 19:07:59 +00:00
libb2 MFV: libb2: use native calls for secure memory clearance 2018-03-27 14:55:01 +00:00
libfdt MFV r328490: Update libfdt to github:f1879e1 2018-01-27 21:25:45 +00:00
libnv Rename nvpair.c to bsd_nvpair.c to not conflict with openzfs' version. 2020-06-27 00:55:03 +00:00
libsodium Add chacha20poly1305 support to crypto build 2020-02-16 00:03:09 +00:00
ncsw [PowerPC] [Book-E] Remove obsolete interrupt binding workaround 2020-02-25 22:03:30 +00:00
ngatm
octeon-sdk Fix misleading indentation warning in OCTEON1 kernel 2020-03-17 11:59:45 +00:00
pcg-c/include Add prng(9) API 2020-08-13 20:48:14 +00:00
rdma/krping Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
v4l
vchiq/interface Change synchonization rules for vm_page reference counting. 2019-09-09 21:32:42 +00:00
x86emu
xz-embedded Modularize xz. 2019-02-26 19:55:03 +00:00
zlib MFV r351500: Fix CLEAR_HASH macro to be usable as a single statement. 2019-08-26 00:46:39 +00:00
zstd Unbreak ARM64 kernel build after r361426 2020-05-23 23:10:03 +00:00