Conversation
20e67fa to
d072c70
Compare
Member
Author
|
From the other PR and patch I take it that @nstilt1 finds this acceptable. |
1 task
tarcieri
pushed a commit
to RustCrypto/stream-ciphers
that referenced
this pull request
Jan 19, 2026
… change (#500) # Changes * Update `rand_core` to a preview from rust-random/rand_core#44 * I need to change the `Cargo.toml` once that PR makes it through * Update `set_stream()` to reset the `block_pos` + `index` to 0. Before, calling `set_stream()` would basically behave like this: ```rust fn set_stream(stream_id: S) { self.stream = S.into(); if self.index != 64 { // generate_and_set is called, resulting in self.block_pos += 4; self.index = self.index; // no change to the index, but change to the block_pos } } ``` * * I had a test that had repeated `set_stream()` calls and the only way to replicate it was to manually find the `word_pos` that resulted from each call. We can remove this test or at the very least reduce the test, since I had to add more assertions to figure out what was going on in the previous implementation. * Update `get_block_pos()` to return the current `block_pos` instead of returning `block_pos + 4` due to `generate()` calls incrementing the pos by 4. * This is not a breaking change since `get_block_pos()` was not implemented for `rand_chacha`, but it is a breaking change for anyone who was using `get_block_pos()` from the prerelease versions. * Update docs to explain that `set_stream()` nullifies any calls made to `set_word_pos()` or `set_block_pos()`. --------- Co-authored-by: Arthur Gautier <arthur.gautier@arista.com>
takumi-earth
pushed a commit
to earthlings-dev/rand_core
that referenced
this pull request
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CHANGELOG.mdentrySummary
Make
fn indexprivate; addfn word_offsetas a pub replacement.Remove
fn reset; renamefn generate_and_settoreset_and_skip.Motivation
The old
fn indexwas easy to mis-use: RustCrypto/stream-ciphers#438 (comment). I don't think this was the first time.We also don't need two "reset" methods; it should be equivalent to call
reset_and_skip(0).@nstilt1 please review.