aesAuthDecrypt function
Implementation
Uint8List aesAuthDecrypt(
Uint8List encrypted, Uint8List aesKey, Uint8List iv, Uint8List tag) {
final crypto_keys.KeyPair keyPair =
crypto_keys.KeyPair.symmetric(crypto_keys.SymmetricKey(keyValue: aesKey));
final crypto_keys.Encrypter<crypto_keys.Key> encrypter = keyPair.publicKey!
.createEncrypter(crypto_keys.algorithms.encryption.aes.gcm);
final Uint8List decrypted = encrypter.decrypt(crypto_keys.EncryptionResult(
encrypted,
initializationVector: iv,
authenticationTag: tag));
return decrypted;
}