Trait Cipher

Source
pub trait Cipher {
    type KeyBytes;

    // Required methods
    fn from_key_array(key: &Self::KeyBytes) -> Self;
    fn encrypt_with_iv(&self, iv: &Self::KeyBytes, input: &[u8]) -> Vec<u8> ;
    fn decrypt_with_iv(&self, iv: &Self::KeyBytes, input: &[u8]) -> Vec<u8> ;
}
Expand description

The trait for symmetric cipher.

Required Associated Types§

Required Methods§

Source

fn from_key_array(key: &Self::KeyBytes) -> Self

Source

fn encrypt_with_iv(&self, iv: &Self::KeyBytes, input: &[u8]) -> Vec<u8>

Source

fn decrypt_with_iv(&self, iv: &Self::KeyBytes, input: &[u8]) -> Vec<u8>

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<const BYTES: usize> Cipher for Aes<BYTES>