-
-
Notifications
You must be signed in to change notification settings - Fork 489
Closed
Description
Background
What is your motivation?
- ChaCha12 is the current algorithm for
ThreadRng, and there’s no simple way to change it, while keeping all the nice thread-local ergonomics, auto reseeding, and a feature rich API. - ChaCha20 is the IETF standard, more future-proof algorithm. It provides better security margin at the cost of slightly worse performance. For vast majority of programs, it’s overkill. But for security-sensitive programs and for peace of mind, it can be worth it.
What type of application is this? (E.g. cryptography, game, numerical simulation)
Cryptography
Feature request
Add a simple way to switch to ChaCha20 as the default ThreadRng algorithm.
This could be done with an opt-in feature flag, that, when enabled, would change the underlying ThreadRng algorithm to ChaCha20.
It could be implemented without any breaking changes. The API would stay the same, except it’d just use the other algorithm internally.
println!("{}", rng().random_range(0..100));
// ^^^^^ uses ChaCha20 if explicitly enabled;
// otherwise still uses ChaCha12Happy to make a PR if this looks good.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels