hashPaddedPair static method

BigInt hashPaddedPair(
  1. Digest digest,
  2. BigInt N,
  3. BigInt? n1,
  4. BigInt? n2,
)

Implementation

static BigInt hashPaddedPair(
    Digest digest, BigInt N, BigInt? n1, BigInt? n2) {
  var padLength = (N.bitLength + 7) ~/ 8;

  var n1Bytes = getPadded(n1!, padLength);
  var n2Bytes = getPadded(n2!, padLength);

  digest.update(n1Bytes, 0, n1Bytes.length);
  digest.update(n2Bytes, 0, n2Bytes.length);

  var output = Uint8List(digest.digestSize);
  digest.doFinal(output, 0);

  return decodeBigInt(output);
}