Skip to main content

AeadDecryptSemantic

Trait AeadDecryptSemantic 

Source
pub trait AeadDecryptSemantic: Aead {
    // Required method
    fn decrypt_semantic(
        &self,
        key: &AeadKey,
        nonce: &Nonce,
        ciphertext: &[u8],
        associated_data: Option<&[u8]>,
    ) -> Result<DecryptSemanticOutcome>;
}
Expand description

AEAD implementations that expose a semantic decrypt API (Layer B).

Implementors must also implement Aead. Operational errors (invalid sizes, keys, nonces, configuration) are returned as Err. Only post-decrypt authentication failure is reported as DecryptSemanticOutcome::AuthenticationFailed inside Ok.

This trait is separate from Aead so dyn AeadOperations and other object-safe surfaces can remain Result-only (crate::api::AeadOperations) without forcing every backend to expose semantic decrypt.

Required Methods§

Source

fn decrypt_semantic( &self, key: &AeadKey, nonce: &Nonce, ciphertext: &[u8], associated_data: Option<&[u8]>, ) -> Result<DecryptSemanticOutcome>

Decrypt and classify the outcome without overloading Result for auth failure.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§