You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ce80942 random: replace construct/assign with explicit Reseed() (Pieter Wuille)
2ae392d random: use LogError for init failure (Pieter Wuille)
97e16f5 tests: make fuzz tests (mostly) deterministic with fixed seed (Pieter Wuille)
2c91330 random: cleanup order, comments, static (Pieter Wuille)
8e31cf9 net, net_processing: use existing RNG objects more (Pieter Wuille)
d5fcbe9 random: improve precision of MakeExponentiallyDistributed (Pieter Wuille)
cfb0dfe random: convert GetExponentialRand into rand_exp_duration (Pieter Wuille)
4eaa239 random: convert GetRand{Micros,Millis} into randrange (Pieter Wuille)
82de1b8 net: use GetRandMicros for cache expiration (Pieter Wuille)
ddc184d random: get rid of GetRand by inlining (Pieter Wuille)
e2d1f84 random: make GetRand() support entire range (incl. max) (Pieter Wuille)
810cdf6 tests: overhaul deterministic test randomness (Pieter Wuille)
6cfdc5b random: convert XoRoShiRo128PlusPlus into full RNG (Pieter Wuille)
8cc2f45 random: move XoRoShiRo128PlusPlus into random module (Pieter Wuille)
8f5ac0d xoroshiro128plusplus: drop comment about nonexisting copy() (Pieter Wuille)
8924f51 random: modernize XoRoShiRo128PlusPlus a bit (Pieter Wuille)
ddb7d26 random: add RandomMixin::randbits with compile-known bits (Pieter Wuille)
21ce9d8 random: Improve RandomMixin::randbits (Pieter Wuille)
9b14d3d random: refactor: move rand* utilities to RandomMixin (Pieter Wuille)
40dd86f random: use BasicByte concept in randbytes (Pieter Wuille)
27cefc7 random: add a few noexcepts to FastRandomContext (Pieter Wuille)
b3b382d random: move rand256() and randbytes() to .h file (Pieter Wuille)
493a2e0 random: write rand256() in function of fillrand() (Pieter Wuille)
Pull request description:
This PR contains a number of vaguely-related improvements to the random module.
The specific changes and more detailed rationale is in the commit messages, but the highlights are:
* `XoRoShiRo128PlusPlus` (previously a test-only RNG) moves to random.h and becomes `InsecureRandomContext`, which is even faster than `FastRandomContext` but non-cryptographic. It also gets all helper randomness functions (`randrange`, `fillrand`, ...), making it a lot more succinct to use.
* During tests, **all** randomness is made deterministic (except for `GetStrongRandBytes`) but non-repeating (like `GetRand()` used to be when `g_mock_deterministic_tests` was used), either fixed, or from a random seed (overridden by env var).
* Several infrequently used top-level functions (`GetRandMillis`, `GetRandMicros`, `GetExponentialRand`) are converted into member functions of `FastRandomContext` (and `InsecureRandomContext`).
* `GetRand<T>()` (without argument) can now return the maximum value of the type (previously e.g. `GetRand<uint32_t>()` would never return 0xffffffff).
ACKs for top commit:
achow101:
ACK ce80942
maflcko:
re-ACK ce80942 🐈
hodlinator:
ACK ce80942
dergoegge:
utACK ce80942
Tree-SHA512: 79bc0cbafaf27e95012c1ce2947a8ca6f9a3c78af5f1f16e69354b6fc9b987a28858adf4cd356dc5baf21163e9af8dcc24e70f8d7173be870e8a3ddcdd47c02c
0 commit comments