Forking from here. Summary:
ChaChaRng is for our purposes primarily an RNG; usage as a stream-cipher is secondary
- setting a nonce correctly using
set_counter is hard to do correctly due to required byte-to-u64 conversion and Endianness
- we could add another method, e.g.
fn set_nonce(&mut self, counter: u64, nonce: [u8; 8])
- we could add other constructors, as in PeterReid's version
- we could just leave as-is and state setting a nonce is unsupported
Current course of action: probably leave as is, with a note that setting a nonce is unsupported.
Forking from here. Summary:
ChaChaRngis for our purposes primarily an RNG; usage as a stream-cipher is secondaryset_counteris hard to do correctly due to required byte-to-u64 conversion and Endiannessfn set_nonce(&mut self, counter: u64, nonce: [u8; 8])Current course of action: probably leave as is, with a note that setting a nonce is unsupported.