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.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.

Contents
  1. Generation
  2. Signature primitive
  3. Verification primitive
  4. Key pair
Synopsis
  • 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

Signature primitive

Verification primitive

Key pair

datadata KeyPair

Represent a DSA key pair

Instances6Eq, Data, Read, Show, NFData, DebugShow