pub struct Aes128Gcm(/* private fields */);Expand description
AES-128 in Galois Counter Mode.
Implementations§
Trait Implementations§
Source§impl Aead for Aes128Gcm
impl Aead for Aes128Gcm
Source§type Tag = [u8; 16]
type Tag = [u8; 16]
The type of tags produced by this AEAD. Generally a u8 array of fixed
length.
Source§type Nonce = [u8; 12]
type Nonce = [u8; 12]
The type of nonces used by this AEAD. Generally a u8 array of fixed
length.
Source§fn seal(&self, nonce: &Self::Nonce, plaintext: &[u8], ad: &[u8]) -> Vec<u8>
fn seal(&self, nonce: &Self::Nonce, plaintext: &[u8], ad: &[u8]) -> Vec<u8>
Encrypt and authenticate
plaintext, and authenticate ad, returning
the result as a freshly allocated Vec. The nonce must never
be used in any sealing operation with the same key, ever again.Source§fn seal_in_place(
&self,
nonce: &Self::Nonce,
plaintext: &mut [u8],
ad: &[u8],
) -> Self::Tag
fn seal_in_place( &self, nonce: &Self::Nonce, plaintext: &mut [u8], ad: &[u8], ) -> Self::Tag
Encrypt and authenticate
plaintext, and authenticate ad, writing
the ciphertext over plaintext and additionally returning the calculated
tag, which is usually appended to the ciphertext. The nonce must never
be used in any sealing operation with the same key, ever again.Source§fn open(
&self,
nonce: &Self::Nonce,
ciphertext: &[u8],
ad: &[u8],
) -> Option<Vec<u8>>
fn open( &self, nonce: &Self::Nonce, ciphertext: &[u8], ad: &[u8], ) -> Option<Vec<u8>>
Authenticate
ciphertext and ad and, if valid, decrypt ciphertext,
returning the original plaintext in a newly allocated Vec. The nonce
must be the same value as given to the sealing operation that produced
ciphertext.Source§fn open_in_place(
&self,
nonce: &Self::Nonce,
ciphertext: &mut [u8],
tag: &Self::Tag,
ad: &[u8],
) -> Result<(), InvalidCiphertext>
fn open_in_place( &self, nonce: &Self::Nonce, ciphertext: &mut [u8], tag: &Self::Tag, ad: &[u8], ) -> Result<(), InvalidCiphertext>
Authenticate
ciphertext and ad using tag and, if valid, decrypt
ciphertext in place. The nonce must be the same value as given to
the sealing operation that produced ciphertext.Auto Trait Implementations§
impl Freeze for Aes128Gcm
impl RefUnwindSafe for Aes128Gcm
impl !Send for Aes128Gcm
impl !Sync for Aes128Gcm
impl Unpin for Aes128Gcm
impl UnsafeUnpin for Aes128Gcm
impl UnwindSafe for Aes128Gcm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more