Point package:cryptonite
A point on curve edwards25519.
Define a point on a curve.
Multiply a scalar with the curve base point
Scalar Multiplication on a curve
Multiply the point p with s2 and add a lifted to
curve value s1
Deserialize a 32-byte array as a point, ensuring the point is valid on
edwards25519.
WARNING: variable time
Add a point to itself.
pointDouble p = pointAdd p p
Test whether a point belongs to the prime-order subgroup generated by
the base point. Result is
True for the identity point.
pointHasPrimeOrder p = pointNegate p == pointMul l_minus_one p
Scalar multiplication over curve edwards25519.
Note: when the scalar had reduction modulo L and the input point has a
torsion component, the output point may not be in the expected
subgroup.
Multiply a point by h = 8.
pointMulByCofactor p = pointMul scalar_8 p
Multiply the point
p with
s2 and add a lifted to
curve value
s1.
pointsMulVarTime s1 s2 p = pointAdd (toPoint s1) (pointMul s2 p)
WARNING: variable time
Add a point to another point
Get the base point for the P256 Curve
Similar to
pointMul, serializing the x coordinate as binary.
When scalar is multiple of point order the result is all zero.
Convert from binary to a valid point
Convert from (x,y) Integers to a point