Skip to content

Trait for tweakable block ciphers #177

@newpavlov

Description

@newpavlov

Threefish is an example of tweakable block cipher, thus ideally we need an appropriate trait for it.

One option is to use something like this:

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

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

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

Additional context can be found in the previous issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cipherBlock and stream cipher crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions