public class GroupElement
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
GroupElement.Representation |
| Constructor and Description |
|---|
GroupElement(Curve curve,
byte[] s) |
GroupElement(Curve curve,
GroupElement.Representation repr,
FieldElement X,
FieldElement Y,
FieldElement Z,
FieldElement T) |
| Modifier and Type | Method and Description |
|---|---|
GroupElement |
add(GroupElement q)
GroupElement addition using the twisted Edwards addition law with
extended coordinates (Hisil2008).
|
static GroupElement |
cached(Curve curve,
FieldElement YpX,
FieldElement YmX,
FieldElement Z,
FieldElement T2d) |
GroupElement |
dbl()
r = 2 * p
|
GroupElement |
doubleScalarMultiplyVariableTime(GroupElement A,
byte[] a,
byte[] b)
r = a * A + b * B where a = a[0]+256*a[1]+...+256^31 a[31],
b = b[0]+256*b[1]+...+256^31 b[31] and B is this point.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isOnCurve()
Verify that a point is on its curve.
|
boolean |
isOnCurve(Curve curve)
Verify that a point is on the curve.
|
GroupElement |
negate() |
static GroupElement |
p1p1(Curve curve,
FieldElement X,
FieldElement Y,
FieldElement Z,
FieldElement T) |
static GroupElement |
p2(Curve curve,
FieldElement X,
FieldElement Y,
FieldElement Z) |
static GroupElement |
p3(Curve curve,
FieldElement X,
FieldElement Y,
FieldElement Z,
FieldElement T) |
static GroupElement |
precomp(Curve curve,
FieldElement ypx,
FieldElement ymx,
FieldElement xy2d) |
void |
precompute(boolean precomputeSingle)
Precompute the tables for
scalarMultiply(byte[])
and doubleScalarMultiplyVariableTime(net.i2p.crypto.eddsa.math.GroupElement, byte[], byte[]). |
GroupElement |
scalarMultiply(byte[] a)
h = a * B where a = a[0]+256*a[1]+...+256^31 a[31] and
B is this point.
|
GroupElement |
sub(GroupElement q)
GroupElement subtraction using the twisted Edwards addition law with
extended coordinates (Hisil2008).
|
byte[] |
toByteArray() |
GroupElement |
toCached() |
GroupElement |
toP2() |
GroupElement |
toP3() |
java.lang.String |
toString() |
public GroupElement(Curve curve, GroupElement.Representation repr, FieldElement X, FieldElement Y, FieldElement Z, FieldElement T)
public GroupElement(Curve curve, byte[] s)
public static GroupElement p2(Curve curve, FieldElement X, FieldElement Y, FieldElement Z)
public static GroupElement p3(Curve curve, FieldElement X, FieldElement Y, FieldElement Z, FieldElement T)
public static GroupElement p1p1(Curve curve, FieldElement X, FieldElement Y, FieldElement Z, FieldElement T)
public static GroupElement precomp(Curve curve, FieldElement ypx, FieldElement ymx, FieldElement xy2d)
public static GroupElement cached(Curve curve, FieldElement YpX, FieldElement YmX, FieldElement Z, FieldElement T2d)
public byte[] toByteArray()
public GroupElement toP2()
public GroupElement toP3()
public GroupElement toCached()
public void precompute(boolean precomputeSingle)
scalarMultiply(byte[])
and doubleScalarMultiplyVariableTime(net.i2p.crypto.eddsa.math.GroupElement, byte[], byte[]).precomputeSingle - should the matrix for scalarMultiply() be precomputed?public GroupElement dbl()
public GroupElement add(GroupElement q)
q - the CACHED representation of the GroupElement to add.public GroupElement sub(GroupElement q)
q - the PRECOMP representation of the GroupElement to subtract.public GroupElement negate()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic GroupElement scalarMultiply(byte[] a)
a - = a[0]+256*a[1]+...+256^31 a[31]public GroupElement doubleScalarMultiplyVariableTime(GroupElement A, byte[] a, byte[] b)
A - in P3 representation.a - = a[0]+256*a[1]+...+256^31 a[31]b - = b[0]+256*b[1]+...+256^31 b[31]public boolean isOnCurve()
P - The point to check.public boolean isOnCurve(Curve curve)
curve - The curve to check.public java.lang.String toString()
toString in class java.lang.Object