java.lang.Object
net.i2p.crypto.eddsa.math.Curve
- All Implemented Interfaces:
Serializable
A twisted Edwards curve. Points on the curve satisfy $-x^2 + y^2 = 1 + d x^2y^2$.
- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FieldElementThe curve parameter d.private final FieldElementTwice the curve parameter d.private final FieldThe finite field.private final FieldElementThe square root of -1.private static final longPinned for serialized-form compatibility.private final GroupElementZero p2.private final GroupElementZero p3.private final GroupElementZero p3 precomputed double.private final GroupElementZero precomp.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptioncreatePoint(byte[] p, boolean precompute) Create a point from an encoded representation.booleanWhether this curve equals the given object.get2D()Return twice the curve parameter d.getD()Return the curve parameter d.getField()Return the field this curve is defined over.getI()Return the square root of -1.Return the zero element for the given representation.inthashCode()The hash code of this curve.
Field Details
serialVersionUID
private static final long serialVersionUIDPinned for serialized-form compatibility.- See Also:
f
The finite field.d
The curve parameter d.d2
Twice the curve parameter d.I
The square root of -1.zeroP2
Zero p2.zeroP3
Zero p3.zeroP3PrecomputedDouble
Zero p3 precomputed double.zeroPrecomp
Zero precomp.
Constructor Details
Curve
Create a twisted Edwards curve.- Parameters:
f- the finite fieldd- the curve parameter di- the square root of -1
Method Details
getField
Return the field this curve is defined over.- Returns:
- the prime field, which carries q as its modulus
getD
get2D
getI
getZero
Return the zero element for the given representation.- Parameters:
repr- the representation type- Returns:
- the zero element, or null if unsupported
createPoint
Create a point from an encoded representation.- Parameters:
p- the encoded pointprecompute- whether to precompute- Returns:
- the group element
hashCode
equals