hecc-0.3.2: Elliptic Curve Cryptography for Haskell

MaintainerMarcel Fourné (hecc@bitrot.dyndns.org)
Safe HaskellSafe-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

fromAffineCoords :: EPa -> aSource

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

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

padd :: a -> a -> 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

:: Integral a 
=> a

the number to invert

-> a

the modulus

-> a

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

-> 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

-> 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

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

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

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)

Instances

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

fromAffineCoordsF2 :: EPaF2 -> aSource

build point from one in affine coordinates

getBitLengthF2 :: a -> BitLengthSource

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

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

paddF2 :: a -> a -> aSource

add 2 elliptic points

Instances

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

class ECurve a whereSource

All Elliptic Curves, binary

Instances

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)) 

modinvF2KSource

Arguments

:: ECPF2 a 
=> a

the point to invert

-> a

the inverted point

computing the modular inverse of a emod m

pmulF2Source

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.

isonF2Source

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

Instances

data EPpF2 Source

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

Instances