Package org.bouncycastle.math.ec
Class ECCurve
java.lang.Object
org.bouncycastle.math.ec.ECCurve
- Direct Known Subclasses:
ECCurve.AbstractF2m
,ECCurve.AbstractFp
base class for an elliptic curve
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
class
static class
Elliptic curves over F2m.static class
Elliptic curve over Fp -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ECFieldElement
protected ECFieldElement
protected BigInteger
protected int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected ECEndomorphism
protected FiniteField
protected ECMultiplier
protected BigInteger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkPoint
(ECPoint point) protected void
checkPoints
(ECPoint[] points) protected void
checkPoints
(ECPoint[] points, int off, int len) protected abstract ECCurve
createCacheSafeLookupTable
(ECPoint[] points, int off, int len) Create a cache-safe lookup table for the specified sequence of points.protected ECMultiplier
createPoint
(BigInteger x, BigInteger y) protected abstract ECPoint
protected abstract ECPoint
createRawPoint
(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) decodePoint
(byte[] encoded) Decode a point on this curve from its ASN.1 encoding.protected abstract ECPoint
decompressPoint
(int yTilde, BigInteger X1) boolean
boolean
abstract ECFieldElement
getA()
int
getAffinePointEncodingLength
(boolean compressed) static int[]
getB()
int
getField()
int
abstract int
abstract ECPoint
Sets the defaultECMultiplier
, unless already set.getOrder()
getPreCompInfo
(ECPoint point, String name) int
hashCode()
abstract boolean
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.precompute
(ECPoint point, String name, PreCompCallback callback) Compute aPreCompInfo
for a point on this curve, under a given name.abstract ECFieldElement
abstract ECFieldElement
boolean
supportsCoordinateSystem
(int coord)
-
Field Details
-
COORD_AFFINE
public static final int COORD_AFFINE- See Also:
-
COORD_HOMOGENEOUS
public static final int COORD_HOMOGENEOUS- See Also:
-
COORD_JACOBIAN
public static final int COORD_JACOBIAN- See Also:
-
COORD_JACOBIAN_CHUDNOVSKY
public static final int COORD_JACOBIAN_CHUDNOVSKY- See Also:
-
COORD_JACOBIAN_MODIFIED
public static final int COORD_JACOBIAN_MODIFIED- See Also:
-
COORD_LAMBDA_AFFINE
public static final int COORD_LAMBDA_AFFINE- See Also:
-
COORD_LAMBDA_PROJECTIVE
public static final int COORD_LAMBDA_PROJECTIVE- See Also:
-
COORD_SKEWED
public static final int COORD_SKEWED- See Also:
-
field
-
a
-
b
-
order
-
cofactor
-
coord
protected int coord -
endomorphism
-
multiplier
-
-
Constructor Details
-
ECCurve
-
-
Method Details
-
getAllCoordinateSystems
public static int[] getAllCoordinateSystems() -
getFieldSize
public abstract int getFieldSize() -
fromBigInteger
-
isValidFieldElement
-
randomFieldElement
-
randomFieldElementMult
-
configure
-
getFieldElementEncodingLength
public int getFieldElementEncodingLength() -
getAffinePointEncodingLength
public int getAffinePointEncodingLength(boolean compressed) -
validatePoint
-
createPoint
-
cloneCurve
-
createRawPoint
-
createRawPoint
-
createDefaultMultiplier
-
supportsCoordinateSystem
public boolean supportsCoordinateSystem(int coord) -
getPreCompInfo
-
precompute
Compute aPreCompInfo
for a point on this curve, under a given name. Used byECMultiplier
s to save the precomputation for thisECPoint
for use by subsequent multiplication.- Parameters:
point
- TheECPoint
to store precomputations for.name
- AString
used to index precomputations of different types.callback
- Called to calculate thePreCompInfo
.
-
importPoint
-
normalizeAll
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. Where more than one point is to be normalized, this method will generally be more efficient than normalizing each point separately.- Parameters:
points
- An array of points that will be updated in place with their normalized versions, where necessary
-
normalizeAll
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. Where more than one point is to be normalized, this method will generally be more efficient than normalizing each point separately. An (optional) z-scaling factor can be applied; effectively each z coordinate is scaled by this value prior to normalization (but only one actual multiplication is needed).- Parameters:
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 null
-
getInfinity
-
getField
-
getA
-
getB
-
getOrder
-
getCofactor
-
getCoordinateSystem
public int getCoordinateSystem() -
decompressPoint
-
getEndomorphism
-
getMultiplier
Sets the defaultECMultiplier
, unless already set. We avoid synchronizing for performance reasons, so there is no uniqueness guarantee. -
decodePoint
Decode a point on this curve from its ASN.1 encoding. The different encodings are taken account of, including point compression forFp
(X9.62 s 4.2.1 pg 17).- Returns:
- The decoded point.
-
createCacheSafeLookupTable
Create a cache-safe lookup table for the specified sequence of points. All the points MUST belong to thisECCurve
instance, and MUST already be normalized. -
checkPoint
-
checkPoints
-
checkPoints
-
equals
-
equals
-
hashCode
public int hashCode()
-