RustCrypto / RustCrypto/stream-ciphers
chacha20: improve tests for 64-bit counter variants
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 325
- Forks
- 77
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 4
Description
Replacing these lines with state[12] = _mm_cvtsi128_si32(self.v[3]) as u32; (i.e. writing only 32 counter bits) does not result in failed tests for the legacy cipher variants (RNG tests fail as expected). We probably should add tests to check cipher behavior in scenarios which overflow 32 bit counter.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the counter handling at lines 72–73 of chacha20/src/backends/sse2.rs and inspect the existing tests for the legacy cipher variants, including the RNG tests. Add coverage for cipher behavior when the counter overflows 32 bits. Done means the tests detect a 32-bit-only counter implementation while preserving the expected behavior of the 64-bit variants.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100