checkParameters method
void
checkParameters({
- int? length,
- required SecretKey secretKey,
- required int nonceLength,
- int aadLength = 0,
- int keyStreamIndex = 0,
override
Checks parameters for encrypt / decrypt and throws ArgumentError if any is invalid.
Implementation
@override
void checkParameters({
int? length,
required SecretKey secretKey,
required int nonceLength,
int aadLength = 0,
int keyStreamIndex = 0,
}) {
// Allow nonce length to be anything.
// TODO: Should we require 12 bytes?
if (nonceLength != this.nonceLength) {
nonceLength = this.nonceLength;
}
super.checkParameters(
length: length,
secretKey: secretKey,
nonceLength: nonceLength,
aadLength: aadLength,
keyStreamIndex: keyStreamIndex,
);
}