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
n
th block
Warning:
This function panics if
key
is smaller or larger than 32 bytes/256 bitsnonce
is smaller or larger than 24 bytes/192 bitsn
exceeds2^64 - 1
(which means thatdata
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