RustCrypto / RustCrypto/stream-ciphers
`salsa20`: support 16 byte keys
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 325
- Forks
- 77
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 4
Description
16 and 10 byte keys use different constants, as described in the Salsa20 paper:
The diagonal constants are the same for every block, every nonce, and every
32-byte key. As an extra (non-recommended) option, Salsa20 can use a 16-byte
key, repeated to form a 32-byte key; in this case the diagonal constants change to
0x61707865, 0x3120646e, 0x79622d36, 0x6b206574. Salsa20 can also use a 10-
byte key, zero-padded to form a 16-byte key; in this case the diagonal constants
change to 0x61707865, 0x3120646e, 0x79622d30, 0x6b206574.
RustCrypto only supports the 32-byte key:
So it's not possible to "extend" the key without changing the constant.
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 in salsa20/src/lib.rs around the key handling referenced by the issue, then compare the implementation with the Salsa20 paper. Confirm how 16-byte keys are currently rejected or extended, and update the behavior so the alternate diagonal constants are used for 16-byte keys. Done means valid 16-byte keys are supported without changing 32-byte key behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100