Skip to content
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

Add rand_core::RngCore implementation to chacha20 #63

Merged
merged 1 commit into from
Oct 23, 2019

Conversation

dhardy
Copy link
Contributor

@dhardy dhardy commented Oct 20, 2019

This is a quick-and-dirty implementation for testing (could do with seek implementation and better doc at least).

@tarcieri
Copy link
Member

I think I'd like to cut another release of chacha20 with the SSE impl then merge this

@tarcieri tarcieri merged commit 46afd2b into RustCrypto:master Oct 23, 2019
@tarcieri
Copy link
Member

@dhardy thanks!

tarcieri added a commit that referenced this pull request Mar 16, 2021
Removes `derive(Clone)` on `ChaCha*Rng*`.

They date back to the original PR which added RNG support (#63).

Allowing `Clone` on an RNG is problematic because the cloned RNG will
have the same internal state, duplicating outputs which can be
catastrophic in a cryptographic context.

Instead, the `SeedableRng::from_rng` method can be used to "fork" one
RNG from another, seeing a new RNG with an output from another:

https://docs.rs/rand_core/0.6.2/rand_core/trait.SeedableRng.html#method.from_rng
tarcieri added a commit that referenced this pull request Mar 16, 2021
Removes `derive(Clone)` on `ChaCha*Rng*`.

They date back to the original PR which added RNG support (#63).

Allowing `Clone` on an RNG is problematic because the cloned RNG will
have the same internal state, duplicating outputs which can be
catastrophic in a cryptographic context.

Instead, the `SeedableRng::from_rng` method can be used to "fork" one
RNG from another, seeing a new RNG with an output from another:

https://docs.rs/rand_core/0.6.2/rand_core/trait.SeedableRng.html#method.from_rng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants