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

Modulecrypton-1.0.4Haskell2010

Crypto.PubKey.ECC.P256

P256 support

  • 2 types
  • 29 values
  • Packagecrypton-1.0.4
  • Exports31
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceP256.hs
newtypenewtype Scalar
#

A P256 scalar

Instances4Eq, Show, NFData, ByteArrayAccess
  • Eq ScalarDefined in crypton-1.0.4 · Crypto.PubKey.ECC.P256
  • Show ScalarDefined in crypton-1.0.4 · Crypto.PubKey.ECC.P256
  • NFData ScalarDefined in crypton-1.0.4 · Crypto.PubKey.ECC.P256
  • ByteArrayAccess ScalarDefined in crypton-1.0.4 · Crypto.PubKey.ECC.P256
newtypenewtype Point
#

A P256 point

Instances3Eq, Show, NFData
  • Eq PointDefined in crypton-1.0.4 · Crypto.PubKey.ECC.P256
  • Show PointDefined in crypton-1.0.4 · Crypto.PubKey.ECC.P256
  • NFData PointDefined in crypton-1.0.4 · Crypto.PubKey.ECC.P256

Point arithmetic

15 declarations
valuepointDh :: ByteArray binary => Scalar -> Point -> binary
#

Similar to pointMul, serializing the x coordinate as binary. When scalar is multiple of point order the result is all zero.

valuetoPoint :: Scalar -> Point
#

Lift to curve a scalar

Using the curve generator as base point compute:

scalar * G

Scalar arithmetic

14 declarations