Skip to main content

BlockCipher

Trait BlockCipher 

Source
pub trait BlockCipher {
    const BLOCK_LEN: usize;

    // Required methods
    fn encrypt(&self, block: &mut [u8]);
    fn decrypt(&self, block: &mut [u8]);
}
Expand description

Common interface for block ciphers.

Every cipher exposes in-place encrypt / decrypt operating on a byte slice whose length must equal Self::BLOCK_LEN.

Required Associated Constants§

Source

const BLOCK_LEN: usize

Block length in bytes.

Required Methods§

Source

fn encrypt(&self, block: &mut [u8])

Encrypt one block in-place. Panics if block.len() != BLOCK_LEN.

Source

fn decrypt(&self, block: &mut [u8])

Decrypt one block in-place. Panics if block.len() != BLOCK_LEN.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl BlockCipher for Aes128

Source§

impl BlockCipher for Aes128Ct

Source§

impl BlockCipher for Aes192

Source§

impl BlockCipher for Aes192Ct

Source§

impl BlockCipher for Aes256

Source§

impl BlockCipher for Aes256Ct

Source§

impl BlockCipher for Camellia128

Source§

impl BlockCipher for Camellia128Ct

Source§

impl BlockCipher for Camellia192

Source§

impl BlockCipher for Camellia192Ct

Source§

impl BlockCipher for Camellia256

Source§

impl BlockCipher for Camellia256Ct

Source§

impl BlockCipher for Cast128

Source§

impl BlockCipher for Cast128Ct

Source§

impl BlockCipher for Des

Source§

impl BlockCipher for DesCt

Source§

impl BlockCipher for TripleDes

Source§

impl BlockCipher for Grasshopper

Source§

impl BlockCipher for GrasshopperCt

Source§

impl BlockCipher for Magma

Source§

impl BlockCipher for MagmaCt

Source§

impl BlockCipher for Present80

Source§

impl BlockCipher for Present80Ct

Source§

impl BlockCipher for Present128

Source§

impl BlockCipher for Present128Ct

Source§

impl BlockCipher for Seed

Source§

impl BlockCipher for SeedCt

Source§

impl BlockCipher for Serpent128

Source§

impl BlockCipher for Serpent128Ct

Source§

impl BlockCipher for Serpent192

Source§

impl BlockCipher for Serpent192Ct

Source§

impl BlockCipher for Serpent256

Source§

impl BlockCipher for Serpent256Ct

Source§

impl BlockCipher for Simon32_64

Source§

impl BlockCipher for Simon48_72

Source§

impl BlockCipher for Simon48_96

Source§

impl BlockCipher for Simon64_96

Source§

impl BlockCipher for Simon64_128

Source§

impl BlockCipher for Simon96_96

Source§

impl BlockCipher for Simon96_144

Source§

impl BlockCipher for Simon128_128

Source§

impl BlockCipher for Simon128_192

Source§

impl BlockCipher for Simon128_256

Source§

impl BlockCipher for Sm4

Source§

impl BlockCipher for Sm4Ct

Source§

impl BlockCipher for Speck32_64

Source§

impl BlockCipher for Speck48_72

Source§

impl BlockCipher for Speck48_96

Source§

impl BlockCipher for Speck64_96

Source§

impl BlockCipher for Speck64_128

Source§

impl BlockCipher for Speck96_96

Source§

impl BlockCipher for Speck96_144

Source§

impl BlockCipher for Speck128_128

Source§

impl BlockCipher for Speck128_192

Source§

impl BlockCipher for Speck128_256

Source§

impl BlockCipher for Twofish128

Source§

impl BlockCipher for Twofish128Ct

Source§

impl BlockCipher for Twofish192

Source§

impl BlockCipher for Twofish192Ct

Source§

impl BlockCipher for Twofish256

Source§

impl BlockCipher for Twofish256Ct