pub trait Aead {
type Tag;
// Required methods
fn encrypt_in_place(
&self,
nonce: &[u8],
aad: &[u8],
data: &mut [u8],
) -> Self::Tag;
fn decrypt_in_place(
&self,
nonce: &[u8],
aad: &[u8],
data: &mut [u8],
tag: &Self::Tag,
) -> bool;
// Provided methods
fn encrypt(
&self,
nonce: &[u8],
aad: &[u8],
plaintext: &[u8],
) -> (Vec<u8>, Self::Tag) { ... }
fn decrypt(
&self,
nonce: &[u8],
aad: &[u8],
ciphertext: &[u8],
tag: &Self::Tag,
) -> Option<Vec<u8>> { ... }
}Expand description
Common interface for AEAD constructions with detached tags.