ECPoint (Bouncy Castle Library 1.52 API Specification)
Date: 2015-03-01

org.bouncycastle.math.ec

## Class ECPoint

- java.lang.Object
- - org.bouncycastle.math.ec.ECPoint

- Direct Known Subclasses:
    ECPoint.AbstractF2m, ECPoint.AbstractFp

      public abstract class ECPoint
      extends java.lang.Object

  base class for points on elliptic curves.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ECPoint.AbstractF2m`
    `static class` | `ECPoint.AbstractFp`
    `static class` | `ECPoint.F2m` Elliptic curve points over F2m
    `static class` | `ECPoint.Fp` Elliptic curve points over Fp

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ECCurve` | `curve`
    `protected static ECFieldElement[]` | `EMPTY_ZS`
    `protected java.util.Hashtable` | `preCompTable`
    `protected boolean` | `withCompression`
    `protected ECFieldElement` | `x`
    `protected ECFieldElement` | `y`
    `protected ECFieldElement[]` | `zs`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ECPoint(ECCurve curve, ECFieldElement x, ECFieldElement y)`
    `protected` | `ECPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract ECPoint` | `add(ECPoint b)`
    `protected void` | `checkNormalized()`
    `protected ECPoint` | `createScaledPoint(ECFieldElement sx, ECFieldElement sy)`
    `protected abstract ECPoint` | `detach()`
    `boolean` | `equals(ECPoint other)`
    `boolean` | `equals(java.lang.Object other)`
    `ECFieldElement` | `getAffineXCoord()` Returns the affine x-coordinate after checking that this point is normalized.
    `ECFieldElement` | `getAffineYCoord()` Returns the affine y-coordinate after checking that this point is normalized
    `protected abstract boolean` | `getCompressionYTilde()`
    `ECCurve` | `getCurve()`
    `protected int` | `getCurveCoordinateSystem()`
    `ECPoint` | `getDetachedPoint()`
    `byte[]` | `getEncoded()` Deprecated. per-point compression property will be removed, refer `getEncoded(boolean)`
    `byte[]` | `getEncoded(boolean compressed)` Get an encoding of the point value, optionally in compressed format.
    `protected static ECFieldElement[]` | `getInitialZCoords(ECCurve curve)`
    `protected ECFieldElement` | `getRawXCoord()`
    `protected ECFieldElement` | `getRawYCoord()`
    `protected ECFieldElement[]` | `getRawZCoords()`
    `ECFieldElement` | `getX()` Deprecated. Use getAffineXCoord(), or normalize() and getXCoord(), instead
    `ECFieldElement` | `getXCoord()` Returns the x-coordinate.
    `ECFieldElement` | `getY()` Deprecated. Use getAffineYCoord(), or normalize() and getYCoord(), instead
    `ECFieldElement` | `getYCoord()` Returns the y-coordinate.
    `ECFieldElement` | `getZCoord(int index)`
    `ECFieldElement[]` | `getZCoords()`
    `int` | `hashCode()`
    `boolean` | `isCompressed()` Deprecated. per-point compression property will be removed, refer `getEncoded(boolean)`
    `boolean` | `isInfinity()`
    `boolean` | `isNormalized()`
    `boolean` | `isValid()`
    `ECPoint` | `multiply(java.math.BigInteger k)` Multiplies this `ECPoint` by the given number.
    `abstract ECPoint` | `negate()`
    `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.
    `protected boolean` | `satisfiesCofactor()`
    `protected abstract boolean` | `satisfiesCurveEquation()`
    `ECPoint` | `scaleX(ECFieldElement scale)`
    `ECPoint` | `scaleY(ECFieldElement scale)`
    `abstract ECPoint` | `subtract(ECPoint b)`
    `ECPoint` | `threeTimes()`
    `ECPoint` | `timesPow2(int e)`
    `java.lang.String` | `toString()`
    `abstract ECPoint` | `twice()`
    `ECPoint` | `twicePlus(ECPoint b)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY_ZS

          protected static ECFieldElement[] EMPTY_ZS

    - #### curve

          protected ECCurve curve

    - #### x

          protected ECFieldElement x

    - #### y

          protected ECFieldElement y

    - #### zs

          protected ECFieldElement[] zs

    - #### withCompression

          protected boolean withCompression

    - #### preCompTable

          protected java.util.Hashtable preCompTable

  - ### Constructor Detail

    - #### ECPoint

          protected ECPoint(ECCurve curve,
                 ECFieldElement x,
                 ECFieldElement y)

    - #### ECPoint

          protected ECPoint(ECCurve curve,
                 ECFieldElement x,
                 ECFieldElement y,
                 ECFieldElement[] zs)

  - ### Method Detail

    - #### getInitialZCoords

          protected static ECFieldElement[] getInitialZCoords(ECCurve curve)

    - #### satisfiesCofactor

          protected boolean satisfiesCofactor()

    - #### satisfiesCurveEquation

          protected abstract boolean satisfiesCurveEquation()

    - #### getDetachedPoint

          public final ECPoint getDetachedPoint()

    - #### getCurve

          public ECCurve getCurve()

    - #### detach

          protected abstract ECPoint detach()

    - #### getCurveCoordinateSystem

          protected int getCurveCoordinateSystem()

    - #### getX

          public ECFieldElement getX()

      Deprecated. Use getAffineXCoord(), or normalize() and getXCoord(), instead
      Normalizes this point, and then returns the affine x-coordinate. Note: normalization can be expensive, this method is deprecated in favour of caller-controlled normalization.

    - #### getY

          public ECFieldElement getY()

      Deprecated. Use getAffineYCoord(), or normalize() and getYCoord(), instead
      Normalizes this point, and then returns the affine y-coordinate. Note: normalization can be expensive, this method is deprecated in favour of caller-controlled normalization.

    - #### getAffineXCoord

          public ECFieldElement getAffineXCoord()

      Returns the affine x-coordinate after checking that this point is normalized.
      Returns:
        The affine x-coordinate of this point
      Throws:
        `java.lang.IllegalStateException` - if the point is not normalized

    - #### getAffineYCoord

          public ECFieldElement getAffineYCoord()

      Returns the affine y-coordinate after checking that this point is normalized
      Returns:
        The affine y-coordinate of this point
      Throws:
        `java.lang.IllegalStateException` - if the point is not normalized

    - #### getXCoord

          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

          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

          public ECFieldElement getZCoord(int index)

    - #### getZCoords

          public ECFieldElement[] getZCoords()

    - #### getRawXCoord

          protected final ECFieldElement getRawXCoord()

    - #### getRawYCoord

          protected final ECFieldElement getRawYCoord()

    - #### getRawZCoords

          protected final ECFieldElement[] getRawZCoords()

    - #### checkNormalized

          protected void checkNormalized()

    - #### isNormalized

          public boolean isNormalized()

    - #### normalize

          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

          protected ECPoint createScaledPoint(ECFieldElement sx,
                                  ECFieldElement sy)

    - #### isInfinity

          public boolean isInfinity()

    - #### isCompressed

          public boolean isCompressed()

      Deprecated. per-point compression property will be removed, refer `getEncoded(boolean)`

    - #### isValid

          public boolean isValid()

    - #### scaleX

          public ECPoint scaleX(ECFieldElement scale)

    - #### scaleY

          public ECPoint scaleY(ECFieldElement scale)

    - #### equals

          public boolean equals(ECPoint other)

    - #### equals

          public boolean equals(java.lang.Object other)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getEncoded

          public byte[] getEncoded()

      Deprecated. per-point compression property will be removed, refer `getEncoded(boolean)`

    - #### getEncoded

          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

    - #### getCompressionYTilde

          protected abstract boolean getCompressionYTilde()

    - #### add

          public abstract ECPoint add(ECPoint b)

    - #### negate

          public abstract ECPoint negate()

    - #### subtract

          public abstract ECPoint subtract(ECPoint b)

    - #### timesPow2

          public ECPoint timesPow2(int e)

    - #### twice

          public abstract ECPoint twice()

    - #### twicePlus

          public ECPoint twicePlus(ECPoint b)

    - #### threeTimes

          public ECPoint threeTimes()

    - #### multiply

          public ECPoint multiply(java.math.BigInteger k)

      Multiplies this `ECPoint` by the given number.
      Parameters:
        `k` - The multiplicator.
      Returns:
        `k * this`.