-
Notifications
You must be signed in to change notification settings - Fork 25
Clean up RNG comparison table #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,10 +39,10 @@ You may wish to refer to the [pcg-random] and [xoshiro] websites. | |
|
|
||
| | name | full name | performance | memory | quality | period | features | | ||
| |------|-----------|-------------|--------|---------|--------|----------| | ||
| | [`SmallRng`] | (unspecified) | 11 GB/s | 16 bytes | ★★★☆☆ | ≥ `u32` * 2<sup>64</sup> | not portable | | ||
| | [`Pcg32`] | PCG XSH RR 64/32 (LCG) | 5 GB/s | 16 bytes | ★★★☆☆ | `u32` * 2<sup>64</sup> | — | | ||
| | [`Pcg64`] | PCG XSL 128/64 (LCG) | 7 GB/s | 32 bytes | ★★★☆☆ | `u64` * 2<sup>128</sup> | — | | ||
| | [`Pcg64Mcg`] | PCG XSL 128/64 (MCG) | 8 GB/s | 16 bytes | ★★★☆☆ | `u64` * 2<sup>126</sup> | — | | ||
| | [`SmallRng`] | (unspecified) | (unspecified) | (unspecified) | ★★★☆☆ | ≥ `u32` * 2<sup>64</sup> | not portable | | ||
| | [`Pcg32`] | PCG XSH RR 64/32 (LCG) | 5 GB/s | 16 bytes | ★★★☆☆ | `u32` * 2<sup>64</sup> | jump-ahead | | ||
| | [`Pcg64`] | PCG XSL 128/64 (LCG) | 7 GB/s | 32 bytes | ★★★☆☆ | `u64` * 2<sup>128</sup> | jump-ahead | | ||
| | [`Pcg64Mcg`] | PCG XSL 128/64 (MCG) | 8 GB/s | 16 bytes | ★★★☆☆ | `u64` * 2<sup>126</sup> | jump-ahead | | ||
| | [`XorShiftRng`] | Xorshift 32/128 | 7 GB/s | 16 bytes | ★☆☆☆☆ | `u32` * 2<sup>128</sup> - 1 | — | | ||
| | [`Xoshiro256PlusPlus`] | Xoshiro256++ | 11 GB/s | 32 bytes | ★★★☆☆ | `u64` * 2<sup>256</sup> - 1 | jump-ahead | | ||
| | [`Xoshiro256Plus`] | Xoshiro256+ | 13 GB/s | 32 bytes | ★★☆☆☆ | `u64` * 2<sup>256</sup> - 1 | jump-ahead | | ||
|
|
@@ -79,9 +79,10 @@ table since CSPRNGs may not have observable defects. | |
|
|
||
| | name | full name | performance | initialization | memory | security (predictability) | forward secrecy | | ||
| |------|-----------|--------------|--------------|----------|----------------|-------------------------| | ||
| | [`StdRng`] | (unspecified) | 4.1 GB/s | fast | 136 bytes | widely trusted | no | | ||
| | [`StdRng`] | (unspecified) | (unspecified) | fast | (unspecified) | widely trusted | no | | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, performance is part of the selection criteria so could write 'fast'. |
||
| | [`ChaCha20Rng`] | ChaCha20 | 2.6 GB/s | fast | 136 bytes | [rigorously analysed](https://tools.ietf.org/html/rfc7539#section-1) | no | | ||
| | [`ChaCha8Rng`] | ChaCha8 | 5.8 GB/s | fast | 136 bytes | small security margin | no | | ||
| | [`ChaCha12Rng`] | ChaCha12 | 4.1 GB/s | fast | 136 bytes | [large security margin](https://eprint.iacr.org/2019/1492) | no | | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I measure the size as 320 bytes now. I recall that the buffer size has been increased to better support some SIMD backends. This size is untested in the stream-ciphers repo. Update this to 320 with a footnote clarifying that it may change? |
||
| | [`ChaCha8Rng`] | ChaCha8 | 5.8 GB/s | fast | 136 bytes | [sufficient security margin](https://eprint.iacr.org/2019/1492) | no | | ||
| | [`Hc128Rng`] | HC-128 | 4.6 GB/s | slow | 4176 bytes | [recommended by eSTREAM](http://www.ecrypt.eu.org/stream/) | no | | ||
| | [`IsaacRng`] | ISAAC | 2.1 GB/s | slow | 2072 bytes | [unknown](https://burtleburtle.net/bob/rand/isaacafa.html) | unknown | | ||
| | [`Isaac64Rng`] | ISAAC-64 | 3.7 GB/s | slow | 4136 bytes| unknown | unknown | | ||
|
|
@@ -322,6 +323,7 @@ by P. Hellekalek. | |
| [`Xoshiro256Plus`]: https://docs.rs/rand_xoshiro/latest/rand_xoshiro/struct.Xoshiro256Plus.html | ||
| [`SplitMix64`]: https://docs.rs/rand_xoshiro/latest/rand_xoshiro/struct.SplitMix64.html | ||
| [`ChaCha20Rng`]: https://docs.rs/chacha20/latest/chacha20/struct.ChaCha20Rng.html | ||
| [`ChaCha12Rng`]: https://docs.rs/chacha20/latest/chacha20/struct.ChaCha12Rng.html | ||
| [`ChaCha8Rng`]: https://docs.rs/chacha20/latest/chacha20/struct.ChaCha8Rng.html | ||
| [`Hc128Rng`]: https://docs.rs/rand_hc/latest/rand_hc/struct.Hc128Rng.html | ||
| [`IsaacRng`]: https://docs.rs/rand_isaac/latest/rand_isaac/isaac/struct.IsaacRng.html | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of
SmallRngis to be a fast, low-memory PRNG. Maybe we should use inspecific words like 'fast', 'small' here? Or 'competitive'?