Repository navigation
rng: Fix subkeys not initialized - #230
Merged
Merged
Conversation
harshavardhana
approved these changes
Apr 6, 2026
rraulinio
approved these changes
Apr 7, 2026
Vonng
added a commit
to pgsty/silo-pkg
that referenced
this pull request
Aug 2, 2026
Backport of minio#230 (ea0b47a). init() reads 32 bytes from the source into r.tmp, then derived the four subkeys from a zeroed local of the same name. The subkeys were therefore always zero, which collapses the four per-block lanes onto one key and makes Reset() and ResetSize() replay the previous stream byte for byte. MinIO reaches this through randreader.New(), which builds a fresh reader per call and never resets, so the practical effect here is small; warp is what surfaced it. The fix costs five lines either way. The tests read one aligned block rather than 64 MiB. ResetSize reseeds the subkeys and nothing else, so if they stayed zero the very first bytes after the reset would repeat - which the shrunk assertion still catches, confirmed by reverting the fix. The original size cost roughly 430 MiB of resident memory under -race for no extra coverage. Error returns from NewReader, Reset, ResetSize and ReadFull are checked rather than dropped. (cherry picked from commit afc57198ade9ae946705823183c5e54077c66b61)
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.
Ref: minio/warp#471