Uh oh!
There was an error while loading. Please reload this page.
Remove ChaChaXCore types - #512
Conversation
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| } | ||
| impl CryptoGenerator for $ChaChaXCore {} | ||
| impl CryptoGenerator for ChaChaCore<$rounds, Legacy> {} |
There was a problem hiding this comment.
If the field will be private this impl can be removed.
There was a problem hiding this comment.
The point being that we don't need trait CryptoGenerator at all. The trait is (I believe) only used by ReseedingRng, so lets start with that. (Another PR will be needed to update to the new rand_core soon anyway.)
Uh oh!
There was an error while loading. Please reload this page.
dhardy
commented
Jan 28, 2026
I think it better to merge this then make a new PR for rust-random/rand_core#68. |
dhardy
commented
Jan 28, 2026
Aside: it would be nice to expose the What is the preferred way to do this — a simple unparametrised method? Or provide a copy of |
newpavlov
commented
Jan 28, 2026
I think we can add public inherent methods and then use them in implementation of |
Yeah, just add an inherent method with the same name/type signature as the trait. You can always disambiguate via UFCS |
dhardy
commented
Jan 29, 2026
Done. UFCS shouldn't be needed since inherent methods always have priority and the in/out types are the same... ... expect for |
dhardy
commented
Jan 29, 2026
I believe that makes the most sense, so done (last two commits). |
newpavlov
commented
Jan 29, 2026
Note the failing CI. |
5db9f4a to
2999132Comparedhardy
commented
Jan 30, 2026
Why does #[cfg(any(feature = "cipher", feature = "rng"))]
state:[u32;STATE_WORDS],Is it supposed to compile to an empty struct if neither of these features are used? |
Uh oh!
There was an error while loading. Please reload this page.
Corrects an oversight from #512.
In discussion of API bloat with @newpavlov, it became clear that we don't need these types.
The only known use is
rand::rngs::ThreadRng, yet there's no reason that can't useChaChaCore(already a public item).