Skip to main content

crypto_aead_xchacha20poly1305_ietf_encrypt_inplace

Function crypto_aead_xchacha20poly1305_ietf_encrypt_inplace 

Source
pub fn crypto_aead_xchacha20poly1305_ietf_encrypt_inplace(
    data: &mut [u8],
    associated_data: Option<&[u8]>,
    nonce: &Nonce,
    key: &Key,
) -> Result<(), Error>
Expand description

Encrypts data in place and appends the authentication tag.

The last CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES bytes are reserved for the tag and are ignored as plaintext input.

ยงErrors

Returns an error if data is shorter than an authentication tag or its plaintext portion exceeds the maximum supported message length.