pub struct Eax<Cipher, M = U16> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize, { /* private fields */ }
Expand description
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
sourceimpl<Cipher, M> AeadCore for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
impl<Cipher, M> AeadCore for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
type NonceSize = <Cipher as BlockCipher>::BlockSize
type NonceSize = <Cipher as BlockCipher>::BlockSize
The length of a nonce.
type TagSize = M
type TagSize = M
The maximum length of the nonce.
type CiphertextOverhead = UTerm
type CiphertextOverhead = UTerm
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
sourceimpl<Cipher, M> AeadInPlace for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
impl<Cipher, M> AeadInPlace for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
sourcefn encrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag<M>, Error>
fn encrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag<M>, Error>
Encrypt the data in-place, returning the authentication tag
sourcefn decrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag<M>
) -> Result<(), Error>
fn decrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag<M>
) -> Result<(), Error>
Decrypt the message in-place, returning an error in the event the provided authentication tag does not match the given ciphertext (i.e. ciphertext is modified/unauthentic) Read more
sourceimpl<Cipher: Clone, M: Clone> Clone for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
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,
sourceimpl<Cipher, M> KeyInit for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
impl<Cipher, M> KeyInit for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
sourcefn new(key: &BlockCipherKey<Cipher>) -> Self
fn new(key: &BlockCipherKey<Cipher>) -> Self
Create new value from fixed size key.
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
Create new value from variable size key.
sourceimpl<Cipher, M> KeySizeUser for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
impl<Cipher, M> KeySizeUser for Eax<Cipher, M> where
Cipher: BlockCipher<BlockSize = U16> + BlockEncrypt + NewBlockCipher + Clone,
Cipher::ParBlocks: ArrayLength<Block<Cipher>>,
M: TagSize,
type KeySize = <Cipher as NewBlockCipher>::KeySize
type KeySize = <Cipher as NewBlockCipher>::KeySize
Key size in bytes.
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> Send for Eax<Cipher, M> where
M: Send,
impl<Cipher, M> Sync for Eax<Cipher, M> where
M: Sync,
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,
Blanket Implementations
sourceimpl<Alg> Aead for Alg where
Alg: AeadInPlace,
impl<Alg> Aead for Alg where
Alg: AeadInPlace,
sourceimpl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
impl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
sourceimpl<Alg> AeadMutInPlace for Alg where
Alg: AeadInPlace,
impl<Alg> AeadMutInPlace for Alg where
Alg: AeadInPlace,
sourcefn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
fn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
Encrypt the given buffer containing a plaintext message in-place. Read more
sourcefn 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>
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>
Encrypt the data in-place, returning the authentication tag
sourcefn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
Decrypt the message in-place, returning an error in the event the provided authentication tag does not match the given ciphertext. Read more
sourcefn 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>
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>
Decrypt the data in-place, returning an error in the event the provided authentication tag does not match the given ciphertext (i.e. ciphertext is modified/unauthentic) Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more