public abstract class ECCurve extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ECCurve.AbstractF2m |
static class |
ECCurve.AbstractFp |
class |
ECCurve.Config |
static class |
ECCurve.F2m
Elliptic curves over F2m.
|
static class |
ECCurve.Fp
Elliptic curve over Fp
|
| Modifier and Type | Field and Description |
|---|---|
protected ECFieldElement |
a |
protected ECFieldElement |
b |
protected BigInteger |
cofactor |
protected int |
coord |
static int |
COORD_AFFINE |
static int |
COORD_HOMOGENEOUS |
static int |
COORD_JACOBIAN |
static int |
COORD_JACOBIAN_CHUDNOVSKY |
static int |
COORD_JACOBIAN_MODIFIED |
static int |
COORD_LAMBDA_AFFINE |
static int |
COORD_LAMBDA_PROJECTIVE |
static int |
COORD_SKEWED |
protected ECEndomorphism |
endomorphism |
protected FiniteField |
field |
protected ECMultiplier |
multiplier |
protected BigInteger |
order |
| Modifier | Constructor and Description |
|---|---|
protected |
ECCurve(FiniteField field) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkPoint(ECPoint point) |
protected void |
checkPoints(ECPoint[] points) |
protected void |
checkPoints(ECPoint[] points,
int off,
int len) |
protected abstract ECCurve |
cloneCurve() |
ECCurve.Config |
configure() |
protected ECMultiplier |
createDefaultMultiplier() |
ECPoint |
createPoint(BigInteger x,
BigInteger y) |
ECPoint |
createPoint(BigInteger x,
BigInteger y,
boolean withCompression)
Deprecated.
per-point compression property will be removed, use
createPoint(BigInteger, BigInteger)
and refer ECPoint.getEncoded(boolean) |
protected abstract ECPoint |
createRawPoint(ECFieldElement x,
ECFieldElement y,
boolean withCompression) |
protected abstract ECPoint |
createRawPoint(ECFieldElement x,
ECFieldElement y,
ECFieldElement[] zs,
boolean withCompression) |
ECPoint |
decodePoint(byte[] encoded)
Decode a point on this curve from its ASN.1 encoding.
|
protected abstract ECPoint |
decompressPoint(int yTilde,
BigInteger X1) |
boolean |
equals(ECCurve other) |
boolean |
equals(Object obj)
Compares this instance with the specified object and indicates if they
are equal.
|
abstract ECFieldElement |
fromBigInteger(BigInteger x) |
ECFieldElement |
getA() |
static int[] |
getAllCoordinateSystems() |
ECFieldElement |
getB() |
BigInteger |
getCofactor() |
int |
getCoordinateSystem() |
ECEndomorphism |
getEndomorphism() |
FiniteField |
getField() |
abstract int |
getFieldSize() |
abstract ECPoint |
getInfinity() |
ECMultiplier |
getMultiplier()
Sets the default
ECMultiplier, unless already set. |
BigInteger |
getOrder() |
PreCompInfo |
getPreCompInfo(ECPoint point,
String name) |
int |
hashCode()
Returns an integer hash code for this object.
|
ECPoint |
importPoint(ECPoint p) |
void |
normalizeAll(ECPoint[] points)
Normalization ensures that any projective coordinate is 1, and therefore that the x, y
coordinates reflect those of the equivalent point in an affine coordinate system.
|
void |
normalizeAll(ECPoint[] points,
int off,
int len,
ECFieldElement iso)
Normalization ensures that any projective coordinate is 1, and therefore that the x, y
coordinates reflect those of the equivalent point in an affine coordinate system.
|
void |
setPreCompInfo(ECPoint point,
String name,
PreCompInfo preCompInfo)
Adds
PreCompInfo for a point on this curve, under a given name. |
boolean |
supportsCoordinateSystem(int coord) |
ECPoint |
validatePoint(BigInteger x,
BigInteger y) |
ECPoint |
validatePoint(BigInteger x,
BigInteger y,
boolean withCompression)
Deprecated.
per-point compression property will be removed, use
validatePoint(BigInteger, BigInteger)
and refer ECPoint.getEncoded(boolean) |
public static final int COORD_AFFINE
public static final int COORD_HOMOGENEOUS
public static final int COORD_JACOBIAN
public static final int COORD_JACOBIAN_CHUDNOVSKY
public static final int COORD_JACOBIAN_MODIFIED
public static final int COORD_LAMBDA_AFFINE
public static final int COORD_LAMBDA_PROJECTIVE
public static final int COORD_SKEWED
protected FiniteField field
protected ECFieldElement a
protected ECFieldElement b
protected BigInteger order
protected BigInteger cofactor
protected int coord
protected ECEndomorphism endomorphism
protected ECMultiplier multiplier
protected ECCurve(FiniteField field)
public static int[] getAllCoordinateSystems()
public abstract int getFieldSize()
public abstract ECFieldElement fromBigInteger(BigInteger x)
public ECCurve.Config configure()
public ECPoint validatePoint(BigInteger x, BigInteger y)
public ECPoint validatePoint(BigInteger x, BigInteger y, boolean withCompression)
validatePoint(BigInteger, BigInteger)
and refer ECPoint.getEncoded(boolean)public ECPoint createPoint(BigInteger x, BigInteger y)
public ECPoint createPoint(BigInteger x, BigInteger y, boolean withCompression)
createPoint(BigInteger, BigInteger)
and refer ECPoint.getEncoded(boolean)protected abstract ECCurve cloneCurve()
protected abstract ECPoint createRawPoint(ECFieldElement x, ECFieldElement y, boolean withCompression)
protected abstract ECPoint createRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, boolean withCompression)
protected ECMultiplier createDefaultMultiplier()
public boolean supportsCoordinateSystem(int coord)
public PreCompInfo getPreCompInfo(ECPoint point, String name)
public void setPreCompInfo(ECPoint point, String name, PreCompInfo preCompInfo)
PreCompInfo for a point on this curve, under a given name. Used by
ECMultipliers to save the precomputation for this ECPoint for use
by subsequent multiplication.point - The ECPoint to store precomputations for.name - A String used to index precomputations of different types.preCompInfo - The values precomputed by the ECMultiplier.public void normalizeAll(ECPoint[] points)
points - An array of points that will be updated in place with their normalized versions,
where necessarypublic void normalizeAll(ECPoint[] points, int off, int len, ECFieldElement iso)
points - An array of points that will be updated in place with their normalized versions,
where necessaryoff - The start of the range of points to normalizelen - The length of the range of points to normalizeiso - The (optional) z-scaling factor - can be nullpublic abstract ECPoint getInfinity()
public FiniteField getField()
public ECFieldElement getA()
public ECFieldElement getB()
public BigInteger getOrder()
public BigInteger getCofactor()
public int getCoordinateSystem()
protected abstract ECPoint decompressPoint(int yTilde, BigInteger X1)
public ECEndomorphism getEndomorphism()
public ECMultiplier getMultiplier()
ECMultiplier, unless already set.public ECPoint decodePoint(byte[] encoded)
Fp (X9.62 s 4.2.1 pg 17).protected void checkPoint(ECPoint point)
protected void checkPoints(ECPoint[] points)
protected void checkPoints(ECPoint[] points, int off, int len)
public boolean equals(ECCurve other)
public boolean equals(Object obj)
Objecto must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true only if this ==
o. See Writing a correct
equals method
if you intend implementing your own equals method.
The general contract for the equals and Object.hashCode() methods is that if equals returns true for
any two objects, then hashCode() must return the same value for
these objects. This means that subclasses of Object usually
override either both methods or neither of them.
equals in class Objectobj - the object to compare this instance with.true if the specified object is equal to this Object; false otherwise.Object.hashCode()public int hashCode()
ObjectObject.equals(java.lang.Object) returns true must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode method
if you intend implementing your own hashCode method.
hashCode in class ObjectObject.equals(java.lang.Object)