Struct crypto_box::ChaChaBox[][src]

pub struct ChaChaBox(_);

Public-key encryption scheme based on the X25519 Elliptic Curve Diffie-Hellman function and the XChaCha20Poly1305 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

impl ChaChaBox[src]

pub fn new(public_key: &PublicKey, secret_key: &SecretKey) -> Self[src]

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

Trait Implementations

impl AeadCore for ChaChaBox[src]

type NonceSize = U24

The length of a nonce.

type TagSize = U16

The maximum length of the nonce.

type CiphertextOverhead = U0

The upper bound amount of additional space required to support a ciphertext vs. a plaintext. Read more

impl AeadInPlace for ChaChaBox[src]

Auto Trait Implementations

Blanket Implementations

impl<Alg> Aead for Alg where
    Alg: AeadInPlace
[src]

impl<Alg> AeadMut for Alg where
    Alg: AeadMutInPlace
[src]

impl<Alg> AeadMutInPlace for Alg where
    Alg: AeadInPlace
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.