public final class ECPoint extends Object implements Cloneable
Note that (almost) all methods in this class work in-place. So, there is no guarantee that values input to methods in this class will not be overridden. In case of doubt and if values need to be reused, always clone the value, before inputting it to a method.
EllipticCurve
,
Coordinate
Modifier and Type | Method and Description |
---|---|
ECPoint |
addPoint(ECPoint b)
Computes
this += b . |
static void |
allFunctionsInPlace(boolean value)
Switch to set if all functions should work in-place.
|
ECPoint |
clone() |
ECPoint |
doublePoint()
Computes
this *= 2 . |
byte[] |
encodePoint()
Encodes this point, i.e.
|
byte[] |
encodePoint(PointEncoders encoder)
Encodes this point, i.e.
|
boolean |
equals(Object obj)
This method compares two different
ECPoint instances. |
Coordinate |
getCoordinate()
Returns the coordinates of this point.
|
EllipticCurve |
getCurve()
Returns the curve on which this point is defined.
|
int |
hashCode() |
boolean |
isNeutralPoint()
Returns true, iff
this is the neutral element. |
boolean |
isScaled()
Checks whether this point is scaled, i.e.
|
ECPoint |
mixedAddPoint(ECPoint b)
Computes
this += b , where b is either scaled or
given in affine coordinates. |
ECPoint |
mixedSubtractPoint(ECPoint b)
Computes
this -= b , where b is either scaled or
given in affine coordinates. |
ECPoint |
multiplyPoint(BigInteger k)
Computes
this *= k . |
ECPoint |
negatePoint()
Negates this point, i.e.
|
ECPoint |
scalePoint()
Scales
this , i.e. |
ECPoint |
setNeutralPoint()
Sets
this to the neutral element. |
ECPoint |
subtractPoint(ECPoint b)
Computes
this -= b . |
ECPoint |
toJDKECPoint()
Converts this point to a point of the class
ECPoint . |
String |
toString() |
public EllipticCurve getCurve()
public ECPoint addPoint(ECPoint b)
this += b
.b
- the addendthis
holding the sumpublic ECPoint mixedAddPoint(ECPoint b)
this += b
, where b
is either scaled or
given in affine coordinates.
This function is only in-place if workInPlace
is set to true.b
- the addendthis
holding the sumpublic ECPoint subtractPoint(ECPoint b)
this -= b
.b
- the subtrahendthis
holding the differencepublic ECPoint negatePoint()
this = -this
.this
public ECPoint mixedSubtractPoint(ECPoint b)
this -= b
, where b
is either scaled or
given in affine coordinates.b
- the subtrahendpublic ECPoint doublePoint()
this *= 2
.this
public ECPoint multiplyPoint(BigInteger k)
this *= k
. It is assumed that k
is a
scalar modulo the order of the curve group.
This function is only in-place if workInPlace
is set to true.k
- the scalarthis
public ECPoint scalePoint()
this
, i.e. returns the according point with
Z=1
.this
public boolean isScaled()
this
is scaled.public Coordinate getCoordinate()
scalePoint()
before
obtaining the coordinates.Coordinate
object holding the coordinatespublic boolean isNeutralPoint()
this
is the neutral element.this
is the neutral elementpublic ECPoint setNeutralPoint()
this
to the neutral element.this
instancepublic ECPoint toJDKECPoint()
ECPoint
.public byte[] encodePoint(PointEncoders encoder)
byte[]
. The user can
choose between point compression (if the IAIK ECCelerate™ Addon is
available) and non-compressed encoding.encoder
- the point encoding algorithm to be usedbyte[]
representing the encoded pointpublic byte[] encodePoint()
byte[]
using the
default point encoding mechanism.byte[]
representing the encoded pointpublic static void allFunctionsInPlace(boolean value)
value
- if set to true, all Functions work in-place.
Default value is falseCopyright © 2011–2022 Stiftung SIC. All rights reserved.