hecc-0.3.1: Elliptic Curve Cryptography for Haskell

Maintainer Marcel Fourné (hecc@bitrot.dyndns.org) Safe-Infered

Codec.Crypto.ECC.Base

Description

ECC Base algorithms & point formats

Synopsis

# Documentation

class ECP a whereSource

class of all Elliptic Curve Points

Methods

inf :: aSource

function returning the appropriate INF in the specific ECP-Format, for generic higher-level-algorithms

build point from one in affine coordinates

getBitLength :: a -> IntSource

get bitlength

getCurve :: a -> ECSource

get contents of the curve

getx :: a -> IntegerSource

generic getter, returning the affine x-value

gety :: a -> IntegerSource

generic getters, returning the affine y-value

pdouble :: a -> aSource

padd :: a -> a -> aSource

Instances

 ECP EPmj ECP EPj ECP EPp ECP EPa

data EC Source

class of all Elliptic Curves, has the form y^2=x^3+A*x+B mod P, the parameters being A, B and P

Constructors

 EC (Integer, Integer, Integer)

Instances

 Eq EC Show EC

Arguments

 :: Integral a => a the number to invert -> a the modulus -> a the inverted value

computing the modular inverse of `a` `mod` `m`

Arguments

 :: ECP a => a the point to multiply -> Integer times to multiply the point -> a the result-point

this is a generic handle for Point Multiplication. The implementation may change.

Arguments

 :: ECP a => a the elliptic curve point which we check -> Bool is the point on the curve?

generic verify, if generic ECP is on EC via getx and gety

data EPa Source

Elliptic Point Affine coordinates, two parameters x and y

Constructors

 EPa (BitLength, EC, Integer, Integer) Infa

Instances

 Eq EPa Show EPa ECP EPa

data EPp Source

Elliptic Point Projective coordinates, three parameters x, y and z, like affine (xz,yz)

Constructors

 EPp (BitLength, EC, Integer, Integer, Integer) Infp

Instances

 Eq EPp Show EPp ECP EPp

data EPj Source

Elliptic Point Jacobian coordinates, three parameter x, y and z, like affine (xz^2,yz^3)

Constructors

 EPj (BitLength, EC, Integer, Integer, Integer) Infj

Instances

 Eq EPj Show EPj ECP EPj

data EPmj Source

Elliptic Point Modified Jacobian coordinates, four parameters x,y,z and A*z^4 (A being the first curve-parameter), like affine coordinates (xz^2,yz^3)

Constructors

 EPmj (BitLength, EC, Integer, Integer, Integer, Integer) Infmj

Instances

 Eq EPmj Show EPmj ECP EPmj

class ECPF2 a whereSource

class of all Elliptic Curve Points

Methods

infF2 :: aSource

function returning the appropriate INF in the specific ECP-Format, for generic higher-level-algorithms

build point from one in affine coordinates

get bitlength

getCurveF2 :: a -> ECSC (Array U DIM1 Bool)Source

get contents of the curve

getxF2 :: a -> Array U DIM1 BoolSource

generic getter, returning the affine x-value

getyF2 :: a -> Array U DIM1 BoolSource

generic getters, returning the affine y-value

pdoubleF2 :: a -> aSource

paddF2 :: a -> a -> aSource

Instances

 ECPF2 EPpF2 ECPF2 EPaF2

class ECCNum a whereSource

Methods

eadd :: a -> a -> aSource

abstract over (+)

emul :: a -> a -> aSource

abstract over (*)

epow :: a -> Integer -> aSource

abstract over (^), used for small exponents

emod :: a -> a -> aSource

abstract over mod

Instances

 ECCNum (Array U DIM1 Bool)

class ECurve a whereSource

All Elliptic Curves, binary

Instances

 ECurve (ECSC (Array U DIM1 Bool))

data ECCNum a => ECSC a Source

class of (non-hyper) Elliptic Curves, has the form y^2+x*y=x^3+A*x^2+B mod P, the parameters being A, B and P

Constructors

 ECSC (a, a, a)

Instances

 (Eq a, ECCNum a) => Eq (ECSC a) Show (ECSC (Array U DIM1 Bool)) ECurve (ECSC (Array U DIM1 Bool))

Arguments

 :: ECPF2 a => a the point to invert -> a the inverted point

computing the modular inverse of `a` `emod` `m`

Arguments

 :: ECPF2 a => a the point to multiply -> Integer times to multiply the point -> ECPF2 a => a the result-point

this is a generic handle for Point Multiplication. The implementation may change.

Arguments

 :: (ECPF2 a, Eq a) => a the elliptic curve point which we check -> Bool is the point on the curve?

generic verify, if generic ECP is on EC via getx and gety

data EPaF2 Source

Elliptic Point Affine coordinates, two parameters x and y

Constructors

 EPaF2 (BitLength, ECSC (Array U DIM1 Bool), Array U DIM1 Bool, Array U DIM1 Bool) InfaF2

Instances

 Eq EPaF2 Show EPaF2 ECPF2 EPaF2

data EPpF2 Source

Elliptic Point Projective coordinates, three parameters x, y and z, like affine (xz,yz)

Constructors

 EPpF2 (BitLength, ECSC (Array U DIM1 Bool), Array U DIM1 Bool, Array U DIM1 Bool, Array U DIM1 Bool) InfpF2

Instances

 Eq EPpF2 Show EPpF2 ECPF2 EPpF2