pub type ChaCha20Poly1305 = ChaChaPoly1305<ChaCha20, U12>;
Expand description
ChaCha20Poly1305 Authenticated Encryption with Additional Data (AEAD).
Aliased Type§
struct ChaCha20Poly1305 { /* private fields */ }
Trait Implementations
Source§impl<C, N> AeadCore for ChaChaPoly1305<C, N>where
N: ArrayLength<u8>,
impl<C, N> AeadCore for ChaChaPoly1305<C, N>where
N: ArrayLength<u8>,
Source§type TagSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>
type TagSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>
The maximum length of the nonce.
Source§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<C, N> AeadInPlace for ChaChaPoly1305<C, N>where
C: KeyIvInit<KeySize = U32, IvSize = N> + StreamCipher + StreamCipherSeek,
N: ArrayLength<u8>,
impl<C, N> AeadInPlace for ChaChaPoly1305<C, N>where
C: KeyIvInit<KeySize = U32, IvSize = N> + StreamCipher + StreamCipherSeek,
N: ArrayLength<u8>,
Source§fn encrypt_in_place_detached(
&self,
nonce: &Nonce<Self>,
associated_data: &[u8],
buffer: &mut [u8],
) -> Result<Tag, Error>
fn encrypt_in_place_detached( &self, nonce: &Nonce<Self>, associated_data: &[u8], buffer: &mut [u8], ) -> Result<Tag, Error>
Encrypt the data in-place, returning the authentication tag
Source§fn decrypt_in_place_detached(
&self,
nonce: &Nonce<Self>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag,
) -> Result<(), Error>
fn decrypt_in_place_detached( &self, nonce: &Nonce<Self>, associated_data: &[u8], buffer: &mut [u8], tag: &Tag, ) -> 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<C, N> Clone for ChaChaPoly1305<C, N>where
N: ArrayLength<u8>,
impl<C, N> Clone for ChaChaPoly1305<C, N>where
N: ArrayLength<u8>,
Source§impl<C, N> Drop for ChaChaPoly1305<C, N>where
N: ArrayLength<u8>,
impl<C, N> Drop for ChaChaPoly1305<C, N>where
N: ArrayLength<u8>,
Source§impl<C, N> KeyInit for ChaChaPoly1305<C, N>where
N: ArrayLength<u8>,
impl<C, N> KeyInit for ChaChaPoly1305<C, N>where
N: ArrayLength<u8>,
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
.