pub type SalsaBox = CryptoBox<Salsa20>;
Expand description
CryptoBox
instantiated with with the Salsa20 stream cipher.
Aliased Type§
struct SalsaBox { /* private fields */ }
Implementations
Trait Implementations
Source§impl<C> AeadCore for CryptoBox<C>
impl<C> AeadCore for CryptoBox<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 CryptoBox<C>
impl<C> AeadInPlace for CryptoBox<C>
Source§fn encrypt_in_place(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer,
) -> Result<(), Error>
fn encrypt_in_place( &self, nonce: &GenericArray<u8, Self::NonceSize>, 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: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
) -> Result<Tag, Error>
fn encrypt_in_place_detached( &self, nonce: &GenericArray<u8, Self::NonceSize>, 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: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut dyn Buffer,
) -> Result<(), Error>
fn decrypt_in_place( &self, nonce: &GenericArray<u8, Self::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
Source§fn decrypt_in_place_detached(
&self,
nonce: &GenericArray<u8, Self::NonceSize>,
associated_data: &[u8],
buffer: &mut [u8],
tag: &Tag,
) -> Result<(), Error>
fn decrypt_in_place_detached( &self, nonce: &GenericArray<u8, Self::NonceSize>, 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)