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.PubKey.ECC.P256

P256 support

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

A P256 scalar

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

A P256 point

Instances3Eq, Show, NFData
  • Eq PointDefined in cryptonite-0.30 · Crypto.PubKey.ECC.P256
  • Show PointDefined in cryptonite-0.30 · Crypto.PubKey.ECC.P256
  • NFData PointDefined in cryptonite-0.30 · 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