HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulecrypton-2.1.7Haskell2010

Crypto.PubKey.ECC.P256

P256 support

Contents
  1. Point arithmetic
  2. Scalar arithmetic
Synopsis
  • Packagecrypton-2.1.7
  • Exports32
  • LanguageHaskell2010
  • LicenceBSD-3-Clause AND MIT AND ISC
  • SourceP256.hs
newtypenewtype Scalar

A P256 scalar

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

A P256 point

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

Point arithmetic

Scalar arithmetic

Bring a scalar below the order of the curve

scalarFromInteger and scalarFromBinary take any 256 bits, so a scalar can arrive above the order; the arithmetic below wants it brought down first. Twice the order is more than 256 bits hold, so this is a single subtraction, taken or not through a mask rather than a branch.