eccrypto-0.2.2: Elliptic Curve Cryptography for Haskell

Copyright(c) Marcel Fourné 20[09..]
LicenseBSD3
MaintainerMarcel Fourné (haskell@marcelfourne.de)
Stabilitybeta
PortabilityGood
Safe HaskellSafe
LanguageHaskell98

Crypto.ECC.Weierstrass.Internal.Curvemath

Description

This module contain the internal functions. It's use should be limited to the ECDH and ECDSA modules, which export certain types without constructors, so the timing attack surface is only over the verified functions. ECC Base algorithms & point formats for NIST Curves as specified in NISTReCur.pdf[http:/csrc.nist.govgroupsSTtoolkitdocumentsdss/NISTReCur.pdf]

Synopsis

Documentation

data EC a where Source #

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

Constructors

ECi :: Int -> FPrime -> FPrime -> FPrime -> EC FPrime 
Instances
Eq (EC a) Source # 
Instance details

Defined in Crypto.ECC.Weierstrass.Internal.Curvemath

Methods

(==) :: EC a -> EC a -> Bool #

(/=) :: EC a -> EC a -> Bool #

Show (EC a) Source # 
Instance details

Defined in Crypto.ECC.Weierstrass.Internal.Curvemath

Methods

showsPrec :: Int -> EC a -> ShowS #

show :: EC a -> String #

showList :: [EC a] -> ShowS #

data ECPF a where Source #

data of Elliptic Curve Points

Constructors

ECPp :: FPrime -> FPrime -> FPrime -> ECPF FPrime 
Instances
Eq (ECPF a) Source # 
Instance details

Defined in Crypto.ECC.Weierstrass.Internal.Curvemath

Methods

(==) :: ECPF a -> ECPF a -> Bool #

(/=) :: ECPF a -> ECPF a -> Bool #

Show (ECPF a) Source # 
Instance details

Defined in Crypto.ECC.Weierstrass.Internal.Curvemath

Methods

showsPrec :: Int -> ECPF a -> ShowS #

show :: ECPF a -> String #

showList :: [ECPF a] -> ShowS #

isinf :: EC a -> ECPF a -> Bool Source #

internal function, codifies point at infinity, is used in comparisons

export :: EC a -> ECPF a -> (Integer, Integer) Source #

translate point in internal format to a pair of Integers in affine x and y coordinate | this is intended as interface to other libraries

affine :: EC a -> ECPF a -> (Integer, Integer) Source #

generic getter, returning the affine x and y-value

pdouble :: EC a -> ECPF a -> ECPF a Source #

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

padd :: EC a -> ECPF a -> ECPF a -> ECPF a Source #

add 2 elliptic points

ison :: EC a -> ECPF a -> Bool Source #

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

pmul :: EC a -> ECPF a -> FPrime -> ECPF a Source #

Point Multiplication.