protected ECPoint detach() { return new SM2P256V1Point(null, getAffineXCoord(), getAffineYCoord()); }
public ECPoint negate() { if (this.isInfinity()) { return this; } return new SM2P256V1Point(curve, this.x, this.y.negate(), this.zs, this.withCompression); } }
public ECPoint add(ECPoint b) if (this.isInfinity()) return twice(); ECCurve curve = this.getCurve(); return this.twice(); return new SM2P256V1Point(curve, X3, Y3, zs, this.withCompression);
public ECPoint twicePlus(ECPoint b) { if (this == b) { return threeTimes(); } if (this.isInfinity()) { return b; } if (b.isInfinity()) { return twice(); } ECFieldElement Y1 = this.y; if (Y1.isZero()) { return b; } return twice().add(b); }
public ECPoint twice() if (this.isInfinity()) ECCurve curve = this.getCurve(); return new SM2P256V1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, this.withCompression);
public ECPoint threeTimes() { if (this.isInfinity() || this.y.isZero()) { return this; } // NOTE: Be careful about recursions between twicePlus and threeTimes return twice().add(this); }
protected ECPoint createRawPoint(ECFieldElement x, ECFieldElement y, boolean withCompression) { return new SM2P256V1Point(this, x, y, withCompression); }
protected ECPoint createRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, boolean withCompression) { return new SM2P256V1Point(this, x, y, zs, withCompression); }
public SM2P256V1Curve() { super(q); this.infinity = new SM2P256V1Point(this, null, null); this.a = fromBigInteger(new BigInteger(1, Hex.decode("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC"))); this.b = fromBigInteger(new BigInteger(1, Hex.decode("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93"))); this.order = new BigInteger(1, Hex.decode("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123")); this.cofactor = BigInteger.valueOf(1); this.coord = SM2P256V1_DEFAULT_COORDS; }