pub struct XChaCha20Poly1305 { /* private fields */ }Expand description
XChaCha20Poly1305 variant with extended 24-byte nonce
Implementations§
Source§impl XChaCha20Poly1305
 
impl XChaCha20Poly1305
Sourcepub fn encrypt<const N: usize>(
    &self,
    nonce: &Nonce<N>,
    plaintext: &[u8],
    aad: Option<&[u8]>,
) -> Result<Vec<u8>>where
    Nonce<N>: XChaCha20Compatible,
 
pub fn encrypt<const N: usize>(
    &self,
    nonce: &Nonce<N>,
    plaintext: &[u8],
    aad: Option<&[u8]>,
) -> Result<Vec<u8>>where
    Nonce<N>: XChaCha20Compatible,
Encrypt plaintext using XChaCha20Poly1305
Sourcepub fn decrypt<const N: usize>(
    &self,
    nonce: &Nonce<N>,
    ciphertext: &[u8],
    aad: Option<&[u8]>,
) -> Result<Vec<u8>>where
    Nonce<N>: XChaCha20Compatible,
 
pub fn decrypt<const N: usize>(
    &self,
    nonce: &Nonce<N>,
    ciphertext: &[u8],
    aad: Option<&[u8]>,
) -> Result<Vec<u8>>where
    Nonce<N>: XChaCha20Compatible,
Decrypt ciphertext using XChaCha20Poly1305
Trait Implementations§
Source§impl Clone for XChaCha20Poly1305
 
impl Clone for XChaCha20Poly1305
Source§fn clone(&self) -> XChaCha20Poly1305
 
fn clone(&self) -> XChaCha20Poly1305
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Drop for XChaCha20Poly1305
 
impl Drop for XChaCha20Poly1305
Auto Trait Implementations§
impl Freeze for XChaCha20Poly1305
impl RefUnwindSafe for XChaCha20Poly1305
impl Send for XChaCha20Poly1305
impl Sync for XChaCha20Poly1305
impl Unpin for XChaCha20Poly1305
impl UnwindSafe for XChaCha20Poly1305
Blanket Implementations§
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