public ECPoint lookup(int index) { byte[] x = new byte[FE_BYTES], y = new byte[FE_BYTES]; int pos = 0; for (int i = 0; i < len; ++i) { int MASK = ((i ^ index) - 1) >> 31; for (int j = 0; j < FE_BYTES; ++j) { x[j] ^= table[pos + j] & MASK; y[j] ^= table[pos + FE_BYTES + j] & MASK; } pos += (FE_BYTES * 2); } return createRawPoint(fromBigInteger(new BigInteger(1, x)), fromBigInteger(new BigInteger(1, y)), false); } };
/** * @deprecated per-point compression property will be removed, use {@link #createPoint(BigInteger, BigInteger)} * and refer {@link ECPoint#getEncoded(boolean)} */ public ECPoint createPoint(BigInteger x, BigInteger y, boolean withCompression) { return createRawPoint(fromBigInteger(x), fromBigInteger(y), withCompression); }
/** * @deprecated per-point compression property will be removed, use {@link #createPoint(BigInteger, BigInteger)} * and refer {@link ECPoint#getEncoded(boolean)} */ public ECPoint createPoint(BigInteger x, BigInteger y, boolean withCompression) { return createRawPoint(fromBigInteger(x), fromBigInteger(y), withCompression); }
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"); } } }
protected ECPoint createScaledPoint(ECFieldElement sx, ECFieldElement sy) { return this.getCurve().createRawPoint(getRawXCoord().multiply(sx), getRawYCoord().multiply(sy), this.withCompression); }
protected ECPoint createScaledPoint(ECFieldElement sx, ECFieldElement sy) { return this.getCurve().createRawPoint(getRawXCoord().multiply(sx), getRawYCoord().multiply(sy), this.withCompression); }
return (ECPoint.AbstractF2m)curve.createRawPoint(X1.squarePow(pow), Y1.squarePow(pow), this.withCompression); return (ECPoint.AbstractF2m)curve.createRawPoint(X1.squarePow(pow), Y1.squarePow(pow), new ECFieldElement[]{ Z1.squarePow(pow) }, this.withCompression);
public ECPoint scaleY(ECFieldElement scale) { return isInfinity() ? this : getCurve().createRawPoint(getRawXCoord(), getRawYCoord().multiply(scale), getRawZCoords(), this.withCompression); }
public ECPoint scaleX(ECFieldElement scale) { return isInfinity() ? this : getCurve().createRawPoint(getRawXCoord().multiply(scale), getRawYCoord(), getRawZCoords(), this.withCompression); }
public ECPoint scaleX(ECFieldElement scale) { return isInfinity() ? this : getCurve().createRawPoint(getRawXCoord().multiply(scale), getRawYCoord(), getRawZCoords(), this.withCompression); }
public ECPoint scaleY(ECFieldElement scale) { return isInfinity() ? this : getCurve().createRawPoint(getRawXCoord(), getRawYCoord().multiply(scale), getRawZCoords(), this.withCompression); }
public ECPoint scaleY(ECFieldElement scale) { if (this.isInfinity()) { return this; } int coord = this.getCurveCoordinateSystem(); switch (coord) { case ECCurve.COORD_LAMBDA_AFFINE: case ECCurve.COORD_LAMBDA_PROJECTIVE: { ECFieldElement X = this.getRawXCoord(), L = this.getRawYCoord(); // earlier JDK // Y is actually Lambda (X + Y/X) here ECFieldElement L2 = L.add(X).multiply(scale).add(X); return this.getCurve().createRawPoint(X, L2, this.getRawZCoords(), this.withCompression); // earlier JDK } default: { return super.scaleY(scale); } } }
public ECPoint scaleY(ECFieldElement scale) { if (this.isInfinity()) { return this; } int coord = this.getCurveCoordinateSystem(); switch (coord) { case ECCurve.COORD_LAMBDA_AFFINE: case ECCurve.COORD_LAMBDA_PROJECTIVE: { ECFieldElement X = this.getRawXCoord(), L = this.getRawYCoord(); // earlier JDK // Y is actually Lambda (X + Y/X) here ECFieldElement L2 = L.add(X).multiply(scale).add(X); return this.getCurve().createRawPoint(X, L2, this.getRawZCoords(), this.withCompression); // earlier JDK } default: { return super.scaleY(scale); } } }
ECFieldElement L2 = L.add(X).divide(scale).add(X2); return this.getCurve().createRawPoint(X, L2, this.getRawZCoords(), this.withCompression); // earlier JDK ECFieldElement Z2 = Z.multiply(scale); return this.getCurve().createRawPoint(X2, L2, new ECFieldElement[]{ Z2 }, this.withCompression); // earlier JDK
ECFieldElement L2 = L.add(X).divide(scale).add(X2); return this.getCurve().createRawPoint(X, L2, this.getRawZCoords(), this.withCompression); // earlier JDK ECFieldElement Z2 = Z.multiply(scale); return this.getCurve().createRawPoint(X2, L2, new ECFieldElement[]{ Z2 }, this.withCompression); // earlier JDK