RustCrypto / RustCrypto/block-ciphers
threefish: add method to update tweak between encrypt/decrypt calls
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 784
- Forks
- 157
- Avg merge
- 15h 24m
- Merged PRs (30d)
- 9
Description
Currently, there is no way to update the tweak value between successive encrypt/decrypt calls without creating a new cipher instance. This is inefficient and it would be appreciated if you added a way to update the tweak without creating a new cipher instance. I'm not sure it would be possible to add given that your current implementation stores all of the cipher state in a giant array sk, but in the original C implementation keyCtx is passed into every encrypt/decrypt call, which allowed the tweak to be changed between cipher calls without mucking with the rest of the cipher state.
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 by locating the Rust Threefish implementation and its sk state array, then compare how the linked C implementation passes keyCtx into encryption and decryption. Define how callers would update the tweak without rebuilding the cipher, and add coverage showing successive calls use different tweaks while preserving the key schedule.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100