use crate::error::Result;
pub mod aes;
pub mod chacha;
pub trait Cipher {
type Key;
type Nonce;
fn encrypt(key: &Self::Key, nonce: &Self::Nonce, plaintext: &[u8]) -> Result<Vec<u8>>;
fn decrypt(key: &Self::Key, nonce: &Self::Nonce, ciphertext: &[u8]) -> Result<Vec<u8>>;
}
pub trait AuthenticatedCipher {
type Key;
type Nonce;
fn seal(key: &Self::Key, nonce: &Self::Nonce, plaintext: &[u8]) -> Result<Vec<u8>>;
fn open(key: &Self::Key, nonce: &Self::Nonce, ciphertext: &[u8]) -> Result<Vec<u8>>;
fn seal_with_aad(
key: &Self::Key,
nonce: &Self::Nonce,
plaintext: &[u8],
aad: &[u8],
) -> Result<Vec<u8>>;
fn open_with_aad(
key: &Self::Key,
nonce: &Self::Nonce,
ciphertext: &[u8],
aad: &[u8],
) -> Result<Vec<u8>>;
}