init method

  1. @override
void init(
  1. covariant ScryptParameters params
)
override

Init the derivator with its initialization params. The type of CipherParameters depends on the algorithm being used (see the documentation of each implementation to find out more).

Implementation

@override
void init(covariant ScryptParameters params) {
  _params = params;

  final N = _params!.N;
  final r = _params!.r;
  final p = _params!.p;

  if (N < 2 || (N & (N - 1)) != 0) {
    throw ArgumentError('N must be a power of 2 greater than 1');
  }

  if (N > _maxValue ~/ 128 ~/ r) {
    throw ArgumentError('Parameter N is too large');
  }

  if (r > _maxValue ~/ 128 ~/ p) {
    throw ArgumentError('Parameter r is too large');
  }
}