Skip to main content

EncryptOperation

Trait EncryptOperation 

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

Base trait for encryption operations

Required Methods§

Source

fn with_nonce(self, nonce: &'a C::Nonce) -> 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<C::Ciphertext>

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§