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 ECurve Projective e q r => EPCurve e q r where
- type EPPoint = EPoint Projective
- class ECurve Affine e q r => EACurve e q r where
- type EAPoint = EPoint Affine
- class (GaloisField q, PrimeField' r, Curve Edwards c e q r) => ECurve c e q r where
- type EPoint = Point Edwards
- 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 ECurve Projective e q r => EPCurve e q r where Source #
Edwards projective curves Ax^2z^2 + y^2z^2 = z^4 + Dx^2y^2
.
Instances
EPCurve JubJub Fq Fr Source # | Projective JubJub curve is an Edwards projective curve. |
EPCurve Ed448 Fq Fr Source # | Projective Ed448 curve is an Edwards projective curve. |
EPCurve Ed3363 Fq Fr Source # | Projective Ed3363 curve is an Edwards projective curve. |
EPCurve Ed25519 Fq Fr Source # | Projective Ed25519 curve is an Edwards projective curve. |
EPCurve E521 Fq Fr Source # | Projective E521 curve is an Edwards projective curve. |
EPCurve E382 Fq Fr Source # | Projective E382 curve is an Edwards projective curve. |
EPCurve E222 Fq Fr Source # | Projective E222 curve is an Edwards projective curve. |
EPCurve Curve41417 Fq Fr Source # | Projective Curve41417 curve is an Edwards projective curve. |
Defined in Curve.Edwards.Curve41417 | |
EPCurve Curve1174 Fq Fr Source # | Projective Curve1174 curve is an Edwards projective curve. |
type EPPoint = EPoint Projective Source #
Edwards projective curves.
class ECurve Affine e q r => EACurve e q r where Source #
Edwards affine curves Ax^2 + y^2 = 1 + Dx^2y^2
.
Instances
EACurve JubJub Fq Fr Source # | Affine JubJub curve is an Edwards affine curve. |
EACurve Ed448 Fq Fr Source # | Affine Ed448 curve is an Edwards affine curve. |
EACurve Ed3363 Fq Fr Source # | Affine Ed3363 curve is an Edwards affine curve. |
EACurve Ed25519 Fq Fr Source # | Affine Ed25519 curve is an Edwards affine curve. |
EACurve E521 Fq Fr Source # | Affine E521 curve is an Edwards affine curve. |
EACurve E382 Fq Fr Source # | Affine E382 curve is an Edwards affine curve. |
EACurve E222 Fq Fr Source # | Affine E222 curve is an Edwards affine curve. |
EACurve Curve41417 Fq Fr Source # | Affine Curve41417 curve is an Edwards affine curve. |
Defined in Curve.Edwards.Curve41417 | |
EACurve Curve1174 Fq Fr Source # | Affine Curve1174 curve is an Edwards affine curve. |
class (GaloisField q, PrimeField' r, Curve Edwards c e q r) => ECurve c e q r where Source #
Edwards curves.
:: EPoint c e q r | |
-> q | Coefficient |
:: EPoint c e q r | |
-> q | Coefficient |
:: EPoint c e q r | |
-> q | Coordinate |
:: EPoint c e q r | |
-> q | Coordinate |
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.