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

chacha20: remove Clone impls on RNGs #220

Merged
merged 1 commit into from
Mar 16, 2021

Commits on Mar 16, 2021

  1. chacha20: remove Clone impls on RNGs

    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 committed Mar 16, 2021
    Configuration menu
    Copy the full SHA
    d39a020 View commit details
    Browse the repository at this point in the history