Represent DSA parameters namely P, G, and Q.
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
Represent a DSA signature namely R and S.
Instances5Eq, Data, Read, Show, NFData
Represent a DSA public key.
Constructors
PublicKeypublic_params :: ParamsDSA parameters
public_y :: PublicNumberDSA public Y
Instances5Eq, Data, Read, Show, NFData
Represent a DSA private key.
Only x need to be secret. the DSA parameters are publicly shared with the other side.
Constructors
PrivateKeyprivate_params :: ParamsDSA parameters
private_x :: PrivateNumberDSA private X
Instances6Eq, Data, Read, Show, NFData, DebugShow
Eq PrivateKeyDefined in crypton-2.1.7 · Crypto.PubKey.DSAData PrivateKeyDefined in crypton-2.1.7 · Crypto.PubKey.DSARead PrivateKeyDefined in crypton-2.1.7 · Crypto.PubKey.DSAShow PrivateKeyDefined in crypton-2.1.7 · Crypto.PubKey.DSAThe parameters are shown;
private_xis not. Use debugShow to see it.NFData PrivateKeyDefined in crypton-2.1.7 · Crypto.PubKey.DSADebugShow PrivateKeyDefined in crypton-2.1.7 · Crypto.PubKey.DSA
DSA Public Number, usually embedded in DSA Public Key
DSA Private Number, usually embedded in DSA Private Key
Generation
2 declarationsgenerate a private number with no specific property this number is usually called X in DSA text.
Calculate the public number from the parameters and the private key
Signature primitive
2 declarationssign message using the private key.
signWith :: (ByteArrayAccess msg, HashAlgorithm hash)=> Integerk random number
-> PrivateKeyprivate key
-> hashhash function
-> msgmessage to sign
-> Maybe Signature
sign message using the private key and an explicit k number.
Verification primitive
1 declarationverify a bytestring using the public key.
Key pair
3 declarationsRepresent a DSA key pair
Constructors
Instances6Eq, Data, Read, Show, NFData, DebugShow
Eq KeyPairDefined in crypton-2.1.7 · Crypto.PubKey.DSAData KeyPairDefined in crypton-2.1.7 · Crypto.PubKey.DSARead KeyPairDefined in crypton-2.1.7 · Crypto.PubKey.DSAShow KeyPairDefined in crypton-2.1.7 · Crypto.PubKey.DSANFData KeyPairDefined in crypton-2.1.7 · Crypto.PubKey.DSADebugShow KeyPairDefined in crypton-2.1.7 · Crypto.PubKey.DSA
Public key of a DSA Key pair
Private key of a DSA Key pair