elliptic-curve-0.3.0: Elliptic curve library

Safe HaskellNone
LanguageHaskell2010

Data.Curve

Contents

Synopsis

Elliptic curves

class (GaloisField q, PrimeField r, Arbitrary (Point f c e q r), Eq (Point f c e q r), Generic (Point f c e q r), Group (Point f c e q r), NFData (Point f c e q r), Pretty (Point f c e q r), Random (Point f c e q r), Show (Point f c e q r)) => Curve (f :: Form) (c :: Coordinates) e q r where Source #

Elliptic curves.

Minimal complete definition

add, char, cof, dbl, def, disc, frob, fromA, gen, id, inv, order, point, pointX, toA, yX

Associated Types

data Point f c e q r :: * Source #

Curve point.

Methods

char :: Point f c e q r -> Natural Source #

Curve characteristic.

cof :: Point f c e q r -> Natural Source #

Curve cofactor.

def :: Point f c e q r -> Bool Source #

Curve well-defined.

disc :: Point f c e q r -> q Source #

Curve discriminant.

order :: Point f c e q r -> Natural Source #

Curve order.

add :: Point f c e q r -> Point f c e q r -> Point f c e q r Source #

Point addition.

dbl :: Point f c e q r -> Point f c e q r Source #

Point doubling.

id :: Point f c e q r Source #

Point identity.

inv :: Point f c e q r -> Point f c e q r Source #

Point inversion.

frob :: Point f c e q r -> Point f c e q r Source #

Frobenius endomorphism.

fromA :: Curve f Affine e q r => Point f Affine e q r -> Point f c e q r Source #

Transform from affine coordinates.

gen :: Point f c e q r Source #

Curve generator.

point :: q -> q -> Maybe (Point f c e q r) Source #

Get point from X and Y coordinates.

pointX :: q -> Maybe (Point f c e q r) Source #

Get point from X coordinate.

rnd :: MonadRandom m => m (Point f c e q r) Source #

Random point.

toA :: Curve f Affine e q r => Point f c e q r -> Point f Affine e q r Source #

Transform to affine coordinates.

yX :: Point f c e q r -> q -> Maybe q Source #

Get Y coordinate from X coordinate.

Instances
BACurve e q r => Curve Binary Affine (e :: k) q r Source # 
Instance details

Defined in Data.Curve.Binary

Associated Types

data Point Binary Affine e q r :: Type Source #

BPCurve e q r => Curve Binary Projective (e :: k) q r Source # 
Instance details

Defined in Data.Curve.Binary

Associated Types

data Point Binary Projective e q r :: Type Source #

EACurve e q r => Curve Edwards Affine (e :: k) q r Source # 
Instance details

Defined in Data.Curve.Edwards

Associated Types

data Point Edwards Affine e q r :: Type Source #

EPCurve e q r => Curve Edwards Projective (e :: k) q r Source # 
Instance details

Defined in Data.Curve.Edwards

Associated Types

data Point Edwards Projective e q r :: Type Source #

MACurve e q r => Curve Montgomery Affine (e :: k) q r Source # 
Instance details

Defined in Data.Curve.Montgomery

Associated Types

data Point Montgomery Affine e q r :: Type Source #

WACurve e q r => Curve Weierstrass Affine (e :: k) q r Source # 
Instance details

Defined in Data.Curve.Weierstrass

Associated Types

data Point Weierstrass Affine e q r :: Type Source #

WJCurve e q r => Curve Weierstrass Jacobian (e :: k) q r Source # 
Instance details

Defined in Data.Curve.Weierstrass

Associated Types

data Point Weierstrass Jacobian e q r :: Type Source #

WPCurve e q r => Curve Weierstrass Projective (e :: k) q r Source # 
Instance details

Defined in Data.Curve.Weierstrass

Associated Types

data Point Weierstrass Projective e q r :: Type Source #

mul :: Curve f c e q r => Point f c e q r -> r -> Point f c e q r Source #

Point multiplication by field element.

mul' :: (Curve f c e q r, Integral n) => Point f c e q r -> n -> Point f c e q r Source #

Point multiplication by integral element.

Elliptic curve forms

data Form Source #

Curve forms.

Elliptic curve coordinates

data Coordinates Source #

Curve coordinates.

Constructors

Affine 
Jacobian 
Projective