Skip to main content

EncryptOperation

Trait EncryptOperation 

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

Base trait for encryption operations

Required Methods§

Source

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

Set plaintext and execute encryption

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<'a, B> EncryptOperation<'a, Gcm<B>> for GcmEncryptOperation<'a, B>

Source§

fn with_nonce( self, nonce: &'a <Gcm<B> as SymmetricCipher>::Nonce, ) -> GcmEncryptOperation<'a, B>

Source§

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

Source§

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

Source§

impl<'a> EncryptOperation<'a, ChaCha20Poly1305> for ChaCha20Poly1305EncryptOperation<'a>

Implementors§