Skip to main content

crypto_aead_chacha20poly1305_ietf_encrypt_detached

Function crypto_aead_chacha20poly1305_ietf_encrypt_detached 

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

Detached version of crypto_aead_chacha20poly1305_ietf_encrypt.

Compatible with libsodium’s crypto_aead_chacha20poly1305_ietf_encrypt_detached.

§Errors

Returns an error if message exceeds the maximum supported length or ciphertext.len() does not equal message.len().