-
Notifications
You must be signed in to change notification settings - Fork 50
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: 64-bit counter support #334
Comments
I have some seemingly working code for this, but it builds on the Rng PR with |
Let's try to land #333 first |
I took another look at my 64-bit counter code, and it isn't working correctly on the NEON backend atm. It uses a const bool in The largest use-case for a 64-bit counter (that I can think of) is file system encryption for mobile devices. I've ran some benches, and I will keep working on it a little, but I'd probably prefer a solution that doesn't need to modify the backends, if that's possible. Because the way it is now, every new backend would also need to have specific code for updating the counter |
The
ChaCha20Legacy
construction, i.e. the djb variant, is supposed to use a 64-bit counter but currently uses a 32-bit counter because it shares its core implementation with the IETF construction which uses a 32-bit counter.This results in a counter overflow after generating 256 GiB of keystream. Compatible implementations are able to generate larger keystreams.
I'm not sure how much of a practical concern this actually is, but it did come up in discussions here: rust-random/rand#934 (comment)
We can probably make the counter type generic between
u32
/u64
in the core implementation if need be.The text was updated successfully, but these errors were encountered: