Commit Graph

9 Commits (6ce663a8bdbc2481afd01bca55f334d42c7cb6be)

Author SHA1 Message Date
Daniel Micay a13db3fc68 initialize size class CSPRNGs from init CSPRNG
This avoids making a huge number of getrandom system calls during
initialization. The init CSPRNG is unmapped before initialization
finishes and these are still reseeded from the OS. The purpose of the
independent CSPRNGs is simply to avoid the massive performance hit of
synchronization and there's no harm in doing it this way.

Keeping around the init CSPRNG and reseeding from it would defeat the
purpose of reseeding, and it isn't a measurable performance issue since
it can just be tuned to reseed less often.
2019-04-15 06:50:24 -04:00
Daniel Micay c7e2cb82f4 add generic get_random_bytes function 2019-04-15 06:07:28 -04:00
Daniel Micay 943a81fbeb use smaller integers for random cache state 2018-11-04 14:24:21 -05:00
Daniel Micay dcd969ae04 use a consistent style for fixed-size int types
The stdint.h types don't cover 128-bit integers and the underscore makes
them ill suited to usage in function suffixes. Instead, use the common
naming style in the Linux kernel and elsewhere including the ChaCha8
implementation included here.
2018-10-04 15:17:11 -04:00
Daniel Micay 700e06c2db manually specialize the CSPRNG cache 2018-08-26 00:43:46 -04:00
Daniel Micay c41e659383 use ChaCha8-based CSPRNG 2018-08-25 23:24:00 -04:00
Daniel Micay 2b7c9362bb consume fewer random bytes for slab randomization 2018-08-25 18:32:44 -04:00
Daniel Micay daa44905ee implement a cache for the CSPRNG 2018-08-23 16:36:57 -04:00
Daniel Micay 70d61b6662 initial commit 2018-08-23 15:42:41 -04:00