Skip to main content

AeadCipher

Trait AeadCipher 

Source
pub trait AeadCipher: Send {
    // Required methods
    fn tag_len(&self) -> usize;
    fn seal_in_place(
        &mut self,
        nonce: &[u8],
        aad: &[u8],
        plaintext_and_ciphertext: &mut [u8],
        tag_out: &mut [u8],
    ) -> Result<(), CryptoError>;
    fn open_in_place(
        &mut self,
        nonce: &[u8],
        aad: &[u8],
        ciphertext_and_plaintext: &mut [u8],
        tag: &[u8],
    ) -> Result<(), CryptoError>;
}
Expand description

A keyed authenticated cipher with detached tags.

Required Methods§

Source

fn tag_len(&self) -> usize

Returns the detached tag length in bytes.

Source

fn seal_in_place( &mut self, nonce: &[u8], aad: &[u8], plaintext_and_ciphertext: &mut [u8], tag_out: &mut [u8], ) -> Result<(), CryptoError>

Encrypts and authenticates a caller-owned buffer.

Source

fn open_in_place( &mut self, nonce: &[u8], aad: &[u8], ciphertext_and_plaintext: &mut [u8], tag: &[u8], ) -> Result<(), CryptoError>

Authenticates and decrypts a caller-owned buffer.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§