Skip to content

chacha20 - Clone is not implemented for ChaChaXRng #497

@nstilt1

Description

@nstilt1

DHardy mentioned some code that was related to the test_chacha_clone_streams() test, and then I realized that the test doesn't actually perform the clone operation because Clone is not implemented for the RNG. To do this, we would have to implement Clone for ChaChaCore<R, V> or implement Clone for ChaChaXCore manually and clone the ChaChaCore struct from there. I have some questions:

  1. Does implementing Clone for ChaChaCore<R, V> pose any security risks for either the RNG or the cipher? Like if it enabled users to clone the cipher/RNG in a way that is less secure?
  2. Would we prefer to add impl PartialEq and impl Eq to rng.rs or lib.rs, ie impl them for ChaChaCore<R, V> in lib.rs or only impl them for ChaChaXCore in `rng.rs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions