Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Coordinates
- = Affine
- | Jacobian
- | Projective
- data Form
- class (GaloisField q, GaloisField r, Group (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 -> Integer
- cof :: Point f c e q r -> Integer
- disc :: Point f c e q r -> q
- mul :: r ~ PrimeField p => Point f c e q r -> r -> 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)
- yX :: Point f c e q r -> q -> Maybe q
- fromA :: Point f Affine e q r -> Point f c e q r
- toA :: Point f c e q r -> Point f Affine e q r
- class (Arbitrary g, Eq g, Generic g, Monoid g, Pretty g, Random g, Show g) => Group g where
Documentation
class (GaloisField q, GaloisField r, Group (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 -> Integer Source #
Curve characteristic.
cof :: Point f c e q r -> Integer Source #
Curve cofactor.
disc :: Point f c e q r -> q Source #
Curve discriminant.
mul :: r ~ PrimeField p => Point f c e q r -> r -> Point f c e q r Source #
Curve point multiplication.
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.
yX :: Point f c e q r -> q -> Maybe q Source #
Get Y coordinate from X coordinate.
fromA :: Point f Affine e q r -> Point f c e q r Source #
Transform from affine coordinates.
toA :: Point f c e q r -> Point f Affine e q r Source #
Transform to affine coordinates.
Instances
class (Arbitrary g, Eq g, Generic g, Monoid g, Pretty g, Random g, Show g) => Group g where Source #
Groups.
Element addition.
Element doubling.
Check well-defined.
Group generator.
Identity element.
Element inversion.
mul' :: g -> Integer -> g Source #
Element multiplication.
order :: g -> Integer Source #
Curve order.
rnd :: MonadRandom m => m g Source #
Random element.