Skip to main content

AeadOperations

Trait AeadOperations 

Source
pub trait AeadOperations {
    // Required methods
    fn encrypt(
        &self,
        algorithm: Algorithm,
        key: &AeadKey,
        nonce: &Nonce,
        plaintext: &[u8],
        associated_data: Option<&[u8]>,
    ) -> Result<Vec<u8>>;
    fn decrypt(
        &self,
        algorithm: Algorithm,
        key: &AeadKey,
        nonce: &Nonce,
        ciphertext: &[u8],
        associated_data: Option<&[u8]>,
    ) -> Result<Vec<u8>>;
}
Expand description

AEAD operations (Layer A — Result only)

This trait mirrors crate::traits::Aead at the algorithm-dispatch boundary: decrypt returns Result only. Semantic decrypt (crate::AeadDecryptSemantic, crate::DecryptSemanticOutcome) is not part of this object-safe surface; use a concrete AEAD type when Layer B is required. See docs/adr/003-aead-decrypt-layers.md.

Required Methods§

Source

fn encrypt( &self, algorithm: Algorithm, key: &AeadKey, nonce: &Nonce, plaintext: &[u8], associated_data: Option<&[u8]>, ) -> Result<Vec<u8>>

Source

fn decrypt( &self, algorithm: Algorithm, key: &AeadKey, nonce: &Nonce, ciphertext: &[u8], associated_data: Option<&[u8]>, ) -> Result<Vec<u8>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl AeadOperations for LibQAeadStubProvider

Available on crate feature alloc only.