Skip to content

Add CryptoRng marker trait to ChaChaXCore#944

Merged
dhardy merged 1 commit into
rust-random:masterfrom
coltfred:crypto-rng-chachacore
Mar 9, 2020
Merged

Add CryptoRng marker trait to ChaChaXCore#944
dhardy merged 1 commit into
rust-random:masterfrom
coltfred:crypto-rng-chachacore

Conversation

@coltfred

@coltfred coltfred commented Mar 7, 2020

Copy link
Copy Markdown
Contributor

Fixes #943.

@bjorn3

bjorn3 commented Mar 7, 2020

Copy link
Copy Markdown
Contributor

$ChaChaXRng does implement CryptoRng.

@coltfred

coltfred commented Mar 8, 2020 via email

Copy link
Copy Markdown
Contributor Author

@dhardy

dhardy commented Mar 8, 2020

Copy link
Copy Markdown
Member

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

coltfred commented Mar 9, 2020 via email

Copy link
Copy Markdown
Contributor Author

@dhardy

dhardy commented Mar 9, 2020

Copy link
Copy Markdown
Member

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

tarcieri commented Mar 9, 2020

Copy link
Copy Markdown
Contributor

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.

@dhardy dhardy left a comment

Copy link
Copy Markdown
Member

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