Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class GaloisField k => PrimeField' k
- data Coordinates
- = Affine
- | Jacobian
- | Projective
- data Form
- class (GaloisField q, PrimeField' 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 :: 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 MCurve Affine e q r => MACurve e q r where
- type MAPoint = MPoint Affine
- class (GaloisField q, PrimeField' r, Curve Montgomery c e q r) => MCurve c e q r where
- type MPoint = Point Montgomery
- class (Arbitrary g, Eq g, Generic g, Monoid g, Pretty g, Random g, Show g) => Group g where
Documentation
class GaloisField k => PrimeField' k Source #
Instances
KnownNat p => PrimeField' (PrimeField p) Source # | |
class (GaloisField q, PrimeField' 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 :: 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 MCurve Affine e q r => MACurve e q r where Source #
Montgomery affine curves By^2 = x^3 + Ax^2 + x
.
Instances
MACurve M511 Fq Fr Source # | Affine M511 curve is a Montgomery affine curve. |
MACurve M383 Fq Fr Source # | Affine M383 curve is a Montgomery affine curve. |
MACurve M221 Fq Fr Source # | Affine M221 curve is a Montgomery affine curve. |
MACurve Curve448 Fq Fr Source # | Affine Curve448 curve is a Montgomery affine curve. |
MACurve Curve383187 Fq Fr Source # | Affine Curve383187 curve is a Montgomery affine curve. |
Defined in Curve.Montgomery.Curve383187 | |
MACurve Curve25519 Fq Fr Source # | Affine Curve25519 curve is a Montgomery affine curve. |
Defined in Curve.Montgomery.Curve25519 |
class (GaloisField q, PrimeField' r, Curve Montgomery c e q r) => MCurve c e q r where Source #
Montgomery curves.
:: MPoint c e q r | |
-> q | Coefficient |
:: MPoint c e q r | |
-> q | Coefficient |
:: MPoint c e q r | |
-> q | Coordinate |
:: MPoint c e q r | |
-> q | Coordinate |
Instances
Curve Montgomery c M511 Fq Fr => MCurve c M511 Fq Fr Source # | M511 curve is a Montgomery curve. |
Defined in Curve.Montgomery.M511 | |
Curve Montgomery c M383 Fq Fr => MCurve c M383 Fq Fr Source # | M383 curve is a Montgomery curve. |
Defined in Curve.Montgomery.M383 | |
Curve Montgomery c M221 Fq Fr => MCurve c M221 Fq Fr Source # | M221 curve is a Montgomery curve. |
Defined in Curve.Montgomery.M221 | |
Curve Montgomery c Curve448 Fq Fr => MCurve c Curve448 Fq Fr Source # | Curve448 curve is a Montgomery curve. |
Defined in Curve.Montgomery.Curve448 | |
Curve Montgomery c Curve383187 Fq Fr => MCurve c Curve383187 Fq Fr Source # | Curve383187 curve is a Montgomery curve. |
Defined in Curve.Montgomery.Curve383187 | |
Curve Montgomery c Curve25519 Fq Fr => MCurve c Curve25519 Fq Fr Source # | Curve25519 curve is a Montgomery curve. |
Defined in Curve.Montgomery.Curve25519 |
type MPoint = Point Montgomery Source #
Montgomery points.
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.