Struct eax::Eax [−][src]
pub struct Eax<Cipher, M = U16> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize, { /* fields omitted */ }
EAX: generic over an underlying block cipher implementation.
This type is generic to support substituting alternative cipher implementations.
If in doubt, use the built-in [Aes128Eax
] and [Aes256Eax
] type aliases.
Type parameters:
Cipher
: block cipher.M
: size of MAC tag, valid values: up toU16
.
Trait Implementations
impl<Cipher, M> AeadCore for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
[src]
impl<Cipher, M> AeadCore for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
[src]type NonceSize = Cipher::BlockSize
The length of a nonce.
type TagSize = M
The maximum length of the nonce.
type CiphertextOverhead = U0
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
impl<Cipher, M> AeadInPlace for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
[src]
impl<Cipher, M> AeadInPlace for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
[src]fn encrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag<M>, Error>
[src]
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag<M>, Error>
fn decrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag<M>
) -> Result<(), Error>
[src]
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag<M>
) -> Result<(), Error>
pub fn encrypt_in_place(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
pub fn decrypt_in_place(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
impl<Cipher: Clone, M: Clone> Clone for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
[src]
impl<Cipher: Clone, M: Clone> Clone for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
[src]impl<Cipher, M> NewAead for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
[src]
impl<Cipher, M> NewAead for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
[src]Auto Trait Implementations
impl<Cipher, M> RefUnwindSafe for Eax<Cipher, M> where
M: RefUnwindSafe,
<<Cipher as NewBlockCipher>::KeySize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
impl<Cipher, M> RefUnwindSafe for Eax<Cipher, M> where
M: RefUnwindSafe,
<<Cipher as NewBlockCipher>::KeySize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
impl<Cipher, M> Unpin for Eax<Cipher, M> where
M: Unpin,
<<Cipher as NewBlockCipher>::KeySize as ArrayLength<u8>>::ArrayType: Unpin,
impl<Cipher, M> Unpin for Eax<Cipher, M> where
M: Unpin,
<<Cipher as NewBlockCipher>::KeySize as ArrayLength<u8>>::ArrayType: Unpin,
impl<Cipher, M> UnwindSafe for Eax<Cipher, M> where
M: UnwindSafe,
<<Cipher as NewBlockCipher>::KeySize as ArrayLength<u8>>::ArrayType: UnwindSafe,
impl<Cipher, M> UnwindSafe for Eax<Cipher, M> where
M: UnwindSafe,
<<Cipher as NewBlockCipher>::KeySize as ArrayLength<u8>>::ArrayType: UnwindSafe,
Blanket Implementations
impl<Alg> Aead for Alg where
Alg: AeadInPlace,
[src]
impl<Alg> Aead for Alg where
Alg: AeadInPlace,
[src]pub fn encrypt<'msg, 'aad>(
&self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8, Global>, Error>
[src]
&self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8, Global>, Error>
pub fn decrypt<'msg, 'aad>(
&self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8, Global>, Error>
[src]
&self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8, Global>, Error>
impl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
[src]
impl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
[src]pub fn encrypt<'msg, 'aad>(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8, Global>, Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8, Global>, Error>
pub fn decrypt<'msg, 'aad>(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8, Global>, Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8, Global>, Error>
impl<Alg> AeadMutInPlace for Alg where
Alg: AeadInPlace,
[src]
impl<Alg> AeadMutInPlace for Alg where
Alg: AeadInPlace,
[src]pub fn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
pub fn encrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Alg as AeadCore>::TagSize>, Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Alg as AeadCore>::TagSize>, Error>
pub fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
pub fn decrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Alg as AeadCore>::TagSize>
) -> Result<(), Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Alg as AeadCore>::TagSize>
) -> Result<(), Error>
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self