cryptocipher-0.4.0: Symmetrical block and stream ciphers.

PortabilityGood
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellNone

Crypto.Cipher.DSA

Description

Deprecated: Use crypto-pubkey Crypto.PubKey.DSA

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 BoolSource

verify a bytestring using the public key.