chacha20poly1305

Type Alias ChaCha20Poly1305

Source
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>,

Source§

type NonceSize = N

The length of a nonce.
Source§

type TagSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>

The maximum length of the nonce.
Source§

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>

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>,

Source§

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>

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<C, N> Clone for ChaChaPoly1305<C, N>
where N: ArrayLength<u8>,

Source§

fn clone(&self) -> Self

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<C, N> Drop for ChaChaPoly1305<C, N>
where N: ArrayLength<u8>,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<C, N> KeyInit for ChaChaPoly1305<C, N>
where N: ArrayLength<u8>,

Source§

fn new(key: &Key) -> Self

Create new value from fixed size key.
Source§

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>

Generate random key using the provided CryptoRng.
Source§

impl<C, N> KeySizeUser for ChaChaPoly1305<C, N>
where N: ArrayLength<u8>,

Source§

type KeySize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>

Key size in bytes.
Source§

fn key_size() -> usize

Return key size in bytes.
Source§

impl<C, N: ArrayLength<u8>> ZeroizeOnDrop for ChaChaPoly1305<C, N>