mask64Bits returns 0xffffffff if cond is 1, and 0 otherwise.
BigInt mask64Bits(int cond) { return ~(BigInt.from(cond) - BigInt.one); }