Top Description Fields Constructors Methods
java.security.spec

public Class EllipticCurve

extends Object
Class Inheritance
Imports
java.math.BigInteger

This immutable class holds the necessary values needed to represent an elliptic curve.
Author
Valerie Peng
Since
1.5
See Also
ECField, ECFieldFp, ECFieldF2m

Field Summary

Modifier and TypeField and Description
private final BigInteger
a

private final BigInteger
b

private final ECField
private final byte[]

Constructor Summary

AccessConstructor and Description
public
EllipticCurve(ECField
the finite field that this elliptic curve is over.
field
,
BigInteger
the first coefficient of this elliptic curve.
a
,
BigInteger
the second coefficient of this elliptic curve.
b
)

Creates an elliptic curve with the specified elliptic field field and the coefficients a and b.

public
EllipticCurve(ECField
the finite field that this elliptic curve is over.
field
,
BigInteger
the first coefficient of this elliptic curve.
a
,
BigInteger
the second coefficient of this elliptic curve.
b
,
byte[]
the bytes used during curve generation for later validation. Contents of this array are copied to protect against subsequent modification.
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 TypeMethod and Description
private static void
public boolean

Returns:

true if obj is an instance of EllipticCurve and the field, A, and B match, false otherwise.
equals
(Object
the object to be compared.
obj
)

Overrides java.lang.Object.equals.

Compares this elliptic curve for equality with the specified object.

public BigInteger

Returns:

the first coefficient a.
getA
()

Returns the first coefficient a of the elliptic curve.

public BigInteger

Returns:

the second coefficient b.
getB
()

Returns the second coefficient b of the elliptic curve.

public ECField

Returns:

the field field that this curve is over.
getField
()

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

public byte[]

Returns:

the seeding bytes seed. A new array is returned each time this method is called.
getSeed
()

Returns the seeding bytes seed used during curve generation.

public int

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)
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this elliptic curve.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

aback to summary
private final BigInteger a
bback to summary
private final BigInteger b
fieldback to summary
private final ECField field
seedback to summary
private final byte[] seed

Constructor Detail

EllipticCurveback to summary
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: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.

Exceptions
NullPointerException:
if field, a, or b is null.
IllegalArgumentException:
if a or b is not null and not in field.
EllipticCurveback to summary
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: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.

Exceptions
NullPointerException:
if field, a, or b is null.
IllegalArgumentException:
if a or b is not null and not in field.

Method Detail

checkValidityback to summary
private static void checkValidity(ECField field, BigInteger c, String cName)
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

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.

getAback to summary
public BigInteger getA()

Returns the first coefficient a of the elliptic curve.

Returns:BigInteger

the first coefficient a.

getBback to summary
public BigInteger getB()

Returns the second coefficient b of the elliptic curve.

Returns:BigInteger

the second coefficient b.

getFieldback to summary
public ECField getField()

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

Returns:ECField

the field field that this curve is over.

getSeedback to summary
public 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.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.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)