decrypt

expect suspend 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.

aad

additional authenticated data or null.

Throws

if the given algorithm is not supported.

if decryption fails

actual suspend fun decrypt(algorithm: <Error class: unknown class>, key: ByteArray, nonce: ByteArray, messageCiphertext: ByteArray, aad: ByteArray?): ByteArray
actual suspend fun decrypt(algorithm: Algorithm, key: ByteArray, nonce: ByteArray, messageCiphertext: ByteArray, aad: ByteArray?): 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.

aad

additional authenticated data or null.

Throws

if the given algorithm is not supported.

if decryption fails

actual suspend fun decrypt(algorithm: Algorithm, key: ByteArray, nonce: ByteArray, messageCiphertext: ByteArray, aad: ByteArray?): ByteArray