decrypt

fun decrypt(key: ByteArray, nonce: ByteArray, ciphertext: ByteArray, aad: ByteArray, mac: ByteArray): ByteArray

Return

the decrypted plaintext if the mac is valid.

Parameters

key

32 bytes decryption key

nonce

12 bytes nonce

ciphertext

ciphertext

aad

additional authentication data. can be empty

mac

authentication mac