public static void squareAddToExt(long[] x, long[] zz) { long[] tt = Nat256.createExt64(); implSquare(x, tt); addExt(zz, tt, zz); }
public SecT193FieldElement(BigInteger x) { if (x == null || x.signum() < 0 || x.bitLength() > 193) { throw new IllegalArgumentException("x value invalid for SecT193FieldElement"); } this.x = SecT193Field.fromBigInteger(x); }
implExpand(x, f); implExpand(y, g); implMulwAcc(f[0], g[0], zz, 0); implMulwAcc(f[1], g[1], zz, 1); implMulwAcc(f[2], g[2], zz, 2); implMulwAcc(f[3], g[3], zz, 3); implMulwAcc(f[0] ^ f[1], g[0] ^ g[1], zz, 1); implMulwAcc(f[2] ^ f[3], g[2] ^ g[3], zz, 3); implMulwAcc(c0 ^ c1, d0 ^ d1, zz, 3); long[] t = new long[3]; implMulwAcc(c0, d0, t, 0); implMulwAcc(c1, d1, t, 1); long t0 = t[0], t1 = t[1], t2 = t[2]; zz[2] ^= t0; implCompactExt(zz);
public static void squareN(long[] x, int n, long[] z) { // assert n > 0; long[] tt = Nat256.createExt64(); implSquare(x, tt); reduce(tt, z); while (--n > 0) { implSquare(z, tt); reduce(tt, z); } }
public static void multiply(long[] x, long[] y, long[] z) { long[] tt = Nat256.createExt64(); implMultiply(x, y, tt); reduce(tt, z); }
public static void multiplyAddToExt(long[] x, long[] y, long[] zz) { long[] tt = Nat256.createExt64(); implMultiply(x, y, tt); addExt(zz, tt, zz); }
public ECFieldElement addOne() { long[] z = Nat256.create64(); SecT193Field.addOne(x, z); return new SecT193FieldElement(z); }
public ECFieldElement invert() { long[] z = Nat256.create64(); SecT193Field.invert(x, z); return new SecT193FieldElement(z); }
public ECFieldElement add(ECFieldElement b) { long[] z = Nat256.create64(); SecT193Field.add(x, ((SecT193FieldElement)b).x, z); return new SecT193FieldElement(z); }
public static void square(long[] x, long[] z) { long[] tt = Nat256.createExt64(); implSquare(x, tt); reduce(tt, z); }