-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Generic cryptography Public keys algorithm types
--   
--   Generic cryptography public keys algorithm types
@package crypto-pubkey-types
@version 0.2.0


module Crypto.Types.PubKey.DH

-- | Represent Diffie Hellman parameters namely P (prime), and G
--   (generator).
type Params = (Integer, Integer)

-- | Represent Diffie Hellman public number Y.
newtype PublicNumber
PublicNumber :: Integer -> PublicNumber

-- | Represent Diffie Hellman private number X.
newtype PrivateNumber
PrivateNumber :: Integer -> PrivateNumber

-- | Represent Diffie Hellman shared secret.
newtype SharedKey
SharedKey :: Integer -> SharedKey
instance Show PublicNumber
instance Read PublicNumber
instance Eq PublicNumber
instance Enum PublicNumber
instance Real PublicNumber
instance Num PublicNumber
instance Ord PublicNumber
instance Show PrivateNumber
instance Read PrivateNumber
instance Eq PrivateNumber
instance Enum PrivateNumber
instance Real PrivateNumber
instance Num PrivateNumber
instance Ord PrivateNumber
instance Show SharedKey
instance Read SharedKey
instance Eq SharedKey
instance Enum SharedKey
instance Real SharedKey
instance Num SharedKey
instance Ord SharedKey


module Crypto.Types.PubKey.DSA

-- | 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 :: Params -> Integer -> PublicKey

-- | DSA parameters
public_params :: PublicKey -> Params

-- | DSA public Y
public_y :: PublicKey -> Integer

-- | Represent a DSA private key.
--   
--   Only x need to be secret. the DSA parameters are publicly shared with
--   the other side.
data PrivateKey
PrivateKey :: Params -> Integer -> PrivateKey

-- | DSA parameters
private_params :: PrivateKey -> Params

-- | DSA private X
private_x :: PrivateKey -> Integer
instance Typeable PublicKey
instance Typeable PrivateKey
instance Show PublicKey
instance Read PublicKey
instance Eq PublicKey
instance Data PublicKey
instance Show PrivateKey
instance Read PrivateKey
instance Eq PrivateKey
instance Data PrivateKey


module Crypto.Types.PubKey.RSA

-- | Represent a RSA public key
data PublicKey
PublicKey :: Int -> Integer -> Integer -> PublicKey

-- | size of key in bytes
public_size :: PublicKey -> Int

-- | public p*q
public_n :: PublicKey -> Integer

-- | public exponant e
public_e :: PublicKey -> Integer

-- | Represent a RSA private key.
--   
--   Only the pub, d fields are mandatory to fill.
--   
--   p, q, dP, dQ, qinv are by-product during RSA generation, but are
--   useful to record here to speed up massively the decrypt and sign
--   operation.
--   
--   implementations can leave optional fields to 0.
data PrivateKey
PrivateKey :: PublicKey -> Integer -> Integer -> Integer -> Integer -> Integer -> Integer -> PrivateKey

-- | public part of a private key (size, n and e)
private_pub :: PrivateKey -> PublicKey

-- | private exponant d
private_d :: PrivateKey -> Integer

-- | p prime number
private_p :: PrivateKey -> Integer

-- | q prime number
private_q :: PrivateKey -> Integer

-- | d mod (p-1)
private_dP :: PrivateKey -> Integer

-- | d mod (q-1)
private_dQ :: PrivateKey -> Integer

-- | q^(-1) mod p
private_qinv :: PrivateKey -> Integer
private_size :: PrivateKey -> Int
private_n :: PrivateKey -> Integer
instance Typeable PublicKey
instance Typeable PrivateKey
instance Show PublicKey
instance Read PublicKey
instance Eq PublicKey
instance Data PublicKey
instance Show PrivateKey
instance Read PrivateKey
instance Eq PrivateKey
instance Data PrivateKey
