Portability | Good |
---|---|
Stability | experimental |
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Safe Haskell | None |
An implementation of the Digital Signature Algorithm (DSA)
- data Params = Params {}
- data Signature = Signature {}
- 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 Params
Represent DSA parameters namely P, G, and Q.
data Signature
Represent a DSA signature namely R and S.
data PublicKey
Represent a DSA public key.
PublicKey | |
|
data PrivateKey
Represent a DSA private key.
Only x need to be secret. the DSA parameters are publicly shared with the other side.
PrivateKey | |
|
signature primitive
sign :: CPRG g => g -> PrivateKey -> HashFunction -> ByteString -> (Signature, g)Source
sign message using the private key.
:: 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.