decrypt method
Decrypt encrypted
value.
Implementation
@override
Uint8List decrypt(Encrypted encrypted, {IV? iv, Uint8List? associatedData}) {
if (mode != AESMode.ecb && iv == null) {
throw StateError('IV is required.');
}
if (_streamCipher != null) {
_streamCipher!
..reset()
..init(false, _buildParams(iv, associatedData: associatedData));
return _streamCipher!.process(encrypted.bytes);
}
_cipher
..reset()
..init(false, _buildParams(iv, associatedData: associatedData));
if (padding != null) {
return _cipher.process(encrypted.bytes);
}
return _processBlocks(encrypted.bytes);
}