opnsense-src/sys/dev/random
Colin Percival 0811ce5723 random: Ingest extra fast entropy when !seeded
We periodically ingest entropy from pollable entropy sources, but only
8 bytes at a time and only occasionally enough to feed all of Fortuna's
pools once per second.  This can result in Fortuna remaining unseeded
for a nontrivial amount of time when there is no entropy passed in from
the boot loader, even if RDRAND is available to quickly provide a large
amount of entropy.

Detect in random_sources_feed if we are not yet seeded, and increase the
amount of immediate entropy harvesting we perform, in order to "fill"
Fortuna's entropy pools and avoid having
  random: randomdev_wait_until_seeded unblock wait
stall the boot process when entropy is available.

This speeds up the FreeBSD boot in the Firecracker VM by 2.3 seconds.

Approved by:	csprng (delphij)
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D35802
2022-07-19 23:59:40 -07:00
..
fenestrasX kern: harvest entropy from callouts 2022-02-03 10:05:06 -06:00
build.sh Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
darn.c random(4): Reorder configuration of random source modules 2019-08-18 16:04:01 +00:00
fortuna.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (18 of many) 2020-02-27 13:12:14 +00:00
fortuna.h random(4): Fortuna: allow increased concurrency 2019-06-17 20:29:13 +00:00
hash.c random(3): Fix a typo in a source code comment 2022-04-09 09:14:22 +02:00
hash.h random(4): Fortuna: allow increased concurrency 2019-06-17 20:29:13 +00:00
ivy.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (18 of many) 2020-02-27 13:12:14 +00:00
nehemiah.c Remove checks for __GNUCLIKE_ASM assuming it is always true. 2022-04-12 10:05:45 -07:00
other_algorithm.c random(4): Simplify RANDOM_LOADABLE 2019-12-26 19:32:11 +00:00
other_algorithm.h Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
random_harvestq.c random: Ingest extra fast entropy when !seeded 2022-07-19 23:59:40 -07:00
random_harvestq.h kern: random: drop read_rate and associated functionality 2021-09-23 01:03:01 -05:00
random_infra.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (18 of many) 2020-02-27 13:12:14 +00:00
randomdev.c randomdev: Remove 100 ms sleep from write routine 2021-11-16 10:27:27 -08:00
randomdev.h random(4): Simplify RANDOM_LOADABLE 2019-12-26 19:32:11 +00:00
uint128.h random(4): Fortuna: allow increased concurrency 2019-06-17 20:29:13 +00:00
unit_test.c Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
unit_test.h Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00