protected void checkPoint(ECPoint point) { if (null == point || (this != point.getCurve())) { throw new IllegalArgumentException("'point' must be non-null and on this curve"); } }
protected void checkPoint(ECPoint point) { if (null == point || (this != point.getCurve())) { throw new IllegalArgumentException("'point' must be non-null and on this curve"); } }
public static ECPoint importPoint(ECCurve c, ECPoint p) { ECCurve cp = p.getCurve(); if (!c.equals(cp)) { throw new IllegalArgumentException("Point must be on the same curve"); } return c.importPoint(p); }
public static ECPoint importPoint(ECCurve c, ECPoint p) { ECCurve cp = p.getCurve(); if (!c.equals(cp)) { throw new IllegalArgumentException("Point must be on the same curve"); } return c.importPoint(p); }
/** * Multiplies this <code>ECPoint</code> by the given number. * @param k The multiplicator. * @return <code>k * this</code>. */ public ECPoint multiply(BigInteger k) { return this.getCurve().getMultiplier().multiply(this, k); }
/** * Multiplies this <code>ECPoint</code> by the given number. * @param k The multiplicator. * @return <code>k * this</code>. */ public ECPoint multiply(BigInteger k) { return this.getCurve().getMultiplier().multiply(this, k); }
public int getMaxOutlen() { return ((p.getCurve().getFieldSize() - (13 + log2(cofactor))) / 8) * 8; }
public static WNafPreCompInfo getWNafPreCompInfo(ECPoint p) { return getWNafPreCompInfo(p.getCurve().getPreCompInfo(p, PRECOMP_NAME)); }
public static WNafPreCompInfo getWNafPreCompInfo(ECPoint p) { return getWNafPreCompInfo(p.getCurve().getPreCompInfo(p, PRECOMP_NAME)); }
public static ECPoint cleanPoint(ECCurve c, ECPoint p) { ECCurve cp = p.getCurve(); if (!c.equals(cp)) { throw new IllegalArgumentException("Point must be on the same curve"); } return c.decodePoint(p.getEncoded(false)); }
public static ECPoint shamirsTrick(ECPoint P, BigInteger k, ECPoint Q, BigInteger l) { ECCurve cp = P.getCurve(); Q = importPoint(cp, Q); return validatePoint(implShamirsTrickJsf(P, k, Q, l)); }
public static ECPoint shamirsTrick(ECPoint P, BigInteger k, ECPoint Q, BigInteger l) { ECCurve cp = P.getCurve(); Q = importPoint(cp, Q); return implCheckResult(implShamirsTrickJsf(P, k, Q, l)); }
public int hashCode() { ECCurve c = this.getCurve(); int hc = (null == c) ? 0 : ~c.hashCode(); if (!this.isInfinity()) { // TODO Consider just requiring already normalized, to avoid silent performance degradation ECPoint p = normalize(); hc ^= p.getXCoord().hashCode() * 17; hc ^= p.getYCoord().hashCode() * 257; } return hc; }
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); }
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 importPoint(ECPoint p) { if (this == p.getCurve()) { return p; } if (p.isInfinity()) { return getInfinity(); } // TODO Default behaviour could be improved if the two curves have the same coordinate system by copying any Z coordinates. p = p.normalize(); return createPoint(p.getXCoord().toBigInteger(), p.getYCoord().toBigInteger(), p.withCompression); }