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

Proposal: use 8 rounds of ChaCha by default #6

Closed
kernelmethod opened this issue Sep 20, 2023 · 2 comments
Closed

Proposal: use 8 rounds of ChaCha by default #6

kernelmethod opened this issue Sep 20, 2023 · 2 comments

Comments

@kernelmethod
Copy link
Owner

Right now we use ChaCha20 for CRNG by default (i.e., when you call ChaChaStream()). This is fairly expensive compared to the default PRNG used by Julia (which uses Xoshiro256++).

It seems that Golang nowadays uses ChaCha8 for math/rand/v2 (golang/go#61716). Based on the discussion there, it'd probably be worth investigating whether we'd be better off using ChaCha8 instead of ChaCha20 for CRNG.

@kernelmethod
Copy link
Owner Author

kernelmethod commented Apr 20, 2024

Some more info:

@kernelmethod
Copy link
Owner Author

Final reference: https://go.dev/blog/chacha8rand

I've gone ahead with making ChaCha8 the default in the dev branch, which should provide an amortized ~2.5x speedup over the previous default of ChaCha20.

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

No branches or pull requests

1 participant