ctEqualsMask static method

Uint64 ctEqualsMask(
  1. List<Uint64> a,
  2. List<Uint64> b
)

Mask form of ctEquals: all-ones iff the limb lists are equal. Fixed iteration count; no early exit.

Implementation

static Uint64 ctEqualsMask(List<Uint64> a, List<Uint64> b) {
  assert(a.length == b.length);
  var diff = Uint64.zero;
  for (var i = 0; i < a.length; i++) {
    diff = diff | (a[i] ^ b[i]);
  }
  return isZeroMask(diff);
}