public static void reduce32(int x, int[] z) { if ((x != 0 && Nat160.mul33WordAdd(PInv33, x, z, 0) != 0) || (z[4] == P4 && Nat160.gte(z, P))) { Nat.add33To(5, PInv33, z); } }
public static void add(int[] x, int[] y, int[] z) { int c = Nat160.add(x, y, z); if (c != 0 || (z[4] == P4 && Nat160.gte(z, P))) { Nat.add33To(5, PInv33, z); } }
public static void addOne(int[] x, int[] z) { int c = Nat.inc(5, x, z); if (c != 0 || (z[4] == P4 && Nat160.gte(z, P))) { Nat.add33To(5, PInv33, z); } }
public static int[] fromBigInteger(BigInteger x) { int[] z = Nat160.fromBigInteger(x); if (z[4] == P4 && Nat160.gte(z, P)) { Nat160.subFrom(P, z); } return z; }
public static void twice(int[] x, int[] z) { int c = Nat.shiftUpBit(5, x, 0, z); if (c != 0 || (z[4] == P4 && Nat160.gte(z, P))) { Nat.addWordTo(5, PInv, z); } } }
public static void twice(int[] x, int[] z) { int c = Nat.shiftUpBit(5, x, 0, z); if (c != 0 || (z[4] == P4 && Nat160.gte(z, P))) { Nat.add33To(5, PInv33, z); } } }
public static void add(int[] x, int[] y, int[] z) { int c = Nat160.add(x, y, z); if (c != 0 || (z[4] == P4 && Nat160.gte(z, P))) { Nat.addWordTo(5, PInv, z); } }
public static void addOne(int[] x, int[] z) { int c = Nat.inc(5, x, z); if (c != 0 || (z[4] == P4 && Nat160.gte(z, P))) { Nat.addWordTo(5, PInv, z); } }
public static int[] fromBigInteger(BigInteger x) { int[] z = Nat160.fromBigInteger(x); if (z[4] == P4 && Nat160.gte(z, P)) { Nat160.subFrom(P, z); } return z; }
public static void reduce32(int x, int[] z) { if ((x != 0 && Nat160.mulWordsAdd(PInv, x, z, 0) != 0) || (z[4] == P4 && Nat160.gte(z, P))) { Nat.addWordTo(5, PInv, 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; }
public static void reduce(int[] xx, int[] z) { long cc = Nat160.mul33Add(PInv33, xx, 5, xx, 0, z, 0); int c = Nat160.mul33DWordAdd(PInv33, cc, z, 0); // assert c == 0 || c == 1; if (c != 0 || (z[4] == P4 && Nat160.gte(z, P))) { Nat.add33To(5, PInv33, z); } }