chacha20 - rng - rand_core preview, minor set_stream() change and get_block_pos() change
#500
+90
−22
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.
It does not build because it requires one change to
rand_core#44, and theCargo.tomlneeds to be updated.Changes
rand_coreto a preview from Revise index / reset / skip methods rust-random/rand_core#44Cargo.tomlonce that PR makes it throughset_stream()to reset theblock_pos+indexto 0. Before, callingset_stream()would basically behave like this:set_stream()calls and the only way to replicate it was to manually find theword_posthat 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.get_block_pos()to return the currentblock_posinstead of returningblock_pos + 4due togenerate()calls incrementing the pos by 4.get_block_pos()was not implemented forrand_chacha, but it is a breaking change for anyone who was usingget_block_pos()from the prerelease versions.set_stream()nullifies any calls made toset_word_pos()orset_block_pos().Regarding #438