HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Modulecrypton-2.1.7Haskell2010

Crypto.PubKey.DSA

An implementation of the Digital Signature Algorithm (DSA)

What is kept from the clock, and what is not

Signing keeps the private number and the ephemeral k out of the two places whose duration would otherwise follow them: the exponentiation is expSafe, which walks the exponent a fixed four bits at a time, and k is inverted by Fermat's little theorem rather than by the extended Euclidean algorithm, whose number of steps follows the bits it is given.

What is left is the arithmetic around them. x * r, the addition and the reduction modulo q are Integer operations, and an Integer costs what its size says: a private number that happens to be short is multiplied in fewer words than a full-length one. The same holds in Crypto.PubKey.ElGamal and Crypto.PubKey.Rabin.Basic. Removing it means leaving Integer for a fixed-width representation, which is what Crypto.PubKey.RSA does for its exponentiation and the curve modules do throughout; there is nothing a caller can do about it from here.

  • 7 types
  • 7 values
  • Packagecrypton-2.1.7
  • Exports14
  • LanguageHaskell2010
  • LicenceBSD-3-Clause AND MIT AND ISC
  • SourceDSA.hs
datadata PrivateKey
#

Represent a DSA private key.

Only x need to be secret. the DSA parameters are publicly shared with the other side.

Constructors

Instances6Eq, Data, Read, Show, NFData, DebugShow

Generation

2 declarations

Signature primitive

2 declarations

Verification primitive

1 declaration

Key pair

3 declarations