Uh oh!
There was an error while loading. Please reload this page.
chacha20: RNG refactor - #529
Conversation
f383216 to
5521753Compare| #[cfg(any(feature = "cipher", feature = "rng"))] | ||
| fn new(key: &[u8; 32], iv: &[u8]) -> Self { | ||
| /// | ||
| /// # Panics | ||
| /// If `iv.len()` is not equal to 4, 8, or 12. | ||
| #[must_use] | ||
| pub fn init(key: &[u8; 32], iv: &[u8]) -> Self { |
There was a problem hiding this comment.
So it would not collide with KeyIvInit::new. Since the method is now public it could be a problem.
There was a problem hiding this comment.
It seems weird for it to have two constructor methods that take different argument types and have different names but fundamentally do the same thing
There was a problem hiding this comment.
init usually means to do initial set-up of an existing item, not construct a new one.
Perhaps this should be new_rng or new_legacy?
There was a problem hiding this comment.
I wouldn't be too worried about the name if it weren't a public method. I think I preferred how it was private and feature-gated before.
There was a problem hiding this comment.
It doesn't need to be public for rand because that uses SeedableRng, and I think there isn't a reason it needs to pub for cipher usage either?
There was a problem hiding this comment.
Note that I made the method public and renamed it because the SeedableRng implementation was removed for ChaChaCore.
Uh oh!
There was an error while loading. Please reload this page.
tarcieri
commented
Feb 5, 2026
This PR could use a better description, like mentioning it's removing |
tarcieri
commented
Feb 5, 2026
I pushed a commit on top of this here: #531 It changes |
I merged #531 into this branch. As I commented above, the Personally, I think the inherent method should be sufficient. |
tarcieri
commented
Feb 6, 2026
Making it private was pretty much the main motivation of #531. I don't understand the motivation for making it public. What problem is that solving that was previously solved by the |
newpavlov
commented
Feb 6, 2026
IMO it simplifies the |
dhardy
commented
Feb 6, 2026
See this review comment. It doesn't really matter to me whether BTW my review notes on the documentation in #531 seem to have been ignored. |
Includes #529 which removed `StreamId` and changed `Seed` to a type alias, which are both breaking changes. Hopefully this is the last `rc` before a final release
Includes #529 which removed `StreamId` and changed `Seed` to a type alias, which are both breaking changes. Hopefully this is the last `rc` before a final release
Removes the
StreamIdtype and usesu64instead. ReplacesSeedwit type alias for[u8; 32], removing various other bespoke conversions from other types.