hecc-0.2: Elliptic Curve Cryptography for Haskell

MaintainerMarcel Fourn (hecc@bitrot.dyndns.org

Codec.Encryption.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

getx :: a -> EC -> IntegerSource

generic getter, returning the affine x-value

gety :: a -> EC -> IntegerSource

generic getters, returning the affine y-value

pdouble :: a -> EC -> aSource

add an elliptic point onto itself, base for padd a a c

padd :: a -> a -> EC -> aSource

add 2 elliptic points

Instances

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

modinvSource

Arguments

:: Integer

the number to invert

-> Integer

the modulus

-> Integer

the inverted value

computing the modular inverse of a mod m

pmulSource

Arguments

:: ECP a 
=> a

the point to multiply

-> Integer

times to multiply the point

-> EC

the curve to operate on

-> a

the result-point

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

isonSource

Arguments

:: ECP a 
=> a

the elliptic curve point which we check

-> EC

the curve to test on

-> Bool

is the point on the curve?

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

genkeySource

Arguments

:: ECP a 
=> a

a generator (a point on the curve which multiplied gets to be every other point on the curve)

-> EC

the curve

-> IO a

the random point which will be the key

given a generator and a curve, generate a point randomly

data EPa Source

Elliptic Point Affine coordinates, two parameters x and y

Constructors

EPa (Integer, Integer) 
Infa 

Instances

data EPp Source

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

Constructors

EPp (Integer, Integer, Integer) 
Infp 

Instances

data EPj Source

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

Constructors

EPj (Integer, Integer, Integer) 
Infj 

Instances

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 (Integer, Integer, Integer, Integer) 
Infmj 

Instances