pub trait EncryptionAlgorithm: Send + Sync {
// Required methods
fn algorithm_id(&self) -> &'static str;
fn encrypt(&self, data: &[u8], key: &[u8]) -> Result<Vec<u8>>;
fn decrypt(&self, data: &[u8], key: &[u8]) -> Result<Vec<u8>>;
fn key_size(&self) -> usize;
fn nonce_size(&self) -> usize;
}Expand description
Trait for symmetric encryption algorithms
Required Methods§
Sourcefn algorithm_id(&self) -> &'static str
fn algorithm_id(&self) -> &'static str
Returns the unique identifier for this algorithm (e.g., “AES-256-GCM”)
Sourcefn nonce_size(&self) -> usize
fn nonce_size(&self) -> usize
Returns the nonce/IV size in bytes