Struct chacha20poly1305::ChaChaPoly1305
source · [−]pub struct ChaChaPoly1305<C> where
C: NewStreamCipher<KeySize = U32, NonceSize = U12> + SyncStreamCipher + SyncStreamCipherSeek, { /* private fields */ }
Expand description
Generic ChaCha+Poly1305 Authenticated Encryption with Additional Data (AEAD) construction.
See the toplevel documentation for a usage example.
Trait Implementations
sourceimpl<C> AeadInPlace for ChaChaPoly1305<C> where
C: NewStreamCipher<KeySize = U32, NonceSize = U12> + SyncStreamCipher + SyncStreamCipherSeek,
impl<C> AeadInPlace for ChaChaPoly1305<C> where
C: NewStreamCipher<KeySize = U32, NonceSize = U12> + SyncStreamCipher + SyncStreamCipherSeek,
type CiphertextOverhead = U0
type CiphertextOverhead = U0
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
sourcefn encrypt_in_place_detached(
&self,
nonce: &Nonce,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag, Error>
fn encrypt_in_place_detached(
&self,
nonce: &Nonce,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<Tag, Error>
Encrypt the data in-place, returning the authentication tag
sourcefn decrypt_in_place_detached(
&self,
nonce: &Nonce,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag
) -> Result<(), Error>
fn decrypt_in_place_detached(
&self,
nonce: &Nonce,
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) Read more
sourceimpl<C> Clone for ChaChaPoly1305<C> where
C: NewStreamCipher<KeySize = U32, NonceSize = U12> + SyncStreamCipher + SyncStreamCipherSeek,
impl<C> Clone for ChaChaPoly1305<C> where
C: NewStreamCipher<KeySize = U32, NonceSize = U12> + SyncStreamCipher + SyncStreamCipherSeek,
sourceimpl<C> Drop for ChaChaPoly1305<C> where
C: NewStreamCipher<KeySize = U32, NonceSize = U12> + SyncStreamCipher + SyncStreamCipherSeek,
impl<C> Drop for ChaChaPoly1305<C> where
C: NewStreamCipher<KeySize = U32, NonceSize = U12> + SyncStreamCipher + SyncStreamCipherSeek,
sourceimpl<C> NewAead for ChaChaPoly1305<C> where
C: NewStreamCipher<KeySize = U32, NonceSize = U12> + SyncStreamCipher + SyncStreamCipherSeek,
impl<C> NewAead for ChaChaPoly1305<C> where
C: NewStreamCipher<KeySize = U32, NonceSize = U12> + SyncStreamCipher + SyncStreamCipherSeek,
Auto Trait Implementations
impl<C> RefUnwindSafe for ChaChaPoly1305<C> where
C: RefUnwindSafe,
impl<C> Send for ChaChaPoly1305<C> where
C: Send,
impl<C> Sync for ChaChaPoly1305<C> where
C: Sync,
impl<C> Unpin for ChaChaPoly1305<C> where
C: Unpin,
impl<C> UnwindSafe for ChaChaPoly1305<C> where
C: UnwindSafe,
Blanket Implementations
sourceimpl<Alg> Aead for Alg where
Alg: AeadInPlace,
impl<Alg> Aead for Alg where
Alg: AeadInPlace,
type NonceSize = <Alg as AeadInPlace>::NonceSize
type NonceSize = <Alg as AeadInPlace>::NonceSize
The length of a nonce.
type TagSize = <Alg as AeadInPlace>::TagSize
type TagSize = <Alg as AeadInPlace>::TagSize
The maximum length of the nonce.
type CiphertextOverhead = <Alg as AeadInPlace>::CiphertextOverhead
type CiphertextOverhead = <Alg as AeadInPlace>::CiphertextOverhead
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
sourceimpl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
impl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
type NonceSize = <Alg as AeadMutInPlace>::NonceSize
type NonceSize = <Alg as AeadMutInPlace>::NonceSize
The length of a nonce.
type TagSize = <Alg as AeadMutInPlace>::TagSize
type TagSize = <Alg as AeadMutInPlace>::TagSize
The maximum length of the nonce.
type CiphertextOverhead = <Alg as AeadMutInPlace>::CiphertextOverhead
type CiphertextOverhead = <Alg as AeadMutInPlace>::CiphertextOverhead
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
sourceimpl<Alg> AeadMutInPlace for Alg where
Alg: AeadInPlace,
impl<Alg> AeadMutInPlace for Alg where
Alg: AeadInPlace,
type NonceSize = <Alg as AeadInPlace>::NonceSize
type NonceSize = <Alg as AeadInPlace>::NonceSize
The length of a nonce.
type TagSize = <Alg as AeadInPlace>::TagSize
type TagSize = <Alg as AeadInPlace>::TagSize
The maximum length of the nonce.
type CiphertextOverhead = <Alg as AeadInPlace>::CiphertextOverhead
type CiphertextOverhead = <Alg as AeadInPlace>::CiphertextOverhead
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
sourcepub fn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadMutInPlace>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
pub fn encrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadMutInPlace>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
Encrypt the given buffer containing a plaintext message in-place. Read more
sourcepub fn encrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadMutInPlace>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Alg as AeadMutInPlace>::TagSize>, Error>
pub fn encrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadMutInPlace>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, <Alg as AeadMutInPlace>::TagSize>, Error>
Encrypt the data in-place, returning the authentication tag
sourcepub fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadMutInPlace>::NonceSize>,
associated_data: &[u8],
buffer: &mut impl Buffer
) -> Result<(), Error>
pub fn decrypt_in_place(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadMutInPlace>::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
sourcepub fn decrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadMutInPlace>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Alg as AeadMutInPlace>::TagSize>
) -> Result<(), Error>
pub fn decrypt_in_place_detached(
&mut self,
nonce: &GenericArray<u8, <Alg as AeadMutInPlace>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, <Alg as AeadMutInPlace>::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) Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more