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 classstatic classclassstatic classElliptic curves over F2m.static classElliptic curve over Fp -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ECFieldElementprotected ECFieldElementprotected BigIntegerprotected intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprotected ECEndomorphismprotected FiniteFieldprotected ECMultiplierprotected BigInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckPoint(ECPoint point) protected voidcheckPoints(ECPoint[] points) protected voidcheckPoints(ECPoint[] points, int off, int len) protected abstract ECCurvecreateCacheSafeLookupTable(ECPoint[] points, int off, int len) Create a cache-safe lookup table for the specified sequence of points.protected ECMultipliercreatePoint(BigInteger x, BigInteger y) protected abstract ECPointprotected abstract ECPointcreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs) decodePoint(byte[] encoded) Decode a point on this curve from its ASN.1 encoding.protected abstract ECPointdecompressPoint(int yTilde, BigInteger X1) booleanbooleanabstract ECFieldElementgetA()static int[]getB()intgetField()abstract intabstract ECPointSets the defaultECMultiplier, unless already set.getOrder()getPreCompInfo(ECPoint point, String name) inthashCode()abstract booleanvoidnormalizeAll(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.voidnormalizeAll(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 aPreCompInfofor a point on this curve, under a given name.abstract ECFieldElementabstract ECFieldElementbooleansupportsCoordinateSystem(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
-
validatePoint
-
createPoint
-
cloneCurve
-
createRawPoint
-
createRawPoint
-
createDefaultMultiplier
-
supportsCoordinateSystem
public boolean supportsCoordinateSystem(int coord) -
getPreCompInfo
-
precompute
Compute aPreCompInfofor a point on this curve, under a given name. Used byECMultipliers to save the precomputation for thisECPointfor use by subsequent multiplication.- Parameters:
point- TheECPointto store precomputations for.name- AStringused 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. -
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 thisECCurveinstance, and MUST already be normalized. -
checkPoint
-
checkPoints
-
checkPoints
-
equals
-
equals
-
hashCode
public int hashCode()
-