A P256 scalar
Modulecryptonite-0.30Haskell2010
Crypto.PubKey.ECC.P256
P256 support
Contents
Synopsis
- newtype Scalar
- newtype Point
- value pointBase
- value pointAdd
- value pointNegate
- value pointMul
- value pointDh
- value pointsMulVarTime
- value pointIsValid
- value pointIsAtInfinity
- value toPoint
- value pointX
- value pointToIntegers
- value pointFromIntegers
- value pointToBinary
- value pointFromBinary
- value unsafePointFromBinary
- value scalarGenerate
- value scalarZero
- value scalarN
- value scalarIsZero
- value scalarAdd
- value scalarSub
- value scalarMul
- value scalarInv
- value scalarInvSafe
- value scalarCmp
- value scalarFromBinary
- value scalarToBinary
- value scalarFromInteger
- value scalarToInteger
- Packagecryptonite-0.30
- Exports31
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceP256.hs
A P256 point
Point arithmetic
Get 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
Generate 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