Class ECPoint

java.lang.Object
org.bouncycastle.math.ec.ECPoint
Direct Known Subclasses:
ECPoint.AbstractF2m, ECPoint.AbstractFp

public abstract class ECPoint extends Object
base class for points on elliptic curves.
  • Field Details Link icon

  • Constructor Details Link icon

  • Method Details Link icon

    • getInitialZCoords Link icon

      protected static ECFieldElement[] getInitialZCoords(ECCurve curve)
    • satisfiesCurveEquation Link icon

      protected abstract boolean satisfiesCurveEquation()
    • satisfiesOrder Link icon

      protected boolean satisfiesOrder()
    • getDetachedPoint Link icon

      public final ECPoint getDetachedPoint()
    • getCurve Link icon

      public ECCurve getCurve()
    • detach Link icon

      protected abstract ECPoint detach()
    • getCurveCoordinateSystem Link icon

      protected int getCurveCoordinateSystem()
    • getAffineXCoord Link icon

      public ECFieldElement getAffineXCoord()
      Returns the affine x-coordinate after checking that this point is normalized.
      Returns:
      The affine x-coordinate of this point
      Throws:
      IllegalStateException - if the point is not normalized
    • getAffineYCoord Link icon

      public ECFieldElement getAffineYCoord()
      Returns the affine y-coordinate after checking that this point is normalized
      Returns:
      The affine y-coordinate of this point
      Throws:
      IllegalStateException - if the point is not normalized
    • getXCoord Link icon

      public ECFieldElement getXCoord()
      Returns the x-coordinate. Caution: depending on the curve's coordinate system, this may not be the same value as in an affine coordinate system; use normalize() to get a point where the coordinates have their affine values, or use getAffineXCoord() if you expect the point to already have been normalized.
      Returns:
      the x-coordinate of this point
    • getYCoord Link icon

      public ECFieldElement getYCoord()
      Returns the y-coordinate. Caution: depending on the curve's coordinate system, this may not be the same value as in an affine coordinate system; use normalize() to get a point where the coordinates have their affine values, or use getAffineYCoord() if you expect the point to already have been normalized.
      Returns:
      the y-coordinate of this point
    • getZCoord Link icon

      public ECFieldElement getZCoord(int index)
    • getZCoords Link icon

      public ECFieldElement[] getZCoords()
    • getRawXCoord Link icon

      public final ECFieldElement getRawXCoord()
    • getRawYCoord Link icon

      public final ECFieldElement getRawYCoord()
    • getRawZCoords Link icon

      protected final ECFieldElement[] getRawZCoords()
    • checkNormalized Link icon

      protected void checkNormalized()
    • isNormalized Link icon

      public boolean isNormalized()
    • normalize Link icon

      public ECPoint normalize()
      Normalization ensures that any projective coordinate is 1, and therefore that the x, y coordinates reflect those of the equivalent point in an affine coordinate system.
      Returns:
      a new ECPoint instance representing the same point, but with normalized coordinates
    • createScaledPoint Link icon

      protected ECPoint createScaledPoint(ECFieldElement sx, ECFieldElement sy)
    • isInfinity Link icon

      public boolean isInfinity()
    • isValid Link icon

      public boolean isValid()
    • scaleX Link icon

      public ECPoint scaleX(ECFieldElement scale)
    • scaleXNegateY Link icon

      public ECPoint scaleXNegateY(ECFieldElement scale)
    • scaleY Link icon

      public ECPoint scaleY(ECFieldElement scale)
    • scaleYNegateX Link icon

      public ECPoint scaleYNegateX(ECFieldElement scale)
    • equals Link icon

      public boolean equals(ECPoint other)
    • equals Link icon

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • getEncoded Link icon

      public byte[] getEncoded(boolean compressed)
      Get an encoding of the point value, optionally in compressed format.
      Parameters:
      compressed - whether to generate a compressed point encoding.
      Returns:
      the point encoding
    • getEncodedLength Link icon

      public int getEncodedLength(boolean compressed)
    • encodeTo Link icon

      public void encodeTo(boolean compressed, byte[] buf, int off)
    • getCompressionYTilde Link icon

      protected abstract boolean getCompressionYTilde()
    • add Link icon

      public abstract ECPoint add(ECPoint b)
    • negate Link icon

      public abstract ECPoint negate()
    • subtract Link icon

      public abstract ECPoint subtract(ECPoint b)
    • timesPow2 Link icon

      public ECPoint timesPow2(int e)
    • twice Link icon

      public abstract ECPoint twice()
    • twicePlus Link icon

      public ECPoint twicePlus(ECPoint b)
    • threeTimes Link icon

      public ECPoint threeTimes()
    • multiply Link icon

      public ECPoint multiply(BigInteger k)
      Multiplies this ECPoint by the given number.
      Parameters:
      k - The multiplicator.
      Returns:
      k * this.