pub fn decrypt(
key: &SessionKey,
nonce: &[u8; 24],
aad: &[u8],
ciphertext: &[u8],
) -> Result<Vec<u8>, CryptoError>Available on crate feature
crypto only.Expand description
Decrypt ciphertext using XChaCha20-Poly1305.
§Arguments
key- 32-byte session keynonce- 24-byte nonce (constructed from epoch, direction, counter)aad- Additional authenticated dataciphertext- Ciphertext with appended 16-byte Poly1305 tag
§Returns
Decrypted plaintext, or error if authentication fails