decrypt method

  1. @override
Future<List<int>?> decrypt(
  1. List<int> encrypted,
  2. List<int> key,
  3. List<int> nonce,
  4. List<int> tag,
)
override

Implementation

@override
Future<List<int>?> decrypt(List<int> encrypted, List<int> key,
    List<int> nonce, List<int> tag) async {
  final encryptedData = asUint8List(encrypted);
  final keyData = asUint8List(key);
  final nonceData = asUint8List(nonce);
  final tagData = asUint8List(tag);
  final decrypted = await methodChannel.invokeMethod<List<int>>('decrypt', {
    'encrypted': encryptedData,
    'key': keyData,
    'nonce': nonceData,
    'tag': tagData
  });
  return decrypted;
}