A P256 scalar
Modulecryptonite-0.30Haskell2010
Crypto.PubKey.ECC.P256
P256 support
- 2 types
- 29 values
- Packagecryptonite-0.30
- Exports31
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceP256.hs
A P256 point
Point arithmetic
15 declarationsGet the base point for the P256 Curve
Add a point to another point
Negate a point
Multiply a point by a scalar
warning: variable time
Similar to pointMul, serializing the x coordinate as binary. When scalar is multiple of point order the result is all zero.
multiply the point p with n2 and add a lifted to curve value @n1
n1 * G + n2 * pwarning: variable time
Check if a Point is valid
Check if a Point is the point at infinity
Lift to curve a scalar
Using the curve generator as base point compute:
scalar * GReturn the x coordinate as a Scalar if the point is not at infinity
Convert a point to (x,y) Integers
Convert from (x,y) Integers to a point
Convert a point to a binary representation
Convert from binary to a valid point
Convert from binary to a point, possibly invalid
Scalar arithmetic
14 declarationsGenerate a randomly generated new scalar
The scalar representing 0
The scalar representing the curve order
Check if the scalar is 0
Perform addition between two scalars
a + bPerform subtraction between two scalars
a - bPerform multiplication between two scalars
a * bGive the inverse of the scalar
1 / awarning: variable time
Give the inverse of the scalar using safe exponentiation
1 / aCompare 2 Scalar
convert a scalar from binary
convert a scalar to binary
Convert from an Integer to a P256 Scalar
Convert from a P256 Scalar to an Integer