public static int[] fromBigInteger(BigInteger x) { int[] z = Nat128.fromBigInteger(x); if ((z[3] >>> 1) >= P3s1 && Nat128.gte(z, P)) { Nat128.subFrom(P, z); } return z; }
public static void add(int[] x, int[] y, int[] z) { int c = Nat128.add(x, y, z); if (c != 0 || ((z[3] >>> 1) >= P3s1 && Nat128.gte(z, P))) { addPInvTo(z); } }
public static void addOne(int[] x, int[] z) { int c = Nat.inc(4, x, z); if (c != 0 || ((z[3] >>> 1) >= P3s1 && Nat128.gte(z, P))) { addPInvTo(z); } }
public static void twice(int[] x, int[] z) { int c = Nat.shiftUpBit(4, x, 0, z); if (c != 0 || ((z[3] >>> 1) >= P3s1 && Nat128.gte(z, P))) { addPInvTo(z); } }
public static boolean diff(int[] x, int xOff, int[] y, int yOff, int[] z, int zOff) { boolean pos = gte(x, xOff, y, yOff); if (pos) { sub(x, xOff, y, yOff, z, zOff); } else { sub(y, yOff, x, xOff, z, zOff); } return pos; }