hecc-0.4.1.1: Elliptic Curve Cryptography for Haskell

Copyright(c) Marcel Fourné 20[09..13]
LicenseBSD3
MaintainerMarcel Fourné (mail@marcelfourne.de)
Stabilityexperimental
PortabilityGood
Safe HaskellNone
LanguageHaskell98

Codec.Crypto.ECC.Base

Description

ECC Base algorithms & point formats

Synopsis

Documentation

data EC a where Source

all Elliptic Curves, the parameters being the BitLength L, A, B and P

Constructors

ECi :: BitLength -> Integer -> Integer -> Integer -> Integer -> EC Integer 
ECb :: BitLength -> F2 -> F2 -> F2 -> F2 -> EC F2 

Instances

Eq (EC a) 
Show (EC a) 
Serialize (EC Integer) 
Serialize (EC F2) 

getBitLength :: EC a -> Int Source

get bitlength

geta :: EC a -> a Source

get Curve parameter A

getb :: EC a -> a Source

get Curve parameter B

getp :: EC a -> a Source

get Curve parameter P

getr :: EC a -> a Source

get Curve order r

data ECPF a where Source

data of all Elliptic Curve Points

Constructors

ECPa :: EC Integer -> Integer -> Integer -> ECPF Integer 
ECPp :: EC Integer -> Integer -> Integer -> Integer -> ECPF Integer 
ECPj :: EC Integer -> Integer -> Integer -> Integer -> ECPF Integer 
ECPmj :: EC Integer -> Integer -> Integer -> Integer -> Integer -> ECPF Integer 
ECPaF2 :: EC F2 -> F2 -> F2 -> ECPF F2 
ECPpF2 :: EC F2 -> F2 -> F2 -> F2 -> ECPF F2 
ECPInfI :: EC Integer -> ECPF Integer 
ECPInfF2 :: EC F2 -> ECPF F2 

Instances

getCurve :: ECPF a -> EC a Source

get contents of the curve

getx :: ECPF a -> a Source

generic getter, returning the x-value

gety :: ECPF a -> a Source

generic getter, returning the y-value

getz :: ECPF a -> a Source

generic getter, returning the z-value for points having them

getaz4 :: ECPF a -> a Source

generic getter, returning the a*z^4-value for points having them

getxA :: ECPF a -> a Source

generic getter, returning the affine x-value

getyA :: ECPF a -> a Source

generic getter, returning the affine y-value

padd :: ECPF a -> ECPF a -> ECPF a Source

add 2 elliptic points

pdouble :: ECPF a -> ECPF a Source

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

modinv Source

Arguments

:: Integral a 
=> a

the number to invert

-> a

the modulus

-> a

the inverted value

computing the modular inverse of a mod m

pmul :: ECPF a -> Integer -> ECPF a Source

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

ison :: ECPF a -> Bool Source

"generic" verify, if generic ECP is on EC via getxA and getyA