elliptic-curve-0.3.0: Elliptic curve library

Data.Curve

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 #

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

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.

Constructors

 Binary Edwards Montgomery Weierstrass

## Elliptic curve coordinates

Curve coordinates.

Constructors

 Affine Jacobian Projective