ECCurve (Bouncy Castle Library 1.52 API Specification)

org.bouncycastle.math.ec

## Class ECCurve

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

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

      public abstract class ECCurve
      extends java.lang.Object

  base class for an elliptic curve

- - ### Nested Class Summary

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

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ECFieldElement` | `a`
    `protected ECFieldElement` | `b`
    `protected java.math.BigInteger` | `cofactor`
    `protected int` | `coord`
    `static int` | `COORD_AFFINE`
    `static int` | `COORD_HOMOGENEOUS`
    `static int` | `COORD_JACOBIAN`
    `static int` | `COORD_JACOBIAN_CHUDNOVSKY`
    `static int` | `COORD_JACOBIAN_MODIFIED`
    `static int` | `COORD_LAMBDA_AFFINE`
    `static int` | `COORD_LAMBDA_PROJECTIVE`
    `static int` | `COORD_SKEWED`
    `protected ECEndomorphism` | `endomorphism`
    `protected FiniteField` | `field`
    `protected ECMultiplier` | `multiplier`
    `protected java.math.BigInteger` | `order`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ECCurve(FiniteField field)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkPoint(ECPoint point)`
    `protected void` | `checkPoints(ECPoint[] points)`
    `protected void` | `checkPoints(ECPoint[] points, int off, int len)`
    `protected abstract ECCurve` | `cloneCurve()`
    `ECCurve.Config` | `configure()`
    `protected ECMultiplier` | `createDefaultMultiplier()`
    `ECPoint` | `createPoint(java.math.BigInteger x, java.math.BigInteger y)`
    `ECPoint` | `createPoint(java.math.BigInteger x, java.math.BigInteger y, boolean withCompression)` Deprecated. per-point compression property will be removed, use `createPoint(BigInteger, BigInteger)` and refer `ECPoint.getEncoded(boolean)`
    `protected abstract ECPoint` | `createRawPoint(ECFieldElement x, ECFieldElement y, boolean withCompression)`
    `protected abstract ECPoint` | `createRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, boolean withCompression)`
    `ECPoint` | `decodePoint(byte[] encoded)` Decode a point on this curve from its ASN.1 encoding.
    `protected abstract ECPoint` | `decompressPoint(int yTilde, java.math.BigInteger X1)`
    `boolean` | `equals(ECCurve other)`
    `boolean` | `equals(java.lang.Object obj)`
    `abstract ECFieldElement` | `fromBigInteger(java.math.BigInteger x)`
    `ECFieldElement` | `getA()`
    `static int[]` | `getAllCoordinateSystems()`
    `ECFieldElement` | `getB()`
    `java.math.BigInteger` | `getCofactor()`
    `int` | `getCoordinateSystem()`
    `ECEndomorphism` | `getEndomorphism()`
    `FiniteField` | `getField()`
    `abstract int` | `getFieldSize()`
    `abstract ECPoint` | `getInfinity()`
    `ECMultiplier` | `getMultiplier()` Sets the default `ECMultiplier`, unless already set.
    `java.math.BigInteger` | `getOrder()`
    `PreCompInfo` | `getPreCompInfo(ECPoint point, java.lang.String name)`
    `int` | `hashCode()`
    `ECPoint` | `importPoint(ECPoint p)`
    `void` | `normalizeAll(ECPoint[] points)` 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.
    `void` | `normalizeAll(ECPoint[] points, int off, int len, ECFieldElement iso)` 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.
    `void` | `setPreCompInfo(ECPoint point, java.lang.String name, PreCompInfo preCompInfo)` Adds `PreCompInfo` for a point on this curve, under a given name.
    `boolean` | `supportsCoordinateSystem(int coord)`
    `ECPoint` | `validatePoint(java.math.BigInteger x, java.math.BigInteger y)`
    `ECPoint` | `validatePoint(java.math.BigInteger x, java.math.BigInteger y, boolean withCompression)` Deprecated. per-point compression property will be removed, use `validatePoint(BigInteger, BigInteger)` and refer `ECPoint.getEncoded(boolean)`

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

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

- - ### Field Detail

    - #### COORD_AFFINE

          public static final int COORD_AFFINE

      See Also:
        Constant Field Values

    - #### COORD_HOMOGENEOUS

          public static final int COORD_HOMOGENEOUS

      See Also:
        Constant Field Values

    - #### COORD_JACOBIAN

          public static final int COORD_JACOBIAN

      See Also:
        Constant Field Values

    - #### COORD_JACOBIAN_CHUDNOVSKY

          public static final int COORD_JACOBIAN_CHUDNOVSKY

      See Also:
        Constant Field Values

    - #### COORD_JACOBIAN_MODIFIED

          public static final int COORD_JACOBIAN_MODIFIED

      See Also:
        Constant Field Values

    - #### COORD_LAMBDA_AFFINE

          public static final int COORD_LAMBDA_AFFINE

      See Also:
        Constant Field Values

    - #### COORD_LAMBDA_PROJECTIVE

          public static final int COORD_LAMBDA_PROJECTIVE

      See Also:
        Constant Field Values

    - #### COORD_SKEWED

          public static final int COORD_SKEWED

      See Also:
        Constant Field Values

    - #### field

          protected FiniteField field

    - #### a

          protected ECFieldElement a

    - #### b

          protected ECFieldElement b

    - #### order

          protected java.math.BigInteger order

    - #### cofactor

          protected java.math.BigInteger cofactor

    - #### coord

          protected int coord

    - #### endomorphism

          protected ECEndomorphism endomorphism

    - #### multiplier

          protected ECMultiplier multiplier

  - ### Constructor Detail

    - #### ECCurve

          protected ECCurve(FiniteField field)

  - ### Method Detail

    - #### getAllCoordinateSystems

          public static int[] getAllCoordinateSystems()

    - #### getFieldSize

          public abstract int getFieldSize()

    - #### fromBigInteger

          public abstract ECFieldElement fromBigInteger(java.math.BigInteger x)

    - #### configure

          public ECCurve.Config configure()

    - #### validatePoint

          public ECPoint validatePoint(java.math.BigInteger x,
                              java.math.BigInteger y)

    - #### validatePoint

          public ECPoint validatePoint(java.math.BigInteger x,
                              java.math.BigInteger y,
                              boolean withCompression)

      Deprecated. per-point compression property will be removed, use `validatePoint(BigInteger, BigInteger)` and refer `ECPoint.getEncoded(boolean)`

    - #### createPoint

          public ECPoint createPoint(java.math.BigInteger x,
                            java.math.BigInteger y)

    - #### createPoint

          public ECPoint createPoint(java.math.BigInteger x,
                            java.math.BigInteger y,
                            boolean withCompression)

      Deprecated. per-point compression property will be removed, use `createPoint(BigInteger, BigInteger)` and refer `ECPoint.getEncoded(boolean)`

    - #### cloneCurve

          protected abstract ECCurve cloneCurve()

    - #### createRawPoint

          protected abstract ECPoint createRawPoint(ECFieldElement x,
                               ECFieldElement y,
                               boolean withCompression)

    - #### createRawPoint

          protected abstract ECPoint createRawPoint(ECFieldElement x,
                               ECFieldElement y,
                               ECFieldElement[] zs,
                               boolean withCompression)

    - #### createDefaultMultiplier

          protected ECMultiplier createDefaultMultiplier()

    - #### supportsCoordinateSystem

          public boolean supportsCoordinateSystem(int coord)

    - #### getPreCompInfo

          public PreCompInfo getPreCompInfo(ECPoint point,
                                   java.lang.String name)

    - #### setPreCompInfo

          public void setPreCompInfo(ECPoint point,
                            java.lang.String name,
                            PreCompInfo preCompInfo)

      Adds `PreCompInfo` for a point on this curve, under a given name. Used by `ECMultiplier`s to save the precomputation for this `ECPoint` for use by subsequent multiplication.
      Parameters:
        `point` - The `ECPoint` to store precomputations for.
        `name` - A `String` used to index precomputations of different types.
        `preCompInfo` - The values precomputed by the `ECMultiplier`.

    - #### importPoint

          public ECPoint importPoint(ECPoint p)

    - #### normalizeAll

          public void normalizeAll(ECPoint[] points)

      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. Where more than one point is to be normalized, this method will generally be more efficient than normalizing each point separately.
      Parameters:
        `points` - An array of points that will be updated in place with their normalized versions, where necessary

    - #### normalizeAll

          public void normalizeAll(ECPoint[] points,
                          int off,
                          int len,
                          ECFieldElement iso)

      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. Where more than one point is to be normalized, this method will generally be more efficient than normalizing each point separately. An (optional) z-scaling factor can be applied; effectively each z coordinate is scaled by this value prior to normalization (but only one actual multiplication is needed).
      Parameters:
        `points` - An array of points that will be updated in place with their normalized versions, where necessary
        `off` - The start of the range of points to normalize
        `len` - The length of the range of points to normalize
        `iso` - The (optional) z-scaling factor - can be null

    - #### getInfinity

          public abstract ECPoint getInfinity()

    - #### getField

          public FiniteField getField()

    - #### getA

          public ECFieldElement getA()

    - #### getB

          public ECFieldElement getB()

    - #### getOrder

          public java.math.BigInteger getOrder()

    - #### getCofactor

          public java.math.BigInteger getCofactor()

    - #### getCoordinateSystem

          public int getCoordinateSystem()

    - #### decompressPoint

          protected abstract ECPoint decompressPoint(int yTilde,
                                java.math.BigInteger X1)

    - #### getEndomorphism

          public ECEndomorphism getEndomorphism()

    - #### getMultiplier

          public ECMultiplier getMultiplier()

      Sets the default `ECMultiplier`, unless already set.

    - #### decodePoint

          public ECPoint decodePoint(byte[] encoded)

      Decode a point on this curve from its ASN.1 encoding. The different encodings are taken account of, including point compression for `Fp` (X9.62 s 4.2.1 pg 17).
      Returns:
        The decoded point.

    - #### checkPoint

          protected void checkPoint(ECPoint point)

    - #### checkPoints

          protected void checkPoints(ECPoint[] points)

    - #### checkPoints

          protected void checkPoints(ECPoint[] points,
                         int off,
                         int len)

    - #### equals

          public boolean equals(ECCurve other)

    - #### equals

          public boolean equals(java.lang.Object obj)

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

    - #### hashCode

          public int hashCode()

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