decrypt method

  1. @override
List<int> decrypt(
  1. List<int> data
)
override

Decrypts data using ChaCha20.

Implementation

@override
List<int> decrypt(List<int> data) {
  final keyBytes = KeyEncodingUtils.stringKeyToBytes(key);
  final params = ParametersWithIV(KeyParameter(keyBytes), nonce);
  final cipher = ChaCha20Engine();
  cipher.init(false, params);
  return cipher.process(Uint8List.fromList(data));
}