add usage hints to prandom and switch to Xoshiro
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 0 repliesNew
- v12 patches 3 repliesSuperseded
Changes in v2 from the cover letter
- fix indentation
- add better checks against invalid state
- rebase
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | prandom: add usage comments for cryptographyinclude/ lib/ | +8 | 0 replies | |
| 2/4 | prandom/random32: switch to Xoshiro256++include/ lib/ | +177 | 0 replies | |
| 3/4 | prandom/random32: add checks against invalid statelib/ | +24 | 0 replies | |
| 4/4 | test_hash.c: replace custom PRNG by prandomlib/ | +13 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/4] add usage hints to prandom and switch to Xoshiro
This series builds on top of the crng/master repository, as other prandom commits are already queued there.
v2:
- fix indentation
- add better checks against invalid state
- rebase
With the current cryptographically safe PRNG in drivers/char/random.c fast enough for most purposes, make annoyingly clear, that no one should use the prandom PRNG for cryptographic purposes without known about this.
While looking at the prandom/random32 code, I informed myself about PRNGs and saw that currently fast PRNGs with better statistical properties than LFSR113, which is currently used, are available.
Recent alternatives to consider are in my opinion:
* PCG: https://www.pcg-random.org
* Xoshiro: https://prng.di.unimi.it
While both seem to have good statistical properties, I recommend to chose Xoshiro256++ here, because it seems to be even faster than RNGs from the PCG series.
Furthermore, the authors of Xoshiro provide a small RNG named SplitMix64 for generating high quality seeds for the Xoshiro RNG. By using this in the default way, no further seed checks or state warmup are necessary. This simplifies the PRNG code IMHO.
Markus Theil (4):
prandom: add usage comments for cryptography prandom/random32: switch to Xoshiro256++ prandom/random32: add checks against invalid state test_hash.c: replace custom PRNG by prandom
include/linux/prandom.h | 30 +--- lib/random32.c | 378 +++++++++++++++++++++------------------- lib/tests/test_hash.c | 40 ++--- 3 files changed, 220 insertions(+), 228 deletions(-)
Signature · 1 line
2.49.0