Skip to content

Conversation

@dhardy
Copy link
Member

@dhardy dhardy commented Jan 28, 2026

  • Added a CHANGELOG.md entry

Summary

Removes ReseedingRng, then reduces the remaining code. Closes #1721.

Motivation

This generic type appears to have little or no real use outside of ThreadRng. Removing it allows for several simplifications (also in rand_core).

Details

(This has a number of little commits so should ultimately be squashed.)

@dhardy dhardy requested review from newpavlov and vks January 28, 2026 15:48
@dhardy dhardy marked this pull request as ready for review January 28, 2026 15:48
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

I think it's worth to also remove bytes_until_reseed and use block counter stored in the ChaCha core as part of this PR.

- Pub export `Xoshiro128PlusPlus`, `Xoshiro256PlusPlus` prngs (#1649)
- Pub export `ChaCha8Rng`, `ChaCha12Rng`, `ChaCha20Rng` behind `chacha` feature (#1659)

### Removals
Copy link
Member

Choose a reason for hiding this comment

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

Keepchangelog recommends to use Added/Changed/Removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

None of the other recent titles match that... a job for another PR.

@dhardy
Copy link
Member Author

dhardy commented Jan 28, 2026

Aha, #1686 uses rng_core.block_pos(). I don't see that method and get_block_pos() is only on the RNG, so I think we need to add a method (we don't use the cipher feature).

@newpavlov
Copy link
Member

Yes. You can add it as part of RustCrypto/stream-ciphers#512.

@dhardy
Copy link
Member Author

dhardy commented Jan 28, 2026

Ironically such a method would be one use for keeping the ChaCha*Core types.

@newpavlov
Copy link
Member

newpavlov commented Jan 28, 2026

The difference is that it's not a "core RNG" type. It's a chacha20-specific type which we expose either way for potential cryptographic applications with inherent methods useful for ThreadRng implementation.

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.

Remove ReseedingRng?

3 participants