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§
Sourcefn with_nonce(self, nonce: &'a <C as SymmetricCipher>::Nonce) -> Self
fn with_nonce(self, nonce: &'a <C as SymmetricCipher>::Nonce) -> Self
Set the nonce for encryption
Sourcefn encrypt(
self,
plaintext: &'a [u8],
) -> Result<<C as SymmetricCipher>::Ciphertext, Error>
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".