[−][src]Trait aead::AeadMut
This is supported on
feature="alloc"
only.Stateful Authenticated Encryption with Associated Data algorithm.
Associated Types
type NonceSize: ArrayLength<u8>
This is supported on
feature="alloc"
only.The length of a nonce.
type TagSize: ArrayLength<u8>
This is supported on
feature="alloc"
only.The maximum length of the nonce.
type CiphertextOverhead: ArrayLength<u8> + Unsigned
This is supported on
feature="alloc"
only.The upper bound amount of additional space required to support a ciphertext vs. a plaintext.
Required methods
fn encrypt<'msg, 'aad>(
&mut self,
nonce: &Nonce<Self::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
&mut self,
nonce: &Nonce<Self::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
This is supported on
feature="alloc"
only.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).
fn decrypt<'msg, 'aad>(
&mut self,
nonce: &Nonce<Self::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
&mut self,
nonce: &Nonce<Self::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
This is supported on
feature="alloc"
only.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).
Implementors
impl<Alg: AeadMutInPlace> AeadMut for Alg
[src]
type NonceSize = Alg::NonceSize
This is supported on
feature="alloc"
only.type TagSize = Alg::TagSize
This is supported on
feature="alloc"
only.type CiphertextOverhead = Alg::CiphertextOverhead
This is supported on
feature="alloc"
only.fn encrypt<'msg, 'aad>(
&mut self,
nonce: &Nonce<Self::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&mut self,
nonce: &Nonce<Self::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
fn decrypt<'msg, 'aad>(
&mut self,
nonce: &Nonce<Self::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&mut self,
nonce: &Nonce<Self::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>