@Test void isNotOnCurve() { JacobianPoint p = new JacobianPoint( new FP2Immutable(new FP(1), new FP(2)), new FP2Immutable(new FP(3), new FP(4)), new FP2Immutable(new FP(5), new FP(6))); assertFalse(isOnCurve(p)); }
@VisibleForTesting static boolean isOnCurve(JacobianPoint p) { if (p.isInfinity()) { return true; } FP2Immutable x = p.getX(); FP2Immutable y = p.getY(); FP2Immutable z = p.getZ(); FP2Immutable y2 = y.sqr(); FP2Immutable x3 = x.pow(3); FP2Immutable z6 = z.pow(6); FP2Immutable four = new FP2Immutable(new FP(4), new FP(4)); return y2.equals(x3.add(z6.mul(four))); }
Helper { @VisibleForTesting static boolean isOnCurve(JacobianPoint p) { if (p.isInfinity()) { return true; } FP2Immutable x = p.getX(); FP2Immutable y = p.getY(); FP2Immutable z = p.getZ(); FP2Immutable y2 = y.sqr(); FP2Immutable x3 = x.pow(3); FP2Immutable z6 = z.pow(6); FP2Immutable four = new FP2Immutable(new FP(4), new FP(4)); return y2.equals(x3.add(z6.mul(four))); } }
Helper { @VisibleForTesting static boolean isOnCurve(JacobianPoint p) { if (p.isInfinity()) { return true; } FP2Immutable x = p.getX(); FP2Immutable y = p.getY(); FP2Immutable z = p.getZ(); FP2Immutable y2 = y.sqr(); FP2Immutable x3 = x.pow(3); FP2Immutable z6 = z.pow(6); FP2Immutable four = new FP2Immutable(new FP(4), new FP(4)); return y2.equals(x3.add(z6.mul(four))); }  }
Helper { @VisibleForTesting static boolean isOnCurve(JacobianPoint p) { if (p.isInfinity()) { return true; } FP2Immutable x = p.getX(); FP2Immutable y = p.getY(); FP2Immutable z = p.getZ(); FP2Immutable y2 = y.sqr(); FP2Immutable x3 = x.pow(3); FP2Immutable z6 = z.pow(6); FP2Immutable four = new FP2Immutable(new FP(4), new FP(4)); return y2.equals(x3.add(z6.mul(four))); }   }
Helper { @VisibleForTesting static boolean isOnCurve(JacobianPoint p) { if (p.isInfinity()) { return true; } FP2Immutable x = p.getX(); FP2Immutable y = p.getY(); FP2Immutable z = p.getZ(); FP2Immutable y2 = y.sqr(); FP2Immutable x3 = x.pow(3); FP2Immutable z6 = z.pow(6); FP2Immutable four = new FP2Immutable(new FP(4), new FP(4)); return y2.equals(x3.add(z6.mul(four))); }    }