Skip to main content

Encryptor

Trait Encryptor 

Source
pub trait Encryptor:
    Send
    + Sync
    + Debug {
    // Required methods
    fn encrypt(&self, plaintext: &[u8], lsn: u64) -> Result<Vec<u8>>;
    fn decrypt(&self, ciphertext: &[u8], lsn: u64) -> Result<Vec<u8>>;
    fn encrypted_size(&self, plaintext_len: usize) -> usize;
    fn is_enabled(&self) -> bool;
}
Expand description

Trait for encryption operations (allows dynamic dispatch)

Required Methods§

Source

fn encrypt(&self, plaintext: &[u8], lsn: u64) -> Result<Vec<u8>>

Source

fn decrypt(&self, ciphertext: &[u8], lsn: u64) -> Result<Vec<u8>>

Source

fn encrypted_size(&self, plaintext_len: usize) -> usize

Source

fn is_enabled(&self) -> bool

Implementors§