Skip to main content

crypto_aead_xchacha20poly1305_ietf_encrypt

Function crypto_aead_xchacha20poly1305_ietf_encrypt 

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

Encrypts message with nonce, key, and optional associated data.

Compatible with libsodium’s crypto_aead_xchacha20poly1305_ietf_encrypt.

§Errors

Returns an error if message exceeds the maximum supported length or ciphertext is not exactly one authentication tag longer than message.