use anyhow::Result;
pub trait SyncEncryptor: Send + Sync {
fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>>;
fn decrypt(&self, ciphertext: &[u8]) -> Result<Vec<u8>>;
}
pub struct PassthroughEncryptor;
impl SyncEncryptor for PassthroughEncryptor {
fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>> {
Ok(plaintext.to_vec())
}
fn decrypt(&self, ciphertext: &[u8]) -> Result<Vec<u8>> {
Ok(ciphertext.to_vec())
}
}