Skip to main content

Cipher

Trait Cipher 

Source
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>>;
}
Expand description

Symmetric page cipher.

Required Methods§

Source

fn encrypt_page(&self, nonce: &[u8; 12], plaintext: &[u8]) -> Result<Vec<u8>>

Encrypt a page payload. nonce is the deterministic per-page nonce.

Source

fn decrypt_page(&self, nonce: &[u8; 12], ciphertext: &[u8]) -> Result<Vec<u8>>

Decrypt a page payload.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§