Class EllipticCurve

java.lang.Object
java.security.spec.EllipticCurve

public class EllipticCurve extends Object
This immutable class holds the necessary values needed to represent an elliptic curve.
Since:
1.5
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an elliptic curve with the specified elliptic field field and the coefficients a and b.
    EllipticCurve(ECField field, BigInteger a, BigInteger b, byte[] seed)
    Creates an elliptic curve with the specified elliptic field field, the coefficients a and b, and the seed used for curve generation.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares this elliptic curve for equality with the specified object.
    Returns the first coefficient a of the elliptic curve.
    Returns the second coefficient b of the elliptic curve.
    Returns the finite field field that this elliptic curve is over.
    byte[]
    Returns the seeding bytes seed used during curve generation.
    int
    Returns a hash code value for this elliptic curve.

    Methods declared in class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    Answers a string containing a concise, human-readable description of the receiver.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
  • Constructor Details

    • EllipticCurve

      public EllipticCurve(ECField field, BigInteger a, BigInteger b)
      Creates an elliptic curve with the specified elliptic field field and the coefficients a and b.
      Parameters:
      field - the finite field that this elliptic curve is over.
      a - the first coefficient of this elliptic curve.
      b - the second coefficient of this elliptic curve.
      Throws:
      NullPointerException - if field, a, or b is null.
      IllegalArgumentException - if a or b is not null and not in field.
    • EllipticCurve

      public EllipticCurve(ECField field, BigInteger a, BigInteger b, byte[] seed)
      Creates an elliptic curve with the specified elliptic field field, the coefficients a and b, and the seed used for curve generation.
      Parameters:
      field - the finite field that this elliptic curve is over.
      a - the first coefficient of this elliptic curve.
      b - the second coefficient of this elliptic curve.
      seed - the bytes used during curve generation for later validation. Contents of this array are copied to protect against subsequent modification.
      Throws:
      NullPointerException - if field, a, or b is null.
      IllegalArgumentException - if a or b is not null and not in field.
  • Method Details

    • getField

      public ECField getField()
      Returns the finite field field that this elliptic curve is over.
      Returns:
      the field field that this curve is over.
    • getA

      public BigInteger getA()
      Returns the first coefficient a of the elliptic curve.
      Returns:
      the first coefficient a.
    • getB

      public BigInteger getB()
      Returns the second coefficient b of the elliptic curve.
      Returns:
      the second coefficient b.
    • getSeed

      public byte[] getSeed()
      Returns the seeding bytes seed used during curve generation. May be null if not specified.
      Returns:
      the seeding bytes seed. A new array is returned each time this method is called.
    • equals

      public boolean equals(Object obj)
      Compares this elliptic curve for equality with the specified object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to be compared.
      Returns:
      true if obj is an instance of EllipticCurve and the field, A, and B match, false otherwise.
      See Also:
    • hashCode

      public int hashCode()
      Returns a hash code value for this elliptic curve.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value computed from the hash codes of the field, A, and B, as follows:
          (field.hashCode() << 6) + (a.hashCode() << 4) + (b.hashCode() << 2)
      
      See Also: