Struct chacha20poly1305::ChaChaPoly1305
source · pub struct ChaChaPoly1305<C, N: ArrayLength<u8> = U12>where
C: NewCipher<KeySize = U32, NonceSize = N> + StreamCipher + StreamCipherSeek,{ /* private fields */ }
Expand description
Generic ChaCha+Poly1305 Authenticated Encryption with Additional Data (AEAD) construction.
See the toplevel documentation for a usage example.
Trait Implementations§
source§impl<C, N> AeadCore for ChaChaPoly1305<C, N>where
C: NewCipher<KeySize = U32, NonceSize = N> + StreamCipher + StreamCipherSeek,
N: ArrayLength<u8>,
impl<C, N> AeadCore for ChaChaPoly1305<C, N>where C: NewCipher<KeySize = U32, NonceSize = N> + StreamCipher + StreamCipherSeek, N: ArrayLength<u8>,
source§impl<C, N> AeadInPlace for ChaChaPoly1305<C, N>where
C: NewCipher<KeySize = U32, NonceSize = N> + StreamCipher + StreamCipherSeek,
N: ArrayLength<u8>,
impl<C, N> AeadInPlace for ChaChaPoly1305<C, N>where C: NewCipher<KeySize = U32, NonceSize = 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
C: NewCipher<KeySize = U32, NonceSize = N> + StreamCipher + StreamCipherSeek,
N: ArrayLength<u8>,
impl<C, N> Clone for ChaChaPoly1305<C, N>where C: NewCipher<KeySize = U32, NonceSize = N> + StreamCipher + StreamCipherSeek, N: ArrayLength<u8>,
source§impl<C, N> Drop for ChaChaPoly1305<C, N>where
C: NewCipher<KeySize = U32, NonceSize = N> + StreamCipher + StreamCipherSeek,
N: ArrayLength<u8>,
impl<C, N> Drop for ChaChaPoly1305<C, N>where C: NewCipher<KeySize = U32, NonceSize = N> + StreamCipher + StreamCipherSeek, N: ArrayLength<u8>,
Auto Trait Implementations§
impl<C, N> RefUnwindSafe for ChaChaPoly1305<C, N>where C: RefUnwindSafe,
impl<C, N> Send for ChaChaPoly1305<C, N>where C: Send,
impl<C, N> Sync for ChaChaPoly1305<C, N>where C: Sync,
impl<C, N> Unpin for ChaChaPoly1305<C, N>where C: Unpin,
impl<C, N> UnwindSafe for ChaChaPoly1305<C, N>where C: UnwindSafe,
Blanket Implementations§
source§impl<Alg> Aead for Algwhere
Alg: AeadInPlace,
impl<Alg> Aead for Algwhere Alg: AeadInPlace,
source§impl<Alg> AeadMut for Algwhere
Alg: AeadMutInPlace,
impl<Alg> AeadMut for Algwhere Alg: AeadMutInPlace,
source§impl<Alg> AeadMutInPlace for Algwhere
Alg: AeadInPlace,
impl<Alg> AeadMutInPlace for Algwhere Alg: AeadInPlace,
source§fn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
fn encrypt_in_place( &mut self, nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut impl Buffer ) -> Result<(), Error>
Encrypt the given buffer containing a plaintext message in-place. Read more
source§fn encrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Alg as AeadCore>::TagSize>, Error>
fn encrypt_in_place_detached( &mut self, nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut [u8] ) -> Result<GenericArray<u8, <Alg as AeadCore>::TagSize>, Error>
Encrypt the data in-place, returning the authentication tag
source§fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
fn decrypt_in_place( &mut self, nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut impl 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§fn decrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Alg as AeadCore>::TagSize>
) -> Result<(), Error>
fn decrypt_in_place_detached( &mut self, nonce: &GenericArray<u8, <Alg as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut [u8], tag: &GenericArray<u8, <Alg as AeadCore>::TagSize> ) -> Result<(), Error>
Decrypt the data 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<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