pastaIsZeroMask function

0/1 mask: 1 iff the field element is zero. Branch-free identity test for point arithmetic (no bool on secret data).

Implementation

Uint64 pastaIsZeroMask(PastaFieldElement e) {
  assert(e.limbs.length == 4);
  return Uint64.isZeroMask(e.limbs[0] | e.limbs[1] | e.limbs[2] | e.limbs[3]) &
      Uint64.one;
}