pub trait Cipher: Send + Sync {
// Required methods
fn encrypt_page(
&self,
nonce: &[u8; 12],
plaintext: &[u8],
) -> Result<Vec<u8>>;
fn decrypt_page(
&self,
nonce: &[u8; 12],
ciphertext: &[u8],
) -> Result<Vec<u8>>;
// Provided methods
fn encrypt_page_with_aad(
&self,
nonce: &[u8; 12],
plaintext: &[u8],
aad: &[u8],
) -> Result<Vec<u8>> { ... }
fn decrypt_page_with_aad(
&self,
nonce: &[u8; 12],
ciphertext: &[u8],
aad: &[u8],
) -> Result<Vec<u8>> { ... }
}Expand description
Symmetric page cipher.
Required Methods§
Provided Methods§
fn encrypt_page_with_aad( &self, nonce: &[u8; 12], plaintext: &[u8], aad: &[u8], ) -> Result<Vec<u8>>
fn decrypt_page_with_aad( &self, nonce: &[u8; 12], ciphertext: &[u8], aad: &[u8], ) -> Result<Vec<u8>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".