cryptonite-0.15: Cryptography Primitives sink

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
StabilityExperimental
PortabilityExcellent
Safe HaskellNone
LanguageHaskell2010

Crypto.PubKey.ECC.Types

Contents

Description

Synopsis

Documentation

data Curve

Define either a binary curve or a prime curve.

Constructors

CurveF2m CurveBinary

𝔽(2^m)

CurveFP CurvePrime

𝔽p

data Point

Define a point on a curve.

Constructors

Point Integer Integer 
PointO

Point at Infinity

type PublicPoint = Point

ECC Public Point

type PrivateNumber = Integer

ECC Private Number

data CurveBinary

Define an elliptic curve in 𝔽(2^m). The firt parameter is the Integer representatioin of the irreducible polynomial f(x).

data CurvePrime

Define an elliptic curve in 𝔽p. The first parameter is the Prime Number.

common_curve :: Curve -> CurveCommon

Parameters in common between binary and prime curves.

curveSizeBits :: Curve -> Int

get the size of the curve in bits

ecc_fx :: CurveBinary -> Integer

Irreducible polynomial representing the characteristic of a CurveBinary.

ecc_p :: CurvePrime -> Integer

Prime number representing the characteristic of a CurvePrime.

data CurveCommon

Define common parameters in a curve definition of the form: y^2 = x^3 + ax + b.

Constructors

CurveCommon 

Fields

ecc_a :: Integer

curve parameter a

ecc_b :: Integer

curve parameter b

ecc_g :: Point

base point

ecc_n :: Integer

order of G

ecc_h :: Integer

cofactor

recommended curves definition

getCurveByName :: CurveName -> Curve

Get the curve definition associated with a recommended known curve name.