- 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:
ECField
,ECFieldFp
,ECFieldF2m
-
-
Constructor Summary
Constructors Constructor and Description EllipticCurve(ECField field, BigInteger a, BigInteger b)
Creates an elliptic curve with the specified elliptic fieldfield
and the coefficientsa
andb
.EllipticCurve(ECField field, BigInteger a, BigInteger b, byte[] seed)
Creates an elliptic curve with the specified elliptic fieldfield
, the coefficientsa
andb
, and theseed
used for curve generation.
-
Method Summary
Methods Modifier and Type Method and Description boolean
equals(Object obj)
Compares this elliptic curve for equality with the specified object.BigInteger
getA()
Returns the first coefficienta
of the elliptic curve.BigInteger
getB()
Returns the second coefficientb
of the elliptic curve.ECField
getField()
Returns the finite fieldfield
that this elliptic curve is over.byte[]
getSeed()
Returns the seeding bytesseed
used during curve generation.int
hashCode()
Returns a hash code value for this elliptic curve.
-
-
-
Constructor Detail
-
EllipticCurve
public EllipticCurve(ECField field, BigInteger a, BigInteger b)
Creates an elliptic curve with the specified elliptic fieldfield
and the coefficientsa
andb
.- 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
- iffield
,a
, orb
is null.IllegalArgumentException
- ifa
orb
is not null and not infield
.
-
EllipticCurve
public EllipticCurve(ECField field, BigInteger a, BigInteger b, byte[] seed)
Creates an elliptic curve with the specified elliptic fieldfield
, the coefficientsa
andb
, and theseed
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
- iffield
,a
, orb
is null.IllegalArgumentException
- ifa
orb
is not null and not infield
.
-
-
Method Detail
-
getField
public ECField getField()
Returns the finite fieldfield
that this elliptic curve is over.- Returns:
- the field
field
that this curve is over.
-
getA
public BigInteger getA()
Returns the first coefficienta
of the elliptic curve.- Returns:
- the first coefficient
a
.
-
getB
public BigInteger getB()
Returns the second coefficientb
of the elliptic curve.- Returns:
- the second coefficient
b
.
-
getSeed
public byte[] getSeed()
Returns the seeding bytesseed
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 classObject
- 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:
Object.hashCode()
,HashMap
-
hashCode
public int hashCode()
Returns a hash code value for this elliptic curve.- Overrides:
hashCode
in classObject
- 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:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/11/2024 21:47:44 Cette version de la page est en cache (à la date du 21/11/2024 21:47:44) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 30/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-java/security/spec/ellipticcurve.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.