Struct crypto_api_chachapoly::XChaCha20[][src]

pub struct XChaCha20;
Expand description

An implementation of XChaCha20

Implementations

Creates a Cipher instance with XChaCha20 as underlying cipher

XORs the bytes in data with the XChaCha20 keystream for key and nonce starting at the nth block

Warning:

This function panics if

  • key is smaller or larger than 32 bytes/256 bits
  • nonce is smaller or larger than 24 bytes/192 bits
  • n exceeds 2^64 - 1 (which means that data must be smaller than (2^64 - n) * 64)

Consider using the crypto_api-interface instead of calling this function directly

Trait Implementations

Returns information about the cipher

Predicts the maximum encrypted length for plaintext_len bytes

Encrypts plaintext_len bytes in-place in buf using key and nonce and returns the ciphertext length Read more

Encrypts plaintext into buf using key and nonce and returns the ciphertext length

Decrypts ciphertext_len bytes in-place in buf using key and nonce and returns the plaintext length Read more

Decrypts ciphertext into buf using key and nonce and returns the plaintext length

Generates a new key into buf using rng and returns the length of the secret key

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

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.