cryptocipher-0.3.1: Symmetrical Block, Stream and PubKey Ciphers

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
PortabilityGood
Safe HaskellNone
LanguageHaskell98

Crypto.Cipher.DSA

Description

 

Synopsis

Documentation

data Error Source

Constructors

InvalidSignature

signature is not valid r or s is not between the bound 0..q

RandomGenFailure GenError

the random generator returns an error. give the opportunity to reseed for example.

Instances

type Params = (Integer, Integer, Integer)

Represent DSA parameters namely P, G, and Q.

type Signature = (Integer, Integer)

Represent a DSA signature namely R and S.

data PublicKey :: *

Represent a DSA public key.

Constructors

PublicKey 

Fields

public_params :: Params

DSA parameters

public_y :: Integer

DSA public Y

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

private_params :: Params

DSA parameters

private_x :: Integer

DSA private X

sign :: CryptoRandomGen g => g -> (ByteString -> ByteString) -> PrivateKey -> ByteString -> Either GenError (Signature, g) Source

sign message using the private key.

verify :: Signature -> (ByteString -> ByteString) -> PublicKey -> ByteString -> Either Error Bool Source

verify a bytestring using the public key.