| Portability | Good |
|---|---|
| Stability | experimental |
| Maintainer | Vincent Hanquez <vincent@snarc.org> |
| Safe Haskell | None |
Crypto.PubKey.DSA
Description
- type Params = (Integer, Integer, Integer)
- type Signature = (Integer, Integer)
- data PublicKey = PublicKey {}
- data PrivateKey = PrivateKey {}
- sign :: CPRG g => g -> PrivateKey -> HashFunction -> ByteString -> (Signature, g)
- signWith :: Integer -> PrivateKey -> HashFunction -> ByteString -> Maybe Signature
- verify :: HashFunction -> PublicKey -> Signature -> ByteString -> Bool
Documentation
data PublicKey
Represent a DSA public key.
Constructors
| PublicKey | |
Fields
| |
data PrivateKey
Represent a DSA private key.
Only x need to be secret. the DSA parameters are publicly shared with the other side.
Constructors
| PrivateKey | |
Fields
| |
Instances
signature primitive
sign :: CPRG g => g -> PrivateKey -> HashFunction -> ByteString -> (Signature, g)Source
sign message using the private key.
Arguments
| :: Integer | k random number |
| -> PrivateKey | private key |
| -> HashFunction | hash function |
| -> ByteString | message to sign |
| -> Maybe Signature |
sign message using the private key and an explicit k number.
verification primitive
verify :: HashFunction -> PublicKey -> Signature -> ByteString -> BoolSource
verify a bytestring using the public key.