Skip to main content

crypto_aead_xchacha20poly1305_ietf_decrypt

Function crypto_aead_xchacha20poly1305_ietf_decrypt 

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

Decrypts ciphertext with nonce, key, and optional associated data.

Compatible with libsodium’s crypto_aead_xchacha20poly1305_ietf_decrypt.

§Errors

Returns an error if ciphertext is shorter than an authentication tag, message has the wrong length, or authentication fails.