[−][src]Struct aes_gcm::AesGcm
AES-GCM: generic over an underlying AES implementation and nonce size.
This type is generic to support substuting 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<B, N> Aead for AesGcm<B, N> where
B: BlockCipher<BlockSize = U16>,
B::ParBlocks: ArrayLength<GenericArray<u8, B::BlockSize>>,
N: ArrayLength<u8>,
[src]
B: BlockCipher<BlockSize = U16>,
B::ParBlocks: ArrayLength<GenericArray<u8, B::BlockSize>>,
N: ArrayLength<u8>,
type NonceSize = N
The length of a nonce.
type TagSize = U16
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
fn encrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, N>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag, Error>
[src]
&self,
nonce: &GenericArray<u8, N>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag, Error>
fn decrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, N>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag
) -> Result<(), Error>
[src]
&self,
nonce: &GenericArray<u8, N>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag
) -> Result<(), Error>
fn encrypt<'msg, 'aad>(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
fn encrypt_in_place(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
fn decrypt<'msg, 'aad>(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
fn decrypt_in_place(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
impl<B: Clone, N: Clone> Clone for AesGcm<B, N> where
B: BlockCipher<BlockSize = U16>,
B::ParBlocks: ArrayLength<GenericArray<u8, B::BlockSize>>,
N: ArrayLength<u8>,
[src]
B: BlockCipher<BlockSize = U16>,
B::ParBlocks: ArrayLength<GenericArray<u8, B::BlockSize>>,
N: ArrayLength<u8>,
fn clone(&self) -> AesGcm<B, N>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<B, N> From<B> for AesGcm<B, N> where
B: BlockCipher<BlockSize = U16>,
B::ParBlocks: ArrayLength<GenericArray<u8, B::BlockSize>>,
N: ArrayLength<u8>,
[src]
B: BlockCipher<BlockSize = U16>,
B::ParBlocks: ArrayLength<GenericArray<u8, B::BlockSize>>,
N: ArrayLength<u8>,
impl<B, N> NewAead for AesGcm<B, N> where
B: BlockCipher<BlockSize = U16>,
B::ParBlocks: ArrayLength<GenericArray<u8, B::BlockSize>>,
N: ArrayLength<u8>,
[src]
B: BlockCipher<BlockSize = U16>,
B::ParBlocks: ArrayLength<GenericArray<u8, B::BlockSize>>,
N: ArrayLength<u8>,
Auto Trait Implementations
impl<B, N> Send for AesGcm<B, N> where
B: Send,
N: Send,
B: Send,
N: Send,
impl<B, N> Sync for AesGcm<B, N> where
B: Sync,
N: Sync,
B: Sync,
N: Sync,
impl<B, N> Unpin for AesGcm<B, N> where
B: Unpin,
N: Unpin,
B: Unpin,
N: Unpin,
Blanket Implementations
impl<Algo> AeadMut for Algo where
Algo: Aead,
[src]
Algo: Aead,
type NonceSize = <Algo as Aead>::NonceSize
The length of a nonce.
type TagSize = <Algo as Aead>::TagSize
The maximum length of the nonce.
type CiphertextOverhead = <Algo as Aead>::CiphertextOverhead
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
fn encrypt<'msg, 'aad>(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
plaintext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
Encrypt the given plaintext slice, and return the resulting ciphertext as a vector of bytes.
fn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
Encrypt the given buffer containing a plaintext message in-place.
fn encrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Algo as AeadMut>::TagSize>, Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Algo as AeadMut>::TagSize>, Error>
Encrypt the data in-place, returning the authentication tag
fn decrypt<'msg, 'aad>(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
ciphertext: impl Into<Payload<'msg, 'aad>>
) -> Result<Vec<u8>, Error>
Decrypt the given ciphertext slice, and return the resulting plaintext as a vector of bytes.
fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::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.
fn decrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Algo as AeadMut>::TagSize>
) -> Result<(), Error>
[src]
&mut self,
nonce: &GenericArray<u8, <Algo as AeadMut>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Algo as AeadMut>::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)
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,