#[cfg(feature = "alloc")]
use alloc::vec::Vec;
use rand_core::{CryptoRng, TryCryptoRng};
use crate::errors::Result;
pub trait RandomizedEncryptor {
fn encrypt_with_rng_into<'a, R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[u8],
storage: &'a mut [u8],
) -> Result<&'a [u8]>;
#[cfg(feature = "alloc")]
fn encrypt_with_rng<R: CryptoRng + ?Sized>(&self, rng: &mut R, msg: &[u8]) -> Result<Vec<u8>>;
}
pub trait Decryptor {
#[cfg(feature = "alloc")]
fn decrypt(&self, ciphertext: &[u8]) -> Result<Vec<u8>>;
}
pub trait RandomizedDecryptor {
#[cfg(feature = "alloc")]
fn decrypt_with_rng<R: CryptoRng + ?Sized>(
&self,
rng: &mut R,
ciphertext: &[u8],
) -> Result<Vec<u8>>;
}
pub trait EncryptingKeypair {
type EncryptingKey: Clone;
fn encrypting_key(&self) -> Self::EncryptingKey;
}