pub struct SalsaBox(_);
Expand description

Public-key encryption scheme based on the X25519 Elliptic Curve Diffie-Hellman function and the XSalsa20Poly1305 authenticated encryption cipher.

This type impls the aead::Aead trait, and otherwise functions as a symmetric Authenticated Encryption with Associated Data (AEAD) cipher once instantiated.

Implementations

Create a new SalsaBox, performing X25519 Diffie-Hellman to derive a shared secret from the provided public and secret keys.

Trait Implementations

The length of a nonce.
The maximum length of the nonce.
The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more
Generate a random nonce for this AEAD algorithm. Read more
Encrypt the given buffer containing a plaintext message in-place. Read more
Encrypt the data in-place, returning the authentication tag
Decrypt the message in-place, returning an error in the event the provided authentication tag does not match the given ciphertext. Read more
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
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Encrypt the given plaintext payload, and return the resulting ciphertext as a vector of bytes. Read more
Decrypt the given ciphertext slice, and return the resulting plaintext as a vector of bytes. Read more
Encrypt the given plaintext slice, and return the resulting ciphertext as a vector of bytes. Read more
Decrypt the given ciphertext slice, and return the resulting plaintext as a vector of bytes. Read more
Encrypt the given buffer containing a plaintext message in-place. Read more
Encrypt the data in-place, returning the authentication tag
Decrypt the message in-place, returning an error in the event the provided authentication tag does not match the given ciphertext. Read more
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
Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.