@Test void equalsTest() { JacobianPoint a = new JacobianPoint( new FP2Immutable( "0x0a9dd1e7e9f8c3a63ced70517af4fa36162daa78223598adc3188c32e2895c4ba5bc931ffe0ace2abeab99445a37c762", "0x1070d96414de33b6544529eaa3f34d62715470ff5562cd38795e13df55994fa73a40d019260fb58f13f3bfc96290e206"), new FP2Immutable( "0x0527a7f5355ae68984f0e5b6b6f0196b5f12b2c9c654f23775f6185153431295261e2be3fcb14b9ac7eae7af384fae09", "0x0020abd890deaba3bc09c77e55aec6bb4e7ddbcf74398fe36f2163930f9fbea5fc35c514ffdce44ccb1ae1c2dd6a444c"), new FP2Immutable( "0x0f2fd428b0be2b652deb7d922412bc082171420e723c93c43d1efe6b22acb0f7fff928f441fd09d3aab9c97acec9f579", "0x117318fc47ee37c48a854cac7b5e83a5f3a10693e200aa696d99dbd3d8721e081bf662149a67b81aa71f08c4f030959d")); JacobianPoint b = new JacobianPoint( new FP2Immutable( "0x0c8977fab5175ac2f09e5f39e29d016f11c094ef10f237d2a5e23f482d0bfb4466688527cd31685bfe481725c31462cc", "0x0b305838069012861bb63501841c91bd5bc7e1359d44cd196681fb14c03e544c22205bced326d490eb886aaa3ed52918"), new FP2Immutable( "0x172cf997b3501882861c07e852fadbf5753eb8a3e1d2ce375e6aed07cf9c1b5ff1cbf1124c6e3b0cf4607c683eafd1a4", "0x0d9dacf241a753d55cff6d45b568b716a2ad68ba29d23f92dea6e7cf6ed54e96cdac4a2b95213f93439b946ebc63349c"), new FP2Immutable( "0x05594bb289f0ebfd8fa3f020c6e1eaf4c49b97d8ccaf3470a3a02da4b3e7104778105bd6c7e0caf97206c77a8b501d4d", "0x0625151f905fad40eb0e2b9b0a46d9afe531256c6d5e39897a27d94700f037a761a741d11275180bd18e620289e02a16")); assertTrue(isOnCurve(a)); assertTrue(isOnCurve(b)); assertNotEquals(a.add(b).getZ(), b.add(a).getZ()); assertEquals(a.add(b), b.add(a)); }
@Override public boolean equals(Object obj) { if (Objects.isNull(obj)) { return false; } if (this == obj) { return true; } if (!(obj instanceof JacobianPoint)) { return false; } JacobianPoint other = (JacobianPoint) obj; JacobianPoint p1 = this.toAffine(); JacobianPoint p2 = other.toAffine(); return (p1.getX().equals(p2.getX()) && p1.getY().equals(p2.getY())); }
JacobianPoint { @Override public boolean equals(Object obj) { if (Objects.isNull(obj)) { return false; } if (this == obj) { return true; } if (!(obj instanceof JacobianPoint)) { return false; } JacobianPoint other = (JacobianPoint) obj; JacobianPoint p1 = this.toAffine(); JacobianPoint p2 = other.toAffine(); return (p1.getX().equals(p2.getX()) && p1.getY().equals(p2.getY())); } }
JacobianPoint { @Override public boolean equals(Object obj) { if (Objects.isNull(obj)) { return false; } if (this == obj) { return true; } if (!(obj instanceof JacobianPoint)) { return false; } JacobianPoint other = (JacobianPoint) obj; JacobianPoint p1 = this.toAffine(); JacobianPoint p2 = other.toAffine(); return (p1.getX().equals(p2.getX()) && p1.getY().equals(p2.getY())); } JacobianPoint();   JacobianPoint(JacobianPoint p);   JacobianPoint(FP2Immutable x, FP2Immutable y, FP2Immutable z);   JacobianPoint(ECP2 p); }
JacobianPoint { @Override public boolean equals(Object obj) { if (Objects.isNull(obj)) { return false; } if (this == obj) { return true; } if (!(obj instanceof JacobianPoint)) { return false; } JacobianPoint other = (JacobianPoint) obj; JacobianPoint p1 = this.toAffine(); JacobianPoint p2 = other.toAffine(); return (p1.getX().equals(p2.getX()) && p1.getY().equals(p2.getY())); } 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 { @Override public boolean equals(Object obj) { if (Objects.isNull(obj)) { return false; } if (this == obj) { return true; } if (!(obj instanceof JacobianPoint)) { return false; } JacobianPoint other = (JacobianPoint) obj; JacobianPoint p1 = this.toAffine(); JacobianPoint p2 = other.toAffine(); return (p1.getX().equals(p2.getX()) && p1.getY().equals(p2.getY())); } 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();  }