decrypt

fun decrypt(data: ByteArray, key: ByteArray, nonce: ByteArray, additionalData: ByteArray? = null, micSize: Int): ByteArray?

Decrypts the given data with the EncryptionKey, Nonce and authenticates the generated MIC(Message Integrity Check).

Parameters

data

Data to be decrypted.

key

128-bit key.

nonce

104-bit nonce.

micSize

Length of the MIC to be generated, in bytes.

additionalData

Additional data to be authenticated.

Throws

if the decryption failed.