HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecryptonite-0.30Haskell2010

Crypto.ECC

Elliptic Curve Cryptography

  • 8 types
  • 4 classes
  • Packagecryptonite-0.30
  • Exports12
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceECC.hs
datadata Curve_P256R1
#

P256 Curve

also known as P256

Instances9Data, Show, EllipticCurve, EllipticCurveArith, EllipticCurveBasepointArith, EllipticCurveDH, …
datadata Curve_P384R1
#
Instances9Data, Show, EllipticCurve, EllipticCurveArith, EllipticCurveBasepointArith, EllipticCurveDH, …
datadata Curve_P521R1
#
Instances9Data, Show, EllipticCurve, EllipticCurveArith, EllipticCurveBasepointArith, EllipticCurveDH, …
datadata Curve_X25519
#
Instances6Data, Show, EllipticCurve, EllipticCurveDH, Point, Scalar
datadata Curve_Edwards25519
#
Instances9Data, Show, EllipticCurve, EllipticCurveArith, EllipticCurveBasepointArith, EllipticCurveEdDSA, …
classclass EllipticCurve curve where
#

Associated types

  • type family Point curve

    Point on an Elliptic Curve

  • type family Scalar curve

    Scalar in the Elliptic Curve domain

Methods

Instances6EllipticCurve
classclass EllipticCurve curve => EllipticCurveDH curve where
#

Methods

  • ecdhRaw :: proxy curve -> Scalar curve -> Point curve -> SharedSecret

    Generate a Diffie hellman secret value.

    This is generally just the .x coordinate of the resulting point, that is not hashed.

    use pointSmul to keep the result in Point format.

    WARNING: Curve implementations may return a special value or an exception when the public point lies in a subgroup of small order. This function is adequate when the scalar is in expected range and contributory behaviour is not needed. Otherwise use ecdh.

  • ecdh :: proxy curve -> Scalar curve -> Point curve -> CryptoFailable SharedSecret

    Generate a Diffie hellman secret value and verify that the result is not the point at infinity.

    This additional test avoids risks existing with function ecdhRaw. Implementations always return a CryptoError instead of a special value or an exception.

Instances5EllipticCurveDH
classclass (EllipticCurve curve, Eq (Point curve)) => EllipticCurveArith curve where
#

Methods

Instances4EllipticCurveArith
classclass (EllipticCurveArith curve, Eq (Scalar curve)) => EllipticCurveBasepointArith curve where
#

Methods

Instances4EllipticCurveBasepointArith