-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Investigate replacing the ISAAC Rng with directly using the operating system, or an eSTREAM Rng (etc.) #10047
Comments
+1 on just using the OS. With the exception of Colin Percival, cryptographers universally tell us to do this. |
I don't have a strong opinion about this as long as it remains fast, but there is a consideration here that if we do this the algorithm our CSPRNG uses will be platform-specific. There may be some value in being able to know that "Rust's CSPRNG is ISAAC", etc. |
@pcwalton: The benefit of using a modern stream cipher would be removing the temptation of having non-cryptographic RNG implementations like a Mersenne twister implementation. I don't think it would be good if creating a hash table always required a system call or a lock (for a buffer). |
Here's an article about the poor multithreaded performance of |
One interesting comment from that article, by Theodore Ts'o:
It should be noted that he is the original author of /dev/random |
@huonw what do you think of this ticket today? I feel like our RNG story is pretty solid at this point. |
Switching to the OS RNG (/dev/urandom) doesn't seem like it provides significant value. However, if Rust wants to consider switching to a platform-specific RNG to gain performance (which seems reasonable if the user hasn't explicitly used a seeded RNG to get reproducible result, such as for a game with replays), then several possibilities seem worth investigating, such as the use of hardware random number generators like |
Closing; this would want an RFC these days, I think. |
…v, r=xFrednet Add 1.58 MSRV for `collapsible_str_replace` The `Pattern` impl for `[char; N]` was added in 1.58 changelog: Enhancement: [`collapsible_str_replace`]: Now takes MSRV into consideration. The minimal version is 1.58 [rust-lang#10047](rust-lang/rust-clippy#10047)
Non-exhaustive list of possible candidates:
/dev/urandom
orGenCryptRandom
)Important considerations:
The ISAAC Rng currently implemented in
std::rand
has some known weaknesses, but is generally accepted as cryptographically secure (although it has not received a huge amount of scrutiny).The text was updated successfully, but these errors were encountered: