Struct aes_gcm::AesGcm [−][src]
pub struct AesGcm<Aes, NonceSize> where
Aes: BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>, { /* fields omitted */ }
Expand description
AES-GCM: generic over an underlying AES implementation and nonce size.
This type is generic to support substituting alternative AES implementations (e.g. embedded hardware implementations)
It is NOT intended to be instantiated with any block cipher besides AES! Doing so runs the risk of unintended cryptographic properties!
The N
generic parameter can be used to instantiate AES-GCM with other
nonce sizes, however it’s recommended to use it with typenum::U12
,
the default of 96-bits.
If in doubt, use the built-in Aes128Gcm
and Aes256Gcm
type aliases.
Trait Implementations
impl<Aes, NonceSize> AeadCore for AesGcm<Aes, NonceSize> where
Aes: NewBlockCipher + BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]
impl<Aes, NonceSize> AeadCore for AesGcm<Aes, NonceSize> where
Aes: NewBlockCipher + BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]type NonceSize = NonceSize
type NonceSize = NonceSize
The length of a nonce.
type TagSize = U16
type TagSize = U16
The maximum length of the nonce.
type CiphertextOverhead = U0
type CiphertextOverhead = U0
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
impl<Aes, NonceSize> AeadInPlace for AesGcm<Aes, NonceSize> where
Aes: NewBlockCipher + BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]
impl<Aes, NonceSize> AeadInPlace for AesGcm<Aes, NonceSize> where
Aes: NewBlockCipher + BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]fn encrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag, Error>
[src]
fn encrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag, Error>
[src]Encrypt the data in-place, returning the authentication tag
fn decrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag
) -> Result<(), Error>
[src]
fn decrypt_in_place_detached(
&self,
nonce: &Nonce<Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag
) -> Result<(), Error>
[src]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
impl<Aes: Clone, NonceSize: Clone> Clone for AesGcm<Aes, NonceSize> where
Aes: BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]
impl<Aes: Clone, NonceSize: Clone> Clone for AesGcm<Aes, NonceSize> where
Aes: BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]impl<Aes, NonceSize> From<Aes> for AesGcm<Aes, NonceSize> where
Aes: NewBlockCipher + BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]
impl<Aes, NonceSize> From<Aes> for AesGcm<Aes, NonceSize> where
Aes: NewBlockCipher + BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]impl<Aes, NonceSize> NewAead for AesGcm<Aes, NonceSize> where
Aes: NewBlockCipher + BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]
impl<Aes, NonceSize> NewAead for AesGcm<Aes, NonceSize> where
Aes: NewBlockCipher + BlockCipher<BlockSize = U16> + BlockEncrypt,
Aes::ParBlocks: ArrayLength<Block<Aes>>,
NonceSize: ArrayLength<u8>,
[src]Auto Trait Implementations
impl<Aes, NonceSize> RefUnwindSafe for AesGcm<Aes, NonceSize> where
Aes: RefUnwindSafe,
NonceSize: RefUnwindSafe,
Aes: RefUnwindSafe,
NonceSize: RefUnwindSafe,
impl<Aes, NonceSize> Send for AesGcm<Aes, NonceSize> where
Aes: Send,
NonceSize: Send,
Aes: Send,
NonceSize: Send,
impl<Aes, NonceSize> Sync for AesGcm<Aes, NonceSize> where
Aes: Sync,
NonceSize: Sync,
Aes: Sync,
NonceSize: Sync,
impl<Aes, NonceSize> Unpin for AesGcm<Aes, NonceSize> where
Aes: Unpin,
NonceSize: Unpin,
Aes: Unpin,
NonceSize: Unpin,
impl<Aes, NonceSize> UnwindSafe for AesGcm<Aes, NonceSize> where
Aes: UnwindSafe,
NonceSize: UnwindSafe,
Aes: UnwindSafe,
NonceSize: UnwindSafe,
Blanket Implementations
impl<Alg> Aead for Alg where
Alg: AeadInPlace,
[src]
impl<Alg> Aead for Alg where
Alg: AeadInPlace,
[src]impl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
[src]
impl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
[src]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]
pub fn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]Encrypt the given buffer containing a plaintext message in-place. Read more
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]
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]Encrypt the data in-place, returning the authentication tag
pub fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
pub fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]Decrypt the message in-place, returning an error in the event the provided authentication tag does not match the given ciphertext. Read more
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]
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]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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more