aesAuthDecrypt function

Uint8List aesAuthDecrypt(
  1. Uint8List encrypted,
  2. Uint8List aesKey,
  3. Uint8List iv,
  4. Uint8List tag,
)

Implementation

Uint8List aesAuthDecrypt(
    Uint8List encrypted, Uint8List aesKey, Uint8List iv, Uint8List tag,) {
  final keyPair =
      crypto_keys.KeyPair.symmetric(crypto_keys.SymmetricKey(keyValue: aesKey));

  final encrypter = keyPair.publicKey!
      .createEncrypter(crypto_keys.algorithms.encryption.aes.gcm);

  final decrypted = encrypter.decrypt(crypto_keys.EncryptionResult(encrypted,
      initializationVector: iv, authenticationTag: tag,),);

  return decrypted;
}