File: DSA.hs

package info (click to toggle)
haskell-crypto-pubkey-types 0.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 64 kB
  • sloc: haskell: 55; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{-# LANGUAGE DeriveDataTypeable #-}
-- |
-- Module      : Crypto.Types.PubKey.DSA
-- License     : BSD-style
-- Maintainer  : Vincent Hanquez <vincent@snarc.org>
-- Stability   : Stable
-- Portability : Excellent
--
module Crypto.Types.PubKey.DSA
	( Params
	, Signature
	, PublicKey(..)
	, PrivateKey(..)
	) where

import Data.Data

-- | Represent DSA parameters namely P, G, and Q.
type Params = (Integer,Integer,Integer)

-- | Represent a DSA signature namely R and S.
type Signature = (Integer,Integer)

-- | Represent a DSA public key.
data PublicKey = PublicKey
	{ public_params :: Params   -- ^ DSA parameters
	, public_y      :: Integer  -- ^ DSA public Y
	} deriving (Show,Read,Eq,Data,Typeable)

-- | Represent a DSA private key.
--
-- Only x need to be secret.
-- the DSA parameters are publicly shared with the other side.
data PrivateKey = PrivateKey
	{ private_params :: Params   -- ^ DSA parameters
	, private_x      :: Integer  -- ^ DSA private X
	} deriving (Show,Read,Eq,Data,Typeable)