calculateX static method

BigInt calculateX(
  1. Digest digest,
  2. BigInt N,
  3. Uint8List salt,
  4. Uint8List identity,
  5. Uint8List password,
)

Implementation

static BigInt calculateX(Digest digest, BigInt N, Uint8List salt,
    Uint8List identity, Uint8List password) {
  var output = Uint8List(digest.digestSize);

  digest.update(identity, 0, identity.length);
  digest.updateByte(':'.codeUnitAt(0));
  digest.update(password, 0, password.length);
  digest.doFinal(output, 0);

  digest.update(salt, 0, salt.length);
  digest.update(output, 0, output.length);
  digest.doFinal(output, 0);

  return decodeBigInt(output);
}