An implementation of random number generators based on
The random number generators provided by this crate are fairly slow (the latency for these instructions is pretty high), but provide high quality random bits. Caveat is: neither AMD’s nor Intel’s designs are public and therefore are not verifiable for lack of backdoors.
Unless you know what you are doing, use the random number generators provided by the
crate (such as
Here are a measurements for select processor architectures. Check Agner’s instruction tables for up-to-date listings.
|Architecture||Latency (cycles)||Maximum throughput (per core)|
|AMD Ryzen||~1200||~1200||~2500||~12MB/s @ 3.7GHz|
|Intel Skylake||460||460||460||~72MB/s @ 4.2GHz|
|Intel Haswell||320||320||320||~110MB/s @ 4.4GHz|
A cryptographically secure statistically uniform, non-periodic and non-deterministic random bit generator.
A cryptographically secure non-deterministic random bit generator.
Errors in this library