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 (iv == null) {
    throw StateError('IV is required.');
  }

  _cipher
    ..reset()
    ..init(false, _buildParams(iv));

  return _cipher.process(encrypted.bytes);
}