Skip to content

Most visited

Recently visited

navigation

EllipticCurve

public class EllipticCurve
extends Object

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


This immutable class holds the necessary values needed to represent an elliptic curve.

See also:

Summary

Public constructors

EllipticCurve(ECField field, BigInteger a, BigInteger b)

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.

Public methods

boolean equals(Object obj)

Compares this elliptic curve for equality with the specified object.

BigInteger getA()

Returns the first coefficient a of the elliptic curve.

BigInteger getB()

Returns the second coefficient b of the elliptic curve.

ECField getField()

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

byte[] getSeed()

Returns the seeding bytes seed used during curve generation.

int hashCode()

Returns a hash code value for this elliptic curve.

Inherited methods

From class java.lang.Object

Public constructors

EllipticCurve

Added in API level 1
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 ECField: the finite field that this elliptic curve is over.
a BigInteger: the first coefficient of this elliptic curve.
b BigInteger: 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

Added in API level 1
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 ECField: the finite field that this elliptic curve is over.
a BigInteger: the first coefficient of this elliptic curve.
b BigInteger: the second coefficient of this elliptic curve.
seed byte: 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.

Public methods

equals

Added in API level 1
boolean equals (Object obj)

Compares this elliptic curve for equality with the specified object.

Parameters
obj Object: the object to be compared.
Returns
boolean true if obj is an instance of EllipticCurve and the field, A, and B match, false otherwise.

getA

Added in API level 1
BigInteger getA ()

Returns the first coefficient a of the elliptic curve.

Returns
BigInteger the first coefficient a.

getB

Added in API level 1
BigInteger getB ()

Returns the second coefficient b of the elliptic curve.

Returns
BigInteger the second coefficient b.

getField

Added in API level 1
ECField getField ()

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

Returns
ECField the field field that this curve is over.

getSeed

Added in API level 1
byte[] getSeed ()

Returns the seeding bytes seed used during curve generation. May be null if not specified.

Returns
byte[] the seeding bytes seed. A new array is returned each time this method is called.

hashCode

Added in API level 1
int hashCode ()

Returns a hash code value for this elliptic curve.

Returns
int 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)
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.