Top Description Inners Fields Constructors Methods
org.bouncycastle.math.ec

public abstract Class ECPoint

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.math.ec.ECPoint.AbstractFp, org.bouncycastle.math.ec.ECPoint.AbstractF2m
Imports
java.math.BigInteger, java.security.SecureRandom, java.util.Hashtable, org.bouncycastle.crypto.CryptoServicesRegistrar

base class for points on elliptic curves.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
public abstract static class
public static class
ECPoint.F2m

Elliptic curve points over F2m

public static class
ECPoint.Fp

Elliptic curve points over Fp

Field Summary

Modifier and TypeField and Description
protected ECCurve
protected static final ECFieldElement[]
protected Hashtable<K, V>
protected ECFieldElement
x

protected ECFieldElement
y

protected ECFieldElement[]

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public abstract ECPoint
protected void
protected ECPoint
protected abstract ECPoint
public void
encodeTo(boolean compressed, byte[] buf, int off)

public boolean
equals(ECPoint other)

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public ECFieldElement

Returns:

The affine x-coordinate of this point
getAffineXCoord
()

Returns the affine x-coordinate after checking that this point is normalized.

public ECFieldElement

Returns:

The affine y-coordinate of this point
getAffineYCoord
()

Returns the affine y-coordinate after checking that this point is normalized

protected abstract boolean
public ECCurve
protected int
public final ECPoint
public byte[]

Returns:

the point encoding
getEncoded
(boolean
whether to generate a compressed point encoding.
compressed
)

Get an encoding of the point value, optionally in compressed format.

public int
getEncodedLength(boolean compressed)

protected static ECFieldElement[]
public final ECFieldElement
public final ECFieldElement
protected final ECFieldElement[]
public ECFieldElement

Returns:

the x-coordinate of this point
getXCoord
()

Returns the x-coordinate.

public ECFieldElement

Returns:

the y-coordinate of this point
getYCoord
()

Returns the y-coordinate.

public ECFieldElement
getZCoord(int index)

public ECFieldElement[]
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

pack-priv boolean
implIsValid(final boolean decompressed, final boolean checkOrder)

public boolean
public boolean
public boolean
pack-priv boolean
public ECPoint

Returns:

k * this.
multiply
(BigInteger
The multiplicator.
k
)

Multiplies this ECPoint by the given number.

public abstract ECPoint
public ECPoint

Returns:

a new ECPoint instance representing the same point, but with normalized coordinates
normalize
()

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.

pack-priv ECPoint
protected abstract boolean
protected boolean
public ECPoint
public ECPoint
public ECPoint
public ECPoint
public abstract ECPoint
public ECPoint
public ECPoint
timesPow2(int e)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public abstract ECPoint
public ECPoint
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

curveback to summary
protected ECCurve curve
EMPTY_ZSback to summary
protected static final ECFieldElement[] EMPTY_ZS
preCompTableback to summary
protected Hashtable<K, V> preCompTable
xback to summary
protected ECFieldElement x
yback to summary
protected ECFieldElement y
zsback to summary
protected ECFieldElement[] zs

Constructor Detail

ECPointback to summary
protected ECPoint(ECCurve curve, ECFieldElement x, ECFieldElement y)
ECPointback to summary
protected ECPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs)

Method Detail

addback to summary
public abstract ECPoint add(ECPoint b)
checkNormalizedback to summary
protected void checkNormalized()
createScaledPointback to summary
protected ECPoint createScaledPoint(ECFieldElement sx, ECFieldElement sy)
detachback to summary
protected abstract ECPoint detach()
encodeToback to summary
public void encodeTo(boolean compressed, byte[] buf, int off)
equalsback to summary
public boolean equals(ECPoint other)
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getAffineXCoordback to summary
public ECFieldElement getAffineXCoord()

Returns the affine x-coordinate after checking that this point is normalized.

Returns:ECFieldElement

The affine x-coordinate of this point

Exceptions
IllegalStateException:
if the point is not normalized
getAffineYCoordback to summary
public ECFieldElement getAffineYCoord()

Returns the affine y-coordinate after checking that this point is normalized

Returns:ECFieldElement

The affine y-coordinate of this point

Exceptions
IllegalStateException:
if the point is not normalized
getCompressionYTildeback to summary
protected abstract boolean getCompressionYTilde()
getCurveback to summary
public ECCurve getCurve()
getCurveCoordinateSystemback to summary
protected int getCurveCoordinateSystem()
getDetachedPointback to summary
public final ECPoint getDetachedPoint()
getEncodedback to summary
public byte[] getEncoded(boolean compressed)

Get an encoding of the point value, optionally in compressed format.

Parameters
compressed:boolean

whether to generate a compressed point encoding.

Returns:byte[]

the point encoding

getEncodedLengthback to summary
public int getEncodedLength(boolean compressed)
getInitialZCoordsback to summary
protected static ECFieldElement[] getInitialZCoords(ECCurve curve)
getRawXCoordback to summary
public final ECFieldElement getRawXCoord()
getRawYCoordback to summary
public final ECFieldElement getRawYCoord()
getRawZCoordsback to summary
protected final ECFieldElement[] getRawZCoords()
getXCoordback to summary
public ECFieldElement getXCoord()

Returns the x-coordinate.

Caution

depending on the curve's coordinate system, this may not be the same value as in an affine coordinate system; use normalize() to get a point where the coordinates have their affine values, or use getAffineXCoord() if you expect the point to already have been normalized.

Returns:ECFieldElement

the x-coordinate of this point

getYCoordback to summary
public ECFieldElement getYCoord()

Returns the y-coordinate.

Caution

depending on the curve's coordinate system, this may not be the same value as in an affine coordinate system; use normalize() to get a point where the coordinates have their affine values, or use getAffineYCoord() if you expect the point to already have been normalized.

Returns:ECFieldElement

the y-coordinate of this point

getZCoordback to summary
public ECFieldElement getZCoord(int index)
getZCoordsback to summary
public ECFieldElement[] getZCoords()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

implIsValidback to summary
pack-priv boolean implIsValid(final boolean decompressed, final boolean checkOrder)
isInfinityback to summary
public boolean isInfinity()
isNormalizedback to summary
public boolean isNormalized()
isValidback to summary
public boolean isValid()
isValidPartialback to summary
pack-priv boolean isValidPartial()
multiplyback to summary
public ECPoint multiply(BigInteger k)

Multiplies this ECPoint by the given number.

Parameters
k:BigInteger

The multiplicator.

Returns:ECPoint

k * this.

negateback to summary
public abstract ECPoint negate()
normalizeback to summary
public ECPoint normalize()

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.

Returns:ECPoint

a new ECPoint instance representing the same point, but with normalized coordinates

normalizeback to summary
pack-priv ECPoint normalize(ECFieldElement zInv)
satisfiesCurveEquationback to summary
protected abstract boolean satisfiesCurveEquation()
satisfiesOrderback to summary
protected boolean satisfiesOrder()
scaleXback to summary
public ECPoint scaleX(ECFieldElement scale)
scaleXNegateYback to summary
public ECPoint scaleXNegateY(ECFieldElement scale)
scaleYback to summary
public ECPoint scaleY(ECFieldElement scale)
scaleYNegateXback to summary
public ECPoint scaleYNegateX(ECFieldElement scale)
subtractback to summary
public abstract ECPoint subtract(ECPoint b)
threeTimesback to summary
public ECPoint threeTimes()
timesPow2back to summary
public ECPoint timesPow2(int e)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

twiceback to summary
public abstract ECPoint twice()
twicePlusback to summary
public ECPoint twicePlus(ECPoint b)
org.bouncycastle.math.ec back to summary

public abstract Class ECPoint.AbstractF2m

extends ECPoint
Class Inheritance
Known Direct Subclasses
org.bouncycastle.math.ec.ECPoint.F2m, org.bouncycastle.math.ec.custom.sec.SecT131R2Point, org.bouncycastle.math.ec.custom.sec.SecT163K1Point, org.bouncycastle.math.ec.custom.sec.SecT163R1Point, org.bouncycastle.math.ec.custom.sec.SecT163R2Point, org.bouncycastle.math.ec.custom.sec.SecT193R1Point, org.bouncycastle.math.ec.custom.sec.SecT193R2Point, org.bouncycastle.math.ec.custom.sec.SecT233K1Point, org.bouncycastle.math.ec.custom.sec.SecT233R1Point, org.bouncycastle.math.ec.custom.sec.SecT113R1Point, org.bouncycastle.math.ec.custom.sec.SecT113R2Point, org.bouncycastle.math.ec.custom.sec.SecT239K1Point, org.bouncycastle.math.ec.custom.sec.SecT283K1Point, org.bouncycastle.math.ec.custom.sec.SecT283R1Point, org.bouncycastle.math.ec.custom.sec.SecT409K1Point, org.bouncycastle.math.ec.custom.sec.SecT409R1Point, org.bouncycastle.math.ec.custom.sec.SecT571K1Point, org.bouncycastle.math.ec.custom.sec.SecT571R1Point, org.bouncycastle.math.ec.custom.sec.SecT131R1Point

Field Summary

Inherited from org.bouncycastle.math.ec.ECPoint:
curveEMPTY_ZSpreCompTablexyzs

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
protected boolean
protected boolean
public ECPoint
public ECPoint
public ECPoint
public ECPoint
public ECPoint
public ECPoint.AbstractF2m
tau()

public ECPoint.AbstractF2m
tauPow(int pow)

Inherited from org.bouncycastle.math.ec.ECPoint:
addcheckNormalizedcreateScaledPointdetachencodeToequalsequalsgetAffineXCoordgetAffineYCoordgetCompressionYTildegetCurvegetCurveCoordinateSystemgetDetachedPointgetEncodedgetEncodedLengthgetInitialZCoordsgetRawXCoordgetRawYCoordgetRawZCoordsgetXCoordgetYCoordgetZCoordgetZCoordshashCodeimplIsValidisInfinityisNormalizedisValidisValidPartialmultiplynegatenormalizenormalizethreeTimestimesPow2toStringtwicetwicePlus

Constructor Detail

AbstractF2mback to summary
protected AbstractF2m(ECCurve curve, ECFieldElement x, ECFieldElement y)
AbstractF2mback to summary
protected AbstractF2m(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs)

Method Detail

satisfiesCurveEquationback to summary
protected boolean satisfiesCurveEquation()

Implements abstract org.bouncycastle.math.ec.ECPoint.satisfiesCurveEquation.

satisfiesOrderback to summary
protected boolean satisfiesOrder()

Overrides org.bouncycastle.math.ec.ECPoint.satisfiesOrder.

scaleXback to summary
public ECPoint scaleX(ECFieldElement scale)

Overrides org.bouncycastle.math.ec.ECPoint.scaleX.

scaleXNegateYback to summary
public ECPoint scaleXNegateY(ECFieldElement scale)

Overrides org.bouncycastle.math.ec.ECPoint.scaleXNegateY.

scaleYback to summary
public ECPoint scaleY(ECFieldElement scale)

Overrides org.bouncycastle.math.ec.ECPoint.scaleY.

scaleYNegateXback to summary
public ECPoint scaleYNegateX(ECFieldElement scale)

Overrides org.bouncycastle.math.ec.ECPoint.scaleYNegateX.

subtractback to summary
public ECPoint subtract(ECPoint b)

Implements abstract org.bouncycastle.math.ec.ECPoint.subtract.

tauback to summary
public ECPoint.AbstractF2m tau()
tauPowback to summary
public ECPoint.AbstractF2m tauPow(int pow)
org.bouncycastle.math.ec back to summary

public abstract Class ECPoint.AbstractFp

extends ECPoint
Class Inheritance
Known Direct Subclasses
org.bouncycastle.math.ec.ECPoint.Fp, org.bouncycastle.math.ec.custom.djb.Curve25519Point, org.bouncycastle.math.ec.custom.gm.SM2P256V1Point, org.bouncycastle.math.ec.custom.sec.SecP128R1Point, org.bouncycastle.math.ec.custom.sec.SecP160K1Point, org.bouncycastle.math.ec.custom.sec.SecP160R1Point, org.bouncycastle.math.ec.custom.sec.SecP160R2Point, org.bouncycastle.math.ec.custom.sec.SecP192K1Point, org.bouncycastle.math.ec.custom.sec.SecP192R1Point, org.bouncycastle.math.ec.custom.sec.SecP224K1Point, org.bouncycastle.math.ec.custom.sec.SecP224R1Point, org.bouncycastle.math.ec.custom.sec.SecP256K1Point, org.bouncycastle.math.ec.custom.sec.SecP256R1Point, org.bouncycastle.math.ec.custom.sec.SecP384R1Point, org.bouncycastle.math.ec.custom.sec.SecP521R1Point

Field Summary

Inherited from org.bouncycastle.math.ec.ECPoint:
curveEMPTY_ZSpreCompTablexyzs

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
protected boolean
protected boolean
public ECPoint
Inherited from org.bouncycastle.math.ec.ECPoint:
addcheckNormalizedcreateScaledPointdetachencodeToequalsequalsgetAffineXCoordgetAffineYCoordgetCurvegetCurveCoordinateSystemgetDetachedPointgetEncodedgetEncodedLengthgetInitialZCoordsgetRawXCoordgetRawYCoordgetRawZCoordsgetXCoordgetYCoordgetZCoordgetZCoordshashCodeimplIsValidisInfinityisNormalizedisValidisValidPartialmultiplynegatenormalizenormalizesatisfiesOrderscaleXscaleXNegateYscaleYscaleYNegateXthreeTimestimesPow2toStringtwicetwicePlus

Constructor Detail

AbstractFpback to summary
protected AbstractFp(ECCurve curve, ECFieldElement x, ECFieldElement y)
AbstractFpback to summary
protected AbstractFp(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs)

Method Detail

getCompressionYTildeback to summary
protected boolean getCompressionYTilde()

Implements abstract org.bouncycastle.math.ec.ECPoint.getCompressionYTilde.

satisfiesCurveEquationback to summary
protected boolean satisfiesCurveEquation()

Implements abstract org.bouncycastle.math.ec.ECPoint.satisfiesCurveEquation.

subtractback to summary
public ECPoint subtract(ECPoint b)

Implements abstract org.bouncycastle.math.ec.ECPoint.subtract.

org.bouncycastle.math.ec back to summary

public Class ECPoint.F2m

extends AbstractF2m
Class Inheritance

Elliptic curve points over F2m

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ECPoint
protected ECPoint
protected boolean
public ECFieldElement
getYCoord()

Overrides org.bouncycastle.math.ec.ECPoint.getYCoord.

Returns the y-coordinate.

public ECPoint
public ECPoint
public ECPoint
Inherited from org.bouncycastle.math.ec.ECPoint.AbstractF2m:
satisfiesCurveEquationsatisfiesOrderscaleXscaleXNegateYscaleYscaleYNegateXsubtracttautauPow

Constructor Detail

F2mback to summary
pack-priv F2m(ECCurve curve, ECFieldElement x, ECFieldElement y)
F2mback to summary
pack-priv F2m(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs)

Method Detail

addback to summary
public ECPoint add(ECPoint b)

Implements abstract org.bouncycastle.math.ec.ECPoint.add.

detachback to summary
protected ECPoint detach()

Implements abstract org.bouncycastle.math.ec.ECPoint.detach.

getCompressionYTildeback to summary
protected boolean getCompressionYTilde()

Implements abstract org.bouncycastle.math.ec.ECPoint.getCompressionYTilde.

getYCoordback to summary
public ECFieldElement getYCoord()

Overrides org.bouncycastle.math.ec.ECPoint.getYCoord.

Doc from org.bouncycastle.math.ec.ECPoint.getYCoord.

Returns the y-coordinate.

Caution

depending on the curve's coordinate system, this may not be the same value as in an affine coordinate system; use normalize() to get a point where the coordinates have their affine values, or use getAffineYCoord() if you expect the point to already have been normalized.

Returns:ECFieldElement

the y-coordinate of this point

negateback to summary
public ECPoint negate()

Implements abstract org.bouncycastle.math.ec.ECPoint.negate.

twiceback to summary
public ECPoint twice()

Implements abstract org.bouncycastle.math.ec.ECPoint.twice.

twicePlusback to summary
public ECPoint twicePlus(ECPoint b)

Overrides org.bouncycastle.math.ec.ECPoint.twicePlus.

org.bouncycastle.math.ec back to summary

public Class ECPoint.Fp

extends AbstractFp
Class Inheritance

Elliptic curve points over Fp

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ECPoint
protected ECFieldElement
protected ECPoint
protected ECFieldElement
protected ECFieldElement
protected ECFieldElement
protected ECFieldElement
public ECFieldElement
public ECPoint
protected ECFieldElement
public ECPoint
public ECPoint
public ECPoint
protected ECPoint.Fp
twiceJacobianModified(boolean calculateW)

public ECPoint
protected ECFieldElement
Inherited from org.bouncycastle.math.ec.ECPoint.AbstractFp:
getCompressionYTildesatisfiesCurveEquationsubtract

Constructor Detail

Fpback to summary
pack-priv Fp(ECCurve curve, ECFieldElement x, ECFieldElement y)
Fpback to summary
pack-priv Fp(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs)

Method Detail

addback to summary
public ECPoint add(ECPoint b)

Implements abstract org.bouncycastle.math.ec.ECPoint.add.

calculateJacobianModifiedWback to summary
protected ECFieldElement calculateJacobianModifiedW(ECFieldElement Z, ECFieldElement ZSquared)
detachback to summary
protected ECPoint detach()

Implements abstract org.bouncycastle.math.ec.ECPoint.detach.

doubleProductFromSquaresback to summary
protected ECFieldElement doubleProductFromSquares(ECFieldElement a, ECFieldElement b, ECFieldElement aSquared, ECFieldElement bSquared)
eightback to summary
protected ECFieldElement eight(ECFieldElement x)
fourback to summary
protected ECFieldElement four(ECFieldElement x)
getJacobianModifiedWback to summary
protected ECFieldElement getJacobianModifiedW()
getZCoordback to summary
public ECFieldElement getZCoord(int index)

Overrides org.bouncycastle.math.ec.ECPoint.getZCoord.

negateback to summary
public ECPoint negate()

Implements abstract org.bouncycastle.math.ec.ECPoint.negate.

threeback to summary
protected ECFieldElement three(ECFieldElement x)
threeTimesback to summary
public ECPoint threeTimes()

Overrides org.bouncycastle.math.ec.ECPoint.threeTimes.

timesPow2back to summary
public ECPoint timesPow2(int e)

Overrides org.bouncycastle.math.ec.ECPoint.timesPow2.

twiceback to summary
public ECPoint twice()

Implements abstract org.bouncycastle.math.ec.ECPoint.twice.

twiceJacobianModifiedback to summary
protected ECPoint.Fp twiceJacobianModified(boolean calculateW)
twicePlusback to summary
public ECPoint twicePlus(ECPoint b)

Overrides org.bouncycastle.math.ec.ECPoint.twicePlus.

twoback to summary
protected ECFieldElement two(ECFieldElement x)