init method
Init the cipher with its initialization params
. The type of
CipherParameters depends on the algorithm being used (see the
documentation of each implementation to find out more).
Use the argument forEncryption
to tell the cipher if you want to encrypt
or decrypt data.
Implementation
@override
void init(
bool forEncryption, covariant ParametersWithIV<KeyParameter> params) {
var uparams = params.parameters;
var iv = params.iv;
if (iv.length != 8) {
throw ArgumentError('Salsa20 requires exactly 8 bytes of IV');
}
_workingIV = iv;
_workingKey = uparams!.key;
_setKey(_workingKey!, _workingIV);
}