Type Alias aes_gcm::Aes256Gcm

source ·
pub type Aes256Gcm = AesGcm<Aes256, U12>;
Available on crate feature aes only.
Expand description

AES-GCM with a 256-bit key and 96-bit nonce.

Aliased Type§

struct Aes256Gcm { /* private fields */ }

Trait Implementations§

source§

impl<Aes, NonceSize, TagSize> AeadCore for AesGcm<Aes, NonceSize, TagSize>where NonceSize: ArrayLength<u8>, TagSize: TagSize,

§

type NonceSize = NonceSize

The length of a nonce.
§

type TagSize = TagSize

The maximum length of the nonce.
§

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>where GenericArray<u8, Self::NonceSize>: Default,

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,

source§

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>

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§

fn encrypt_in_place( &self, nonce: &GenericArray<u8, Self::NonceSize>, associated_data: &[u8], buffer: &mut dyn Buffer ) -> Result<(), Error>

Encrypt the given buffer containing a plaintext message in-place. Read more
source§

fn decrypt_in_place( &self, nonce: &GenericArray<u8, Self::NonceSize>, associated_data: &[u8], buffer: &mut dyn 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
source§

impl<Aes: Clone, NonceSize: Clone, TagSize> Clone for AesGcm<Aes, NonceSize, TagSize>where TagSize: TagSize + Clone,

source§

fn clone(&self) -> AesGcm<Aes, NonceSize, TagSize>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Aes, NonceSize, TagSize> From<Aes> for AesGcm<Aes, NonceSize, TagSize>where Aes: BlockSizeUser<BlockSize = U16> + BlockEncrypt, TagSize: TagSize,

source§

fn from(cipher: Aes) -> Self

Converts to this type from the input type.
source§

impl<Aes, NonceSize, TagSize> KeyInit for AesGcm<Aes, NonceSize, TagSize>where Aes: BlockSizeUser<BlockSize = U16> + BlockEncrypt + KeyInit, TagSize: TagSize,

source§

fn new(key: &Key<Self>) -> Self

Create new value from fixed size key.
§

fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>

Create new value from variable size key.
§

fn generate_key( rng: impl CryptoRng + RngCore ) -> GenericArray<u8, Self::KeySize>

Generate random key using the provided CryptoRng.
source§

impl<Aes, NonceSize, TagSize> KeySizeUser for AesGcm<Aes, NonceSize, TagSize>where Aes: KeySizeUser, TagSize: TagSize,

§

type KeySize = <Aes as KeySizeUser>::KeySize

Key size in bytes.
§

fn key_size() -> usize

Return key size in bytes.