pub struct ChaChaPoly1305<C, N: ArraySize = U12> {
pub(crate) key: Key,
pub(crate) stream_cipher: PhantomData<C>,
pub(crate) nonce_size: PhantomData<N>,
}Expand description
Generic ChaCha+Poly1305 Authenticated Encryption with Additional Data (AEAD) construction.
See the toplevel documentation for a usage example.
Fields§
§key: KeySecret key.
stream_cipher: PhantomData<C>ChaCha stream cipher.
nonce_size: PhantomData<N>Nonce size.
Trait Implementations§
Source§impl<C, N> AeadCore for ChaChaPoly1305<C, N>where
N: ArraySize,
impl<C, N> AeadCore for ChaChaPoly1305<C, N>where
N: ArraySize,
Source§impl<C, N> AeadInOut for ChaChaPoly1305<C, N>
impl<C, N> AeadInOut for ChaChaPoly1305<C, N>
Source§fn encrypt_inout_detached(
&self,
nonce: &Nonce<Self>,
associated_data: &[u8],
buffer: InOutBuf<'_, '_, u8>,
) -> Result<Tag, Error>
fn encrypt_inout_detached( &self, nonce: &Nonce<Self>, associated_data: &[u8], buffer: InOutBuf<'_, '_, u8>, ) -> Result<Tag, Error>
Source§fn decrypt_inout_detached(
&self,
nonce: &Nonce<Self>,
associated_data: &[u8],
buffer: InOutBuf<'_, '_, u8>,
tag: &Tag,
) -> Result<(), Error>
fn decrypt_inout_detached( &self, nonce: &Nonce<Self>, associated_data: &[u8], buffer: InOutBuf<'_, '_, u8>, tag: &Tag, ) -> Result<(), Error>
Source§impl<C, N> Clone for ChaChaPoly1305<C, N>where
N: ArraySize,
impl<C, N> Clone for ChaChaPoly1305<C, N>where
N: ArraySize,
Source§impl<C, N> Debug for ChaChaPoly1305<C, N>where
N: ArraySize,
impl<C, N> Debug for ChaChaPoly1305<C, N>where
N: ArraySize,
Source§impl<C, N> Drop for ChaChaPoly1305<C, N>where
N: ArraySize,
impl<C, N> Drop for ChaChaPoly1305<C, N>where
N: ArraySize,
Source§impl<C, N> KeyInit for ChaChaPoly1305<C, N>where
N: ArraySize,
impl<C, N> KeyInit for ChaChaPoly1305<C, N>where
N: ArraySize,
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. Read more
Source§impl<C, N> KeySizeUser for ChaChaPoly1305<C, N>where
N: ArraySize,
impl<C, N> KeySizeUser for ChaChaPoly1305<C, N>where
N: ArraySize,
impl<C, N: ArraySize> ZeroizeOnDrop for ChaChaPoly1305<C, N>
Available on crate feature
zeroize only.Auto Trait Implementations§
impl<C, N> Freeze for ChaChaPoly1305<C, N>
impl<C, N> RefUnwindSafe for ChaChaPoly1305<C, N>where
C: RefUnwindSafe,
N: RefUnwindSafe,
impl<C, N> Send for ChaChaPoly1305<C, N>
impl<C, N> Sync for ChaChaPoly1305<C, N>
impl<C, N> Unpin for ChaChaPoly1305<C, N>
impl<C, N> UnsafeUnpin for ChaChaPoly1305<C, N>
impl<C, N> UnwindSafe for ChaChaPoly1305<C, N>where
C: UnwindSafe,
N: UnwindSafe,
Blanket Implementations§
Source§impl<T> AeadInPlace for Twhere
T: AeadInOut,
impl<T> AeadInPlace for Twhere
T: AeadInOut,
Source§fn encrypt_in_place(
&self,
nonce: &Array<u8, <T as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer,
) -> Result<(), Error>
fn encrypt_in_place( &self, nonce: &Array<u8, <T as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut dyn Buffer, ) -> Result<(), Error>
👎Deprecated since 0.6.0: use
AeadInOut::encrypt_in_place insteadEncrypt the given buffer containing a plaintext message in-place.
Source§fn encrypt_in_place_detached(
&self,
nonce: &Array<u8, <T as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
) -> Result<Array<u8, <T as AeadCore>::TagSize>, Error>
fn encrypt_in_place_detached( &self, nonce: &Array<u8, <T as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut [u8], ) -> Result<Array<u8, <T as AeadCore>::TagSize>, Error>
👎Deprecated since 0.6.0: use
AeadInOut::encrypt_inout_detached insteadEncrypt the data in-place, returning the authentication tag
Source§fn decrypt_in_place(
&self,
nonce: &Array<u8, <T as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer,
) -> Result<(), Error>
fn decrypt_in_place( &self, nonce: &Array<u8, <T as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut dyn Buffer, ) -> Result<(), Error>
👎Deprecated since 0.6.0: use
AeadInOut::decrypt_in_place insteadDecrypt the message in-place, returning an error in the event the
provided authentication tag does not match the given ciphertext.
Source§fn decrypt_in_place_detached(
&self,
nonce: &Array<u8, <T as AeadCore>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Array<u8, <T as AeadCore>::TagSize>,
) -> Result<(), Error>
fn decrypt_in_place_detached( &self, nonce: &Array<u8, <T as AeadCore>::NonceSize>, associated_data: &[u8], buffer: &mut [u8], tag: &Array<u8, <T as AeadCore>::TagSize>, ) -> Result<(), Error>
👎Deprecated since 0.6.0: use
AeadInOut::decrypt_inout_detached insteadDecrypt 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<T> Aead for Twhere
T: AeadInOut,
impl<T> Aead for Twhere
T: AeadInOut,
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