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§
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> ⓘ
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.