RustCrypto / RustCrypto/block-ciphers

threefish: add method to update tweak between encrypt/decrypt calls

Open
#459 7 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.