decrypt method

  1. @override
Uint8List decrypt(
  1. Encrypted encrypted, {
  2. IV? iv,
  3. Uint8List? associatedData,
})
override

Decrypt encrypted value.

Implementation

@override
Uint8List decrypt(Encrypted encrypted, {IV? iv, Uint8List? associatedData}) {
  if (privateKey == null) {
    throw StateError('Can\'t decrypt without a private key, null given.');
  }

  _cipher
    ..reset()
    ..init(false, _privateKeyParams!);

  return _cipher.process(encrypted.bytes);
}