pub trait Cipher: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn set(&mut self, key: &[u8]);
fn encrypt(
&self,
nonce: u64,
authtext: &[u8],
plaintext: &[u8],
out: &mut [u8],
) -> usize;
fn decrypt(
&self,
nonce: u64,
authtext: &[u8],
ciphertext: &[u8],
out: &mut [u8],
) -> Result<usize, Error>;
// Provided method
fn rekey(&mut self) { ... }
}
Expand description
Cipher operations