cryptonite-0.7: Cryptography Primitives sink

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Crypto.PubKey.ECC.P256

Contents

Description

P256 support

Synopsis

Documentation

data Scalar Source

A P256 scalar

data Point Source

A P256 point

Instances

point arithmetic

pointAdd :: Point -> Point -> Point Source

Add a point to another point

pointMul :: Scalar -> Point -> Point Source

Multiply a point by a scalar

warning: variable time

pointsMulVarTime :: Scalar -> Scalar -> Point -> Point Source

multiply the point p with n2 and add a lifted to curve value @n1

n1 * G + n2 * p

warning: variable time

pointIsValid :: Point -> Bool Source

Check if a Point is valid

toPoint :: Scalar -> Point Source

Lift to curve a scalar

Using the curve generator as base point compute:

scalar * G

scalar arithmetic

scalarZero :: Scalar Source

The scalar representing 0

scalarAdd :: Scalar -> Scalar -> Scalar Source

Perform addition between two scalars

a + b

scalarSub :: Scalar -> Scalar -> Scalar Source

Perform subtraction between two scalars

a - b

scalarInv :: Scalar -> Scalar Source

Give the inverse of the scalar

1 / a

warning: variable time

scalarCmp :: Scalar -> Scalar -> Ordering Source

Compare 2 Scalar

scalarFromBinary :: ByteArrayAccess ba => ba -> CryptoFailable Scalar Source

convert a scalar from binary

scalarToBinary :: ByteArray ba => Scalar -> ba Source

convert a scalar to binary