Skip to main content

ChunkEncrypt

Trait ChunkEncrypt 

Source
pub trait ChunkEncrypt {
    type Encrypted;

    // Required method
    fn encrypt_with(&self, key: &EncryptionKey) -> Result<Self::Encrypted>;

    // Provided method
    fn encrypt(&self) -> Result<Self::Encrypted> { ... }
}
Expand description

Trait for encrypting chunks with a Keccak-256 counter-mode cipher.

Required Associated Types§

Source

type Encrypted

The encrypted output type.

Required Methods§

Source

fn encrypt_with(&self, key: &EncryptionKey) -> Result<Self::Encrypted>

Encrypt with a caller-provided key.

Provided Methods§

Source

fn encrypt(&self) -> Result<Self::Encrypted>

Encrypt with a randomly generated key.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<const BODY_SIZE: usize> ChunkEncrypt for ContentChunk<BODY_SIZE>

Available on crate feature encryption only.