Trait askar_crypto::encrypt::KeyAeadInPlace [−][src]
pub trait KeyAeadInPlace {
fn encrypt_in_place(
&self,
buffer: &mut dyn ResizeBuffer,
nonce: &[u8],
aad: &[u8]
) -> Result<usize, Error>;
fn decrypt_in_place(
&self,
buffer: &mut dyn ResizeBuffer,
nonce: &[u8],
aad: &[u8]
) -> Result<(), Error>;
fn aead_params(&self) -> KeyAeadParams;
fn aead_padding(&self, _msg_len: usize) -> usize { ... }
}Expand description
Object-safe trait for key types which perform AEAD encryption
Required methods
Encrypt a secret value in place, appending the verification tag and returning the length of the ciphertext
Decrypt an encrypted (verification tag appended) value in place
fn aead_params(&self) -> KeyAeadParams
fn aead_params(&self) -> KeyAeadParams
Get the nonce and tag length for encryption
Provided methods
fn aead_padding(&self, _msg_len: usize) -> usize
fn aead_padding(&self, _msg_len: usize) -> usize
Get the ciphertext padding required
Implementors
impl<C> KeyAeadInPlace for AesKey<AesKeyWrap<C>> where
AesKeyWrap<C>: AesType,
C: NewBlockCipher<KeySize = <AesKeyWrap<C> as AesType>::KeySize> + BlockCipher<BlockSize = U16>,
This is supported on crate feature
aes only.impl<C, D> KeyAeadInPlace for AesKey<AesCbcHmac<C, D>> where
AesCbcHmac<C, D>: AesType,
C: BlockCipher + NewBlockCipher,
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
C::KeySize: Shl<B1>,
<C::KeySize as Shl<B1>>::Output: ArrayLength<u8>,
This is supported on crate feature
aes only.impl<T> KeyAeadInPlace for AesKey<T> where
T: NewAead + AeadInPlace + AesType<KeySize = <T as NewAead>::KeySize>,
This is supported on crate feature
aes only.impl<T: Chacha20Type> KeyAeadInPlace for Chacha20Key<T>
This is supported on crate feature
chacha only.