Skip to content

Miscellaneous cleanups#550

Merged
newpavlov merged 4 commits intoRustCrypto:masterfrom
divergentdave:david/misc-cleanups
Mar 4, 2026
Merged

Miscellaneous cleanups#550
newpavlov merged 4 commits intoRustCrypto:masterfrom
divergentdave:david/misc-cleanups

Conversation

@divergentdave
Copy link
Contributor

This fixes a few superficial items I noticed while reviewing the chacha20 crate.

  • Fixes an inaccuracy in the get_word_pos() documentation.
  • Use add() instead of offset() on a pointer (when the offset is always positive) to resolve an ignored Clippy lint.
  • Replace a literal 16 with the BLOCK_WORDS constant.
  • Rewrites a copy-pasted section of a unit test to match the preceding comment.

Changing from <*mut _>::offset() to <*mut _>::add() causes the compiler
to infer that the type of state_row is usize instead of isize. This
means the later cast is no longer needed.
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.

Thank you!

@newpavlov newpavlov merged commit bfa1f34 into RustCrypto:master Mar 4, 2026
29 checks passed
@divergentdave divergentdave deleted the david/misc-cleanups branch March 4, 2026 23:05
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.

2 participants