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, Error>;
}
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, Error>

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

Implementations on Foreign Types§

Source§

impl AeadDecryptSemantic for DuplexSpongeAead

Source§

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

Source§

impl AeadDecryptSemantic for RomulusMAead

Source§

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

Source§

impl AeadDecryptSemantic for RomulusNAead

Source§

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

Source§

impl AeadDecryptSemantic for SaturninAead

Source§

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

Source§

impl AeadDecryptSemantic for Shake256Aead

Source§

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

Source§

impl AeadDecryptSemantic for TweakAead

Source§

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

Source§

impl AeadDecryptSemantic for DuplexSpongeAead

Available on crate feature alloc only.
Source§

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

Source§

impl AeadDecryptSemantic for RomulusMAead

Source§

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

Source§

impl AeadDecryptSemantic for RomulusNAead

Source§

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

Source§

impl AeadDecryptSemantic for SaturninAead

Source§

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

Layer B semantic decrypt; see docs/adr/003-aead-decrypt-layers.md.

Source§

impl AeadDecryptSemantic for TweakAead

Available on crate feature alloc only.
Source§

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

Implementors§