pub type XSalsa20Poly1305 = SecretBox<Salsa20>;
Expand description
crypto_secretbox
instantiated with the XSalsa20 stream cipher.
Aliased Type§
struct XSalsa20Poly1305 { /* private fields */ }
Implementations
Trait Implementations
Source§impl<C> AeadCore for SecretBox<C>
impl<C> AeadCore for SecretBox<C>
Source§type NonceSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>
type NonceSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>
The length of a nonce.
Source§type TagSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>
type TagSize = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>
The maximum length of the nonce.
Source§type CiphertextOverhead = UTerm
type CiphertextOverhead = UTerm
The upper bound amount of additional space required to support a
ciphertext vs. a plaintext.
Source§fn generate_nonce(
rng: impl CryptoRng + RngCore,
) -> GenericArray<u8, Self::NonceSize>
fn generate_nonce( rng: impl CryptoRng + RngCore, ) -> GenericArray<u8, Self::NonceSize>
Generate a random nonce for this AEAD algorithm. Read more
Source§impl<C> AeadInPlace for SecretBox<C>
impl<C> AeadInPlace for SecretBox<C>
Source§fn encrypt_in_place(
&self,
nonce: &Nonce,
associated_data: &[u8],
buffer: &mut dyn Buffer,
) -> Result<(), Error>
fn encrypt_in_place( &self, nonce: &Nonce, associated_data: &[u8], buffer: &mut dyn Buffer, ) -> Result<(), Error>
Encrypt the given buffer containing a plaintext message in-place. Read more
Source§fn 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
Source§fn decrypt_in_place(
&self,
nonce: &Nonce,
associated_data: &[u8],
buffer: &mut dyn Buffer,
) -> Result<(), Error>
fn decrypt_in_place( &self, nonce: &Nonce, 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
Source§fn 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)
Source§impl<C> KeyInit for SecretBox<C>
impl<C> KeyInit for SecretBox<C>
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.
Source§fn generate_key(
rng: impl CryptoRng + RngCore,
) -> GenericArray<u8, Self::KeySize>
fn generate_key( rng: impl CryptoRng + RngCore, ) -> GenericArray<u8, Self::KeySize>
Generate random key using the provided
CryptoRng
.