protected int getCurveCoordinateSystem() { // Cope with null curve, most commonly used by implicitlyCa return null == curve ? ECCurve.COORD_AFFINE : curve.getCoordinateSystem(); }
protected int getCurveCoordinateSystem() { // Cope with null curve, most commonly used by implicitlyCa return null == curve ? ECCurve.COORD_AFFINE : curve.getCoordinateSystem(); }
protected static ECFieldElement[] getInitialZCoords(ECCurve curve) { // Cope with null curve, most commonly used by implicitlyCa int coord = null == curve ? ECCurve.COORD_AFFINE : curve.getCoordinateSystem(); switch (coord) { case ECCurve.COORD_AFFINE: case ECCurve.COORD_LAMBDA_AFFINE: return EMPTY_ZS; default: break; } ECFieldElement one = curve.fromBigInteger(ECConstants.ONE); switch (coord) { case ECCurve.COORD_HOMOGENEOUS: case ECCurve.COORD_JACOBIAN: case ECCurve.COORD_LAMBDA_PROJECTIVE: return new ECFieldElement[]{ one }; case ECCurve.COORD_JACOBIAN_CHUDNOVSKY: return new ECFieldElement[]{ one, one, one }; case ECCurve.COORD_JACOBIAN_MODIFIED: return new ECFieldElement[]{ one, curve.getA() }; default: throw new IllegalArgumentException("unknown coordinate system"); } }
protected static ECFieldElement[] getInitialZCoords(ECCurve curve) { // Cope with null curve, most commonly used by implicitlyCa int coord = null == curve ? ECCurve.COORD_AFFINE : curve.getCoordinateSystem(); switch (coord) { case ECCurve.COORD_AFFINE: case ECCurve.COORD_LAMBDA_AFFINE: return EMPTY_ZS; default: break; } ECFieldElement one = curve.fromBigInteger(ECConstants.ONE); switch (coord) { case ECCurve.COORD_HOMOGENEOUS: case ECCurve.COORD_JACOBIAN: case ECCurve.COORD_LAMBDA_PROJECTIVE: return new ECFieldElement[]{ one }; case ECCurve.COORD_JACOBIAN_CHUDNOVSKY: return new ECFieldElement[]{ one, one, one }; case ECCurve.COORD_JACOBIAN_MODIFIED: return new ECFieldElement[]{ one, curve.getA() }; default: throw new IllegalArgumentException("unknown coordinate system"); } }
protected ECCurve configureCurve(ECCurve c, int coord) { if (c.getCoordinateSystem() == coord) { return c; } if (!c.supportsCoordinateSystem(coord)) { throw new IllegalArgumentException("Coordinate system " + coord + " not supported by this curve"); } return c.configure().setCoordinateSystem(coord).create(); } }
protected ECCurve configureCurve(ECCurve c, int coord) { if (c.getCoordinateSystem() == coord) { return c; } if (!c.supportsCoordinateSystem(coord)) { throw new IllegalArgumentException("Coordinate system " + coord + " not supported by this curve"); } return c.configure().setCoordinateSystem(coord).create(); } }
public ECPoint negate() { if (this.isInfinity()) { return this; } ECCurve curve = this.getCurve(); int coord = curve.getCoordinateSystem(); if (ECCurve.COORD_AFFINE != coord) { return new ECPoint.Fp(curve, this.x, this.y.negate(), this.zs, this.withCompression); } return new ECPoint.Fp(curve, this.x, this.y.negate(), this.withCompression); }
public ECPoint negate() { if (this.isInfinity()) { return this; } ECCurve curve = this.getCurve(); int coord = curve.getCoordinateSystem(); if (ECCurve.COORD_AFFINE != coord) { return new ECPoint.Fp(curve, this.x, this.y.negate(), this.zs, this.withCompression); } return new ECPoint.Fp(curve, this.x, this.y.negate(), this.withCompression); }
switch (this.getCoordinateSystem())
switch (this.getCoordinateSystem())
public ECPoint.F2m tau() { if (this.isInfinity()) { return this; } ECCurve curve = this.getCurve(); int coord = curve.getCoordinateSystem(); ECFieldElement X1 = this.x; switch (coord) { case ECCurve.COORD_AFFINE: case ECCurve.COORD_LAMBDA_AFFINE: { ECFieldElement Y1 = this.y; return new ECPoint.F2m(curve, X1.square(), Y1.square(), this.withCompression); } case ECCurve.COORD_HOMOGENEOUS: case ECCurve.COORD_LAMBDA_PROJECTIVE: { ECFieldElement Y1 = this.y, Z1 = this.zs[0]; return new ECPoint.F2m(curve, X1.square(), Y1.square(), new ECFieldElement[]{ Z1.square() }, this.withCompression); } default: { throw new IllegalStateException("unsupported coordinate system"); } } }
public ECPoint.AbstractF2m tau() { if (this.isInfinity()) { return this; } ECCurve curve = this.getCurve(); int coord = curve.getCoordinateSystem(); ECFieldElement X1 = this.x; switch (coord) { case ECCurve.COORD_AFFINE: case ECCurve.COORD_LAMBDA_AFFINE: { ECFieldElement Y1 = this.y; return (ECPoint.AbstractF2m)curve.createRawPoint(X1.square(), Y1.square(), this.withCompression); } case ECCurve.COORD_HOMOGENEOUS: case ECCurve.COORD_LAMBDA_PROJECTIVE: { ECFieldElement Y1 = this.y, Z1 = this.zs[0]; return (ECPoint.AbstractF2m)curve.createRawPoint(X1.square(), Y1.square(), new ECFieldElement[]{ Z1.square() }, this.withCompression); } default: { throw new IllegalStateException("unsupported coordinate system"); } } }
int coord = curve.getCoordinateSystem();
public ECPoint importPoint(ECPoint p) { if (this != p.getCurve() && this.getCoordinateSystem() == COORD_JACOBIAN && !p.isInfinity()) { switch (p.getCurve().getCoordinateSystem()) { case COORD_JACOBIAN: case COORD_JACOBIAN_CHUDNOVSKY: case COORD_JACOBIAN_MODIFIED: return new ECPoint.Fp(this, fromBigInteger(p.x.toBigInteger()), fromBigInteger(p.y.toBigInteger()), new ECFieldElement[]{ fromBigInteger(p.zs[0].toBigInteger()) }, p.withCompression); default: break; } } return super.importPoint(p); }
public ECPoint importPoint(ECPoint p) { if (this != p.getCurve() && this.getCoordinateSystem() == ECCurve.COORD_JACOBIAN && !p.isInfinity()) { switch (p.getCurve().getCoordinateSystem()) { case ECCurve.COORD_JACOBIAN: case ECCurve.COORD_JACOBIAN_CHUDNOVSKY: case ECCurve.COORD_JACOBIAN_MODIFIED: return new ECPoint.Fp(this, fromBigInteger(p.x.toBigInteger()), fromBigInteger(p.y.toBigInteger()), new ECFieldElement[]{ fromBigInteger(p.zs[0].toBigInteger()) }, p.withCompression); default: break; } } return super.importPoint(p); }
ECFieldElement X = this.x, A = curve.getA(), B = curve.getB(); int coord = curve.getCoordinateSystem(); if (coord == ECCurve.COORD_LAMBDA_PROJECTIVE)
int coord = curve.getCoordinateSystem();
int coord = curve.getCoordinateSystem();
int coord = curve.getCoordinateSystem();
int coord = curve.getCoordinateSystem();