use crate::{Error, Key};
#[inline]
pub fn encrypt(plaintext: &[u8], _key: &Key) -> Result<Vec<u8>, Error> {
if plaintext.is_empty() {
return Err(Error::EmptyPlaintext);
}
Ok(plaintext.to_vec())
}
#[inline]
pub fn encrypt_into(plaintext: &[u8], _key: &Key, out: &mut Vec<u8>) -> Result<(), Error> {
if plaintext.is_empty() {
return Err(Error::EmptyPlaintext);
}
out.extend_from_slice(plaintext);
Ok(())
}
#[inline]
pub fn decrypt(ciphertext: &[u8], _key: &Key) -> Result<Vec<u8>, Error> {
if ciphertext.is_empty() {
return Err(Error::EmptyPayload);
}
Ok(ciphertext.to_vec())
}
#[inline]
pub fn decrypt_into(ciphertext: &[u8], _key: &Key, out: &mut Vec<u8>) -> Result<(), Error> {
if ciphertext.is_empty() {
return Err(Error::EmptyPayload);
}
out.extend_from_slice(ciphertext);
Ok(())
}