pub type Aes128Gcm = AesGcm<Aes128, U12>;
Expand description
AES-GCM with a 128-bit key and 96-bit nonce.
Aliased Type§
struct Aes128Gcm { /* private fields */ }
Trait Implementations
source§impl<Aes, NonceSize, TagSize> AeadCore for AesGcm<Aes, NonceSize, TagSize>
impl<Aes, NonceSize, TagSize> AeadCore for AesGcm<Aes, NonceSize, TagSize>
§type CiphertextOverhead = UTerm
type CiphertextOverhead = UTerm
The upper bound amount of additional space required to support a
ciphertext vs. a plaintext.
source§fn generate_nonce(
rng: impl CryptoRng + RngCore,
) -> GenericArray<u8, Self::NonceSize>
fn generate_nonce( rng: impl CryptoRng + RngCore, ) -> GenericArray<u8, Self::NonceSize>
Generate a random nonce for this AEAD algorithm. Read more
source§impl<Aes, NonceSize, TagSize> AeadInPlace for AesGcm<Aes, NonceSize, TagSize>where
Aes: BlockCipher + BlockSizeUser<BlockSize = U16> + BlockEncrypt,
NonceSize: ArrayLength<u8>,
TagSize: TagSize,
impl<Aes, NonceSize, TagSize> AeadInPlace for AesGcm<Aes, NonceSize, TagSize>where
Aes: BlockCipher + BlockSizeUser<BlockSize = U16> + BlockEncrypt,
NonceSize: ArrayLength<u8>,
TagSize: TagSize,
source§fn encrypt_in_place_detached(
&self,
nonce: &Nonce<NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
) -> Result<Tag<TagSize>, Error>
fn encrypt_in_place_detached( &self, nonce: &Nonce<NonceSize>, associated_data: &[u8], buffer: &mut [u8], ) -> Result<Tag<TagSize>, Error>
Encrypt the data in-place, returning the authentication tag
source§fn decrypt_in_place_detached(
&self,
nonce: &Nonce<NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag<TagSize>,
) -> Result<(), Error>
fn decrypt_in_place_detached( &self, nonce: &Nonce<NonceSize>, associated_data: &[u8], buffer: &mut [u8], tag: &Tag<TagSize>, ) -> 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)
source§impl<Aes, NonceSize, TagSize> KeyInit for AesGcm<Aes, NonceSize, TagSize>
impl<Aes, NonceSize, TagSize> KeyInit for AesGcm<Aes, NonceSize, TagSize>
source§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.
source§fn generate_key(
rng: impl CryptoRng + RngCore,
) -> GenericArray<u8, Self::KeySize>
fn generate_key( rng: impl CryptoRng + RngCore, ) -> GenericArray<u8, Self::KeySize>
Generate random key using the provided
CryptoRng
.