|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--de.flexiprovider.common.math.ellipticcurves.Point
|
+--de.flexiprovider.common.math.ellipticcurves.PointGFP
This class implements points and their arithmetic on elliptic curves over finite prime fields (GF(p)). For more information on the arithmetic see for example Certicom online- tutorial.
EllipticCurveGFP,
PointGFP| Fields inherited from class de.flexiprovider.common.math.ellipticcurves.Point |
ENCODING_TYPE_COMPRESSED, ENCODING_TYPE_HYBRID, ENCODING_TYPE_UNCOMPRESSED, mE, mP |
| Constructor Summary | |
PointGFP(byte[] encoded,
EllipticCurveGFP E)
Constructs a new point. |
|
PointGFP(EllipticCurveGFP E)
Construct the point at infinity on the specified elliptic curve. |
|
PointGFP(EllipticCurveGFP E,
java.util.Random rand)
Construct a random point on the specified elliptic curve using the given source of randomness. |
|
PointGFP(GFPElement x,
GFPElement y,
EllipticCurveGFP E)
Constructs point with specified parameters. |
|
PointGFP(GFPElement x,
GFPElement y,
GFPElement z,
EllipticCurveGFP E)
Constructs point with specified parameters. |
|
PointGFP(PointGFP other)
Copy constructor. |
|
| Method Summary | |
Point |
add(Point other)
Adds to this point other. |
Point |
addAffine(Point other)
Adds in affine coordinates to this point the point other. |
void |
addToThis(Point other)
Adds to this point other. |
java.lang.Object |
clone()
|
(package private) byte[] |
encodeCompressed()
Returns this point in affine, compressed form as a byte array. |
(package private) byte[] |
encodeHybrid()
Returns this point in affine, hybrid form as a byte array. |
(package private) byte[] |
encodeUncompressed()
Returns this point in affine, decompressed form as a byte array. |
boolean |
equals(java.lang.Object other)
Tests whether this Point is equal to other. |
Point |
getAffin()
Returns this point with affine coordinates. |
GFElement |
getX()
|
GFElement |
getXAffin()
Return the x-coordinate of this point in affine representation. |
GFElement |
getY()
|
GFElement |
getYAffin()
Return the y-coordinate of this point in affine representation. |
GFElement |
getZ()
|
int |
hashCode()
|
boolean |
isZero()
Tests, whether this point is at infinity. |
Point |
multiplyBy2()
Returns 2*this. |
Point |
multiplyBy2Affine()
Doubles this point in affine coordinates. |
void |
multiplyThisBy2()
This = 2*this. |
Point |
negate()
Returns the inverse of this point. |
void |
negateThis()
Returns the inverse of this point. |
boolean |
onCurve()
Tests whether this point is on the curve mE. |
Point |
subtract(Point other)
Subtracts point other from this point. |
void |
subtractFromThis(Point other)
Subtracts point other from this point. |
java.lang.String |
toString()
Returns this point in affine representation as a String: (x, y), where x = mX/mZ2 and y = mZ/mZ3. |
| Methods inherited from class de.flexiprovider.common.math.ellipticcurves.Point |
EC2OSP, getE, isNegativeOf, OS2ECP |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public PointGFP(EllipticCurveGFP E)
E - EllipticCurveGFP is the elliptic curve this point lies on
public PointGFP(EllipticCurveGFP E,
java.util.Random rand)
E - EllipticCurveGFP is the elliptic curve this point lies onrand - the source of randomness
public PointGFP(GFPElement x,
GFPElement y,
EllipticCurveGFP E)
throws InvalidPointException,
DifferentFieldsException
x - x-coordinatey - y-coordinateE - EllipticCurveGFP is the elliptic curve this point lies onInvalidPointException - if the specified point is not on the curve.DifferentFieldsException - if x and y are defined over
different fields.
public PointGFP(GFPElement x,
GFPElement y,
GFPElement z,
EllipticCurveGFP E)
throws InvalidPointException,
DifferentFieldsException
x - x-coordinatey - y-coordinatez - z-coordinateE - the elliptic curve this point lies onInvalidPointException - if the specified point is not on the curve.DifferentFieldsException - if x, y, and z are
defined over different fields.
public PointGFP(byte[] encoded,
EllipticCurveGFP E)
throws InvalidPointException,
InvalidFormatException
encoded - the point in normal, compressed or hybrid form.E - the underlying elliptic curveInvalidPointException - if the point is not on the curve.InvalidFormatException - if the point representation is invalid.public PointGFP(PointGFP other)
other - point to copy| Method Detail |
public java.lang.Object clone()
clone in class Pointpublic boolean equals(java.lang.Object other)
equals in class Pointother - Point to compare this Point withpublic int hashCode()
hashCode in class PointObject.hashCode()public java.lang.String toString()
toString in class java.lang.Objectpublic GFElement getX()
getX in class Pointpublic GFElement getY()
getY in class Pointpublic GFElement getZ()
getZ in class Pointpublic GFElement getXAffin()
getXAffin in class Pointpublic GFElement getYAffin()
getYAffin in class Pointpublic Point getAffin()
getAffin in class Pointpublic boolean onCurve()
onCurve in class PointEllipticCurveGFPpublic boolean isZero()
PointisZero in class Pointpublic Point add(Point other)
add in class Pointother - point to add to this pointpublic void addToThis(Point other)
addToThis in class Pointother - point to add to this pointpublic Point addAffine(Point other)
other.addAffine in class Pointother - point to add to this pointthis + other in affine coordinatesDifferentCurvesException - when other is defined over another
curvepublic Point subtract(Point other)
subtract in class Pointother - another Pointpublic void subtractFromThis(Point other)
subtractFromThis in class Pointother - another Pointpublic Point negate()
negate in class Pointpublic void negateThis()
negateThis in class Pointpublic Point multiplyBy2()
multiplyBy2 in class Pointpublic void multiplyThisBy2()
multiplyThisBy2 in class Pointpublic Point multiplyBy2Affine()
multiplyBy2Affine in class Pointthis in affine coordinatesbyte[] encodeUncompressed()
encodeUncompressed in class Pointbyte[] encodeCompressed()
encodeCompressed in class Pointbyte[] encodeHybrid()
encodeHybrid in class Point
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||