Skip to content

Develop trait for tweakable block ciphers #6

@newpavlov

Description

@newpavlov

Recently added Threefish is a tweakable block cipher, thus we need an appropriate trait for it.

Currently I am thinking of using this:

pub trait TweakableBlockCipher {
    type BlockSize: ArrayLength<u8>;
    type TweakSize: ArrayLength<u8>;

    fn encrypt(&self, block: &mut Block<Self::BlockSize>,  tweak: &Block<Self::TweakSize>);

    fn decrypt(&self, block: &mut Block<Self::BlockSize>, tweak: &Block<Self::TweakSize>);
}

In addition to it I think tweakable ciphers should auto implement BlockCipher using zero tweak.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions