@Test void jacobianPointDblTest() { JacobianPoint a = new JacobianPoint( new FP2Immutable(new BIG(1), new BIG(2)), new FP2Immutable(new BIG(3), new BIG(4)), new FP2Immutable(new BIG(5), new BIG(6))); JacobianPoint expected = new JacobianPoint( new FP2Immutable( new BIG(0x0179), bigFromHex( "0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffa983")), new FP2Immutable( new BIG(0x15b5), bigFromHex( "0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffff8d5f")), new FP2Immutable( bigFromHex( "0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaa99"), new BIG(0x4c))); assertEquals(expected, a.dbl()); }
JacobianPoint dbl() { FP2Immutable a = x.sqr(); FP2Immutable b = y.sqr(); FP2Immutable c = b.sqr(); FP2Immutable d = x.add(b).sqr().sub(a).sub(c).dbl(); FP2Immutable e = a.mul(3); FP2Immutable f = e.sqr(); FP2Immutable xOut = f.sub(d.dbl()); FP2Immutable yOut = e.mul(d.sub(xOut)).sub(c.mul(8)); FP2Immutable zOut = y.mul(z).dbl(); return zOut.iszilch() ? INFINITY : new JacobianPoint(xOut, yOut, zOut); }
JacobianPoint { JacobianPoint dbl() { FP2Immutable a = x.sqr(); FP2Immutable b = y.sqr(); FP2Immutable c = b.sqr(); FP2Immutable d = x.add(b).sqr().sub(a).sub(c).dbl(); FP2Immutable e = a.mul(3); FP2Immutable f = e.sqr(); FP2Immutable xOut = f.sub(d.dbl()); FP2Immutable yOut = e.mul(d.sub(xOut)).sub(c.mul(8)); FP2Immutable zOut = y.mul(z).dbl(); return zOut.iszilch() ? INFINITY : new JacobianPoint(xOut, yOut, zOut); } }
JacobianPoint { JacobianPoint dbl() { FP2Immutable a = x.sqr(); FP2Immutable b = y.sqr(); FP2Immutable c = b.sqr(); FP2Immutable d = x.add(b).sqr().sub(a).sub(c).dbl(); FP2Immutable e = a.mul(3); FP2Immutable f = e.sqr(); FP2Immutable xOut = f.sub(d.dbl()); FP2Immutable yOut = e.mul(d.sub(xOut)).sub(c.mul(8)); FP2Immutable zOut = y.mul(z).dbl(); return zOut.iszilch() ? INFINITY : new JacobianPoint(xOut, yOut, zOut); } JacobianPoint();   JacobianPoint(JacobianPoint p);   JacobianPoint(FP2Immutable x, FP2Immutable y, FP2Immutable z);   JacobianPoint(ECP2 p); }
JacobianPoint { JacobianPoint dbl() { FP2Immutable a = x.sqr(); FP2Immutable b = y.sqr(); FP2Immutable c = b.sqr(); FP2Immutable d = x.add(b).sqr().sub(a).sub(c).dbl(); FP2Immutable e = a.mul(3); FP2Immutable f = e.sqr(); FP2Immutable xOut = f.sub(d.dbl()); FP2Immutable yOut = e.mul(d.sub(xOut)).sub(c.mul(8)); FP2Immutable zOut = y.mul(z).dbl(); return zOut.iszilch() ? INFINITY : new JacobianPoint(xOut, yOut, zOut); } JacobianPoint();   JacobianPoint(JacobianPoint p);   JacobianPoint(FP2Immutable x, FP2Immutable y, FP2Immutable z);   JacobianPoint(ECP2 p); @Override String toString(); @Override // Consider two Jacobian points to be equal iff their affine representations are equal. boolean equals(Object obj); @Override int hashCode(); }
JacobianPoint { JacobianPoint dbl() { FP2Immutable a = x.sqr(); FP2Immutable b = y.sqr(); FP2Immutable c = b.sqr(); FP2Immutable d = x.add(b).sqr().sub(a).sub(c).dbl(); FP2Immutable e = a.mul(3); FP2Immutable f = e.sqr(); FP2Immutable xOut = f.sub(d.dbl()); FP2Immutable yOut = e.mul(d.sub(xOut)).sub(c.mul(8)); FP2Immutable zOut = y.mul(z).dbl(); return zOut.iszilch() ? INFINITY : new JacobianPoint(xOut, yOut, zOut); } JacobianPoint();   JacobianPoint(JacobianPoint p);   JacobianPoint(FP2Immutable x, FP2Immutable y, FP2Immutable z);   JacobianPoint(ECP2 p); @Override String toString(); @Override // Consider two Jacobian points to be equal iff their affine representations are equal. boolean equals(Object obj); @Override int hashCode();  }