public abstract class ECCurve
extends java.lang.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 java.math.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 java.math.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() |
ECLookupTable |
createCacheSafeLookupTable(ECPoint[] points,
int off,
int len)
Create a cache-safe lookup table for the specified sequence of points.
|
protected ECMultiplier |
createDefaultMultiplier() |
ECPoint |
createPoint(java.math.BigInteger x,
java.math.BigInteger y) |
protected abstract ECPoint |
createRawPoint(ECFieldElement x,
ECFieldElement y) |
protected abstract ECPoint |
createRawPoint(ECFieldElement x,
ECFieldElement y,
ECFieldElement[] zs) |
ECPoint |
decodePoint(byte[] encoded)
Decode a point on this curve from its ASN.1 encoding.
|
protected abstract ECPoint |
decompressPoint(int yTilde,
java.math.BigInteger X1) |
boolean |
equals(ECCurve other) |
boolean |
equals(java.lang.Object obj) |
abstract ECFieldElement |
fromBigInteger(java.math.BigInteger x) |
ECFieldElement |
getA() |
int |
getAffinePointEncodingLength(boolean compressed) |
static int[] |
getAllCoordinateSystems() |
ECFieldElement |
getB() |
java.math.BigInteger |
getCofactor() |
int |
getCoordinateSystem() |
ECEndomorphism |
getEndomorphism() |
FiniteField |
getField() |
int |
getFieldElementEncodingLength() |
abstract int |
getFieldSize() |
abstract ECPoint |
getInfinity() |
ECMultiplier |
getMultiplier()
Sets the default
ECMultiplier , unless already set. |
java.math.BigInteger |
getOrder() |
PreCompInfo |
getPreCompInfo(ECPoint point,
java.lang.String name) |
int |
hashCode() |
ECPoint |
importPoint(ECPoint p) |
abstract boolean |
isValidFieldElement(java.math.BigInteger x) |
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.
|
PreCompInfo |
precompute(ECPoint point,
java.lang.String name,
PreCompCallback callback)
Compute a
PreCompInfo for a point on this curve, under a given name. |
abstract ECFieldElement |
randomFieldElement(java.security.SecureRandom r) |
abstract ECFieldElement |
randomFieldElementMult(java.security.SecureRandom r) |
boolean |
supportsCoordinateSystem(int coord) |
ECPoint |
validatePoint(java.math.BigInteger x,
java.math.BigInteger y) |
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 java.math.BigInteger order
protected java.math.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(java.math.BigInteger x)
public abstract boolean isValidFieldElement(java.math.BigInteger x)
public abstract ECFieldElement randomFieldElement(java.security.SecureRandom r)
public abstract ECFieldElement randomFieldElementMult(java.security.SecureRandom r)
public ECCurve.Config configure()
public int getFieldElementEncodingLength()
public int getAffinePointEncodingLength(boolean compressed)
public ECPoint validatePoint(java.math.BigInteger x, java.math.BigInteger y)
public ECPoint createPoint(java.math.BigInteger x, java.math.BigInteger y)
protected abstract ECCurve cloneCurve()
protected abstract ECPoint createRawPoint(ECFieldElement x, ECFieldElement y)
protected abstract ECPoint createRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs)
protected ECMultiplier createDefaultMultiplier()
public boolean supportsCoordinateSystem(int coord)
public PreCompInfo getPreCompInfo(ECPoint point, java.lang.String name)
public PreCompInfo precompute(ECPoint point, java.lang.String name, PreCompCallback callback)
PreCompInfo
for a point on this curve, under a given name. Used by
ECMultiplier
s 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.callback
- Called to calculate the PreCompInfo
.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 java.math.BigInteger getOrder()
public java.math.BigInteger getCofactor()
public int getCoordinateSystem()
protected abstract ECPoint decompressPoint(int yTilde, java.math.BigInteger X1)
public ECEndomorphism getEndomorphism()
public ECMultiplier getMultiplier()
ECMultiplier
, unless already set.
We avoid synchronizing for performance reasons, so there is no uniqueness guarantee.public ECPoint decodePoint(byte[] encoded)
Fp
(X9.62 s 4.2.1 pg 17).public ECLookupTable createCacheSafeLookupTable(ECPoint[] points, int off, int len)
ECCurve
instance, and MUST already be normalized.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(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object