generateDerivedParametersWithIV method

  1. @override
ParametersWithIV<CipherParameters?> generateDerivedParametersWithIV(
  1. int keySize,
  2. int ivSize
)
override

Generates a derived key with the given keySize in bytes and a derived IV with the given ivSize.

Implementation

@override
ParametersWithIV generateDerivedParametersWithIV(int keySize, int ivSize) {
  keySize = keySize;
  ivSize = ivSize;

  if ((keySize + ivSize) > digest.digestSize) {
    throw ArgumentError(
        "Can't generate a derived key ${keySize + ivSize} bytes long.");
  }

  var dKey = generateDerivedKey();

  return ParametersWithIV(KeyParameter(dKey), dKey);
}