hashPaddedTriplet static method

BigInt hashPaddedTriplet(
  1. Digest digest,
  2. BigInt N,
  3. BigInt? n1,
  4. BigInt? n2,
  5. BigInt? n3,
)

Implementation

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

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

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

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

  return decodeBigInt(output);
}