Skip to main content

AeadEncryptOperation

Trait AeadEncryptOperation 

Source
pub trait AeadEncryptOperation<'a, A: AeadAlgorithm>: Operation<Vec<u8>> {
    // Required methods
    fn with_nonce(self, nonce: &'a Nonce<12>) -> Self;
    fn with_aad(self, aad: &'a [u8]) -> Self;
    fn encrypt(self, plaintext: &'a [u8]) -> Result<Vec<u8>>;
}
Expand description

Trait for encryption operations with AEAD algorithms

Required Methods§

Source

fn with_nonce(self, nonce: &'a Nonce<12>) -> Self

Set the nonce for encryption

Source

fn with_aad(self, aad: &'a [u8]) -> Self

Set associated data for authenticated encryption

Source

fn encrypt(self, plaintext: &'a [u8]) -> Result<Vec<u8>>

Set plaintext and execute encryption

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<'a> AeadEncryptOperation<'a, ChaCha20Poly1305Algorithm> for ChaCha20Poly1305EncryptOperation<'a>

Available on crate feature alloc only.