crypto-pubkey-0.1.2: Public Key cryptography

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

Crypto.PubKey.DSA

Contents

Description

 

Synopsis

Documentation

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

signature primitive

sign :: CPRG g => g -> PrivateKey -> HashFunction -> ByteString -> (Signature, g)Source

sign message using the private key.

signWithSource

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.