decrypt

fun decrypt(algorithm: Algorithm, key: ByteArray, nonce: ByteArray, messageCiphertext: ByteArray, aad: ByteArray? = null): ByteArray

Message decryption.

Return

the plaintext.

Parameters

key

the encryption key.

nonce

the nonce/IV.

messageCiphertext

the message to decrypt with the tag at the end.

Throws

if the given algorithm is not supported.

if decryption fails