Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- 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
- data Point f c e q r :: *
- char :: Point f c e q r -> Natural
- cof :: Point f c e q r -> Natural
- def :: Point f c e q r -> Bool
- disc :: Point f c e q r -> q
- order :: Point f c e q r -> Natural
- add :: Point f c e q r -> Point f c e q r -> Point f c e q r
- dbl :: Point f c e q r -> Point f c e q r
- id :: Point f c e q r
- inv :: Point f c e q r -> Point f c e q r
- frob :: Point f c e q r -> Point f c e q r
- fromA :: Curve f Affine e q r => Point f Affine e q r -> Point f c e q r
- gen :: Point f c e q r
- point :: q -> q -> Maybe (Point f c e q r)
- pointX :: q -> Maybe (Point f c e q r)
- rnd :: MonadRandom m => m (Point f c e q r)
- toA :: Curve f Affine e q r => Point f c e q r -> Point f Affine e q r
- yX :: Point f c e q r -> q -> Maybe q
- mul :: Curve f c e q r => Point f c e q r -> r -> Point f c e q r
- mul' :: (Curve f c e q r, Integral n) => Point f c e q r -> n -> Point f c e q r
- data Form
- data Coordinates
- = Affine
- | Jacobian
- | Projective
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.
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
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.