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

Add CryptoRng marker trait to ChaChaXCore #944

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

coltfred
Copy link
Contributor

@coltfred coltfred commented Mar 7, 2020

Fixes #943.

@bjorn3
Copy link
Contributor

bjorn3 commented Mar 7, 2020

$ChaChaXRng does implement CryptoRng.

@coltfred
Copy link
Contributor Author

coltfred commented Mar 8, 2020 via email

@dhardy
Copy link
Member

dhardy commented Mar 8, 2020

I think it would make sense to implement this only for the 12-round+ versions (i.e. not ChaCha8Rng / Core). @newpavlov do you agree?

@coltfred
Copy link
Contributor Author

coltfred commented Mar 9, 2020 via email

@dhardy
Copy link
Member

dhardy commented Mar 9, 2020

As far as I know, ChaCha8 is secure (i.e. unbroken today). That is not the same as being recommended for use in cryptography: it has only a low margin of security. @tarcieri may like to comment, but IMO we shouldn't recommend ChaCha8 for cryptography, which is roughly what CryptoRng is for.

@tarcieri
Copy link

tarcieri commented Mar 9, 2020

The "Too Much Crypto" paper recommended it, but it is debatable. (FWIW, the paper's author also co-authored the paper with the best known attack on ChaCha*)

The best known attack reduces ChaCha7 from 256-bits symmetric security to ~247-bits.

There are no known attacks against ChaCha8. Personally I think it's ok to consider it a CryptoRng.

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. In that case, I approve this PR.

@dhardy dhardy merged commit 8ed19df into rust-random:master Mar 9, 2020
@coltfred coltfred mentioned this pull request Mar 9, 2020
dhardy added a commit that referenced this pull request Mar 9, 2020
Add CryptoRng marker trait to ChaChaXCore
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

Successfully merging this pull request may close these issues.

rand_chacha::ChaCha20Core does not implement CryptoRng
4 participants