decrypt
expect fun decrypt(algorithm: Algorithm, key: ByteArray, nonce: ByteArray, messageCiphertext: ByteArray, aad: ByteArray? = null): ByteArray
Message decryption.
Return
the plaintext.
Parameters
algorithm
must be one of Algorithm.A128GCM, Algorithm.A192GCM, or Algorithm.A256GCM.
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 fun decrypt(algorithm: Algorithm, key: ByteArray, nonce: ByteArray, messageCiphertext: ByteArray, aad: ByteArray?): ByteArray
Message decryption.
Return
the plaintext.
Parameters
algorithm
must be one of Algorithm.A128GCM, Algorithm.A192GCM, Algorithm.A256GCM.
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