pub struct XSalsa20Poly1305 { /* private fields */ }
Expand description
XSalsa20Poly1305 (a.k.a. NaCl crypto_secretbox
) authenticated
encryption cipher.
Trait Implementations
sourceimpl AeadCore for XSalsa20Poly1305
impl AeadCore for XSalsa20Poly1305
sourceimpl AeadInPlace for XSalsa20Poly1305
impl AeadInPlace for XSalsa20Poly1305
sourcefn encrypt_in_place(
&self,
nonce: &GenericArray<u8, <XSalsa20 as NewCipher>::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
fn encrypt_in_place(
&self,
nonce: &GenericArray<u8, <XSalsa20 as NewCipher>::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
Encrypt the given buffer containing a plaintext message in-place. Read more
sourcefn encrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, <XSalsa20 as NewCipher>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>, Error>
fn encrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, <XSalsa20 as NewCipher>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8]
) -> Result<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>, Error>
Encrypt the data in-place, returning the authentication tag
sourcefn decrypt_in_place(
&self,
nonce: &GenericArray<u8, <XSalsa20 as NewCipher>::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer
) -> Result<(), Error>
fn decrypt_in_place(
&self,
nonce: &GenericArray<u8, <XSalsa20 as NewCipher>::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
sourcefn decrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, <XSalsa20 as NewCipher>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>
) -> Result<(), Error>
fn decrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, <XSalsa20 as NewCipher>::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>
) -> 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 Clone for XSalsa20Poly1305
impl Clone for XSalsa20Poly1305
sourcefn clone(&self) -> XSalsa20Poly1305
fn clone(&self) -> XSalsa20Poly1305
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Drop for XSalsa20Poly1305
impl Drop for XSalsa20Poly1305
sourceimpl NewAead for XSalsa20Poly1305
impl NewAead for XSalsa20Poly1305
type KeySize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>
type KeySize = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>
The size of the key array required by this algorithm.
sourcefn new(
key: &GenericArray<u8, <Salsa<R20> as NewCipher>::KeySize>
) -> XSalsa20Poly1305
fn new(
key: &GenericArray<u8, <Salsa<R20> as NewCipher>::KeySize>
) -> XSalsa20Poly1305
Create a new AEAD instance with the given key.
Auto Trait Implementations
impl RefUnwindSafe for XSalsa20Poly1305
impl Send for XSalsa20Poly1305
impl Sync for XSalsa20Poly1305
impl Unpin for XSalsa20Poly1305
impl UnwindSafe for XSalsa20Poly1305
Blanket Implementations
sourceimpl<Alg> Aead for Alg where
Alg: AeadInPlace,
impl<Alg> Aead for Alg where
Alg: AeadInPlace,
sourceimpl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
impl<Alg> AeadMut for Alg where
Alg: AeadMutInPlace,
sourceimpl<Alg> AeadMutInPlace for Alg where
Alg: AeadInPlace,
impl<Alg> AeadMutInPlace for Alg where
Alg: AeadInPlace,
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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) Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more