Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
FastRandomContext improvements and switch to ChaCha20 #9792
This switches FastRandomContext to use a ChaCha20-based random number generator. It also makes the class richer by adding support for getting single bits of entropy.
Benchmarks (also added) show that
src/addrman.cpp: nKBucket = (nKBucket + insecure_rand.rand32()) % ADDRMAN_TRIED_BUCKET_COUNT;
Usage wants a randrange a lot more than a rand32