# EllipticCurve

public class **EllipticCurve** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
This immutable class holds the necessary values needed to represent
an elliptic curve.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECField.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECFieldFp.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECFieldF2m.html`

### Public Constructor Summary

|---|---|
|   | [EllipticCurve](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EllipticCurve.html#EllipticCurve(java.security.spec.ECField,%20java.math.BigInteger,%20java.math.BigInteger))([ECField](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECField.html) field, BigInteger a, BigInteger b) Creates an elliptic curve with the specified elliptic field `field` and the coefficients `a` and `b`. |
|   | [EllipticCurve](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EllipticCurve.html#EllipticCurve(java.security.spec.ECField,%20java.math.BigInteger,%20java.math.BigInteger,%20byte[]))([ECField](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECField.html) 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. |

### Public Method Summary

|---|---|
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EllipticCurve.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this elliptic curve for equality with the specified object. |
| BigInteger | [getA](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EllipticCurve.html#getA())() Returns the first coefficient `a` of the elliptic curve. |
| BigInteger | [getB](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EllipticCurve.html#getB())() Returns the second coefficient `b` of the elliptic curve. |
| [ECField](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECField.html) | [getField](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EllipticCurve.html#getField())() Returns the finite field `field` that this elliptic curve is over. |
| byte\[\] | [getSeed](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EllipticCurve.html#getSeed())() Returns the seeding bytes `seed` used during curve generation. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/EllipticCurve.html#hashCode())() Returns a hash code value for this elliptic curve. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**EllipticCurve**
([ECField](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECField.html) 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if `field`, `a`, or `b` is null. |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if `a` or `b` is not null and not in `field`. |
|---|---|

#### public
**EllipticCurve**
([ECField](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECField.html) 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](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | if `field`, `a`, or `b` is null. |
| [IllegalArgumentException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalArgumentException.html) | if `a` or `b` is not null and not in `field`. |
|---|---|

## Public Methods

#### public boolean
**equals**
([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj)

Compares this elliptic curve for equality with the
specified 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.

#### public BigInteger
**getA**
()

Returns the first coefficient `a` of the
elliptic curve.

##### Returns

- the first coefficient `a`.

#### public BigInteger
**getB**
()

Returns the second coefficient `b` of the
elliptic curve.

##### Returns

- the second coefficient `b`.

#### public [ECField](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/spec/ECField.html)
**getField**
()

Returns the finite field `field` that this
elliptic curve is over.

##### Returns

- the field `field` that this curve is over.

#### 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.

#### public int
**hashCode**
()

Returns a hash code value for this elliptic curve.

##### 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)