pub trait AeadMut: AeadCore {
// Required methods
fn encrypt<'msg, 'aad>(
&mut self,
nonce: &Nonce<Self>,
plaintext: impl Into<Payload<'msg, 'aad>>,
) -> Result<Vec<u8>>;
fn decrypt<'msg, 'aad>(
&mut self,
nonce: &Nonce<Self>,
ciphertext: impl Into<Payload<'msg, 'aad>>,
) -> Result<Vec<u8>>;
}
Expand description
Stateful Authenticated Encryption with Associated Data algorithm.
Required Methods§
Sourcefn encrypt<'msg, 'aad>(
&mut self,
nonce: &Nonce<Self>,
plaintext: impl Into<Payload<'msg, 'aad>>,
) -> Result<Vec<u8>>
fn encrypt<'msg, 'aad>( &mut self, nonce: &Nonce<Self>, plaintext: impl Into<Payload<'msg, 'aad>>, ) -> Result<Vec<u8>>
Encrypt the given plaintext slice, and return the resulting ciphertext as a vector of bytes.
See notes on Aead::encrypt()
about allowable message payloads and
Associated Additional Data (AAD).
Sourcefn decrypt<'msg, 'aad>(
&mut self,
nonce: &Nonce<Self>,
ciphertext: impl Into<Payload<'msg, 'aad>>,
) -> Result<Vec<u8>>
fn decrypt<'msg, 'aad>( &mut self, nonce: &Nonce<Self>, ciphertext: impl Into<Payload<'msg, 'aad>>, ) -> Result<Vec<u8>>
Decrypt the given ciphertext slice, and return the resulting plaintext as a vector of bytes.
See notes on Aead::encrypt()
and Aead::decrypt()
about allowable
message payloads and Associated Additional Data (AAD).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.