Skip to content

Conversation

@dhardy
Copy link
Contributor

@dhardy dhardy commented Jan 28, 2026

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 use ChaChaCore (already a public item).

}
}
impl CryptoGenerator for $ChaChaXCore {}
impl CryptoGenerator for ChaChaCore<$rounds, Legacy> {}
Copy link
Member

Choose a reason for hiding this comment

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

If the field will be private this impl can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

@dhardy
Copy link
Contributor Author

dhardy commented Jan 28, 2026

I think it better to merge this then make a new PR for rust-random/rand_core#68.

@dhardy
Copy link
Contributor Author

dhardy commented Jan 28, 2026

Aside: it would be nice to expose the StreamCipherSeekCore methods (or at least get_block_pos for variant Legacy) without the cipher feature enabled.

What is the preferred way to do this — a simple unparametrised method? Or provide a copy of StreamCipherSeekCore (minus the trait bound) without feature "cipher"?

@newpavlov
Copy link
Member

I think we can add public inherent methods and then use them in implementation of StreamCipherSeekCore.

@tarcieri
Copy link
Member

tarcieri commented Jan 28, 2026

Yeah, just add an inherent method with the same name/type signature as the trait. You can always disambiguate via UFCS

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.

3 participants