Crypto.Types.PubKey.DH

crypto-pubkey-types-0.4.3: Generic cryptography Public keys algorithm types

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | Stable
Portability | Excellent
Safe Haskell | None
Language | Haskell98

Crypto.Types.PubKey.DH

Description

Synopsis

- data Params = Params {
  - params_p :: Integer
  - params_g :: Integer
  }
- newtype PublicNumber = PublicNumber Integer
- newtype PrivateNumber = PrivateNumber Integer
- newtype SharedKey = SharedKey Integer

# Documentation

data Params #

Represent Diffie Hellman parameters namely P (prime), and G (generator).

Constructors

Params |
Fields params_p :: Integer params_g :: Integer

Instances

Eq Params # |
Methods (==) :: Params -> Params -> Bool # (/=) :: Params -> Params -> Bool #
Data Params # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Params -> c Params # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Params # toConstr :: Params -> Constr # dataTypeOf :: Params -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Params) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Params) # gmapT :: (forall b. Data b => b -> b) -> Params -> Params # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Params -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Params -> r # gmapQ :: (forall d. Data d => d -> u) -> Params -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Params -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Params -> m Params # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Params -> m Params # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Params -> m Params #
Read Params # |
Methods readsPrec :: Int -> ReadS Params # readList :: ReadS [Params] # readPrec :: ReadPrec Params # readListPrec :: ReadPrec [Params] #
Show Params # |
Methods showsPrec :: Int -> Params -> ShowS # show :: Params -> String # showList :: [Params] -> ShowS #
ASN1Object Params # |
Methods toASN1 :: Params -> ASN1S # fromASN1 :: [ASN1] -> Either String (Params, [ASN1]) #

newtype PublicNumber #

Represent Diffie Hellman public number Y.

Constructors

PublicNumber Integer |

Instances

Enum PublicNumber # |
Methods succ :: PublicNumber -> PublicNumber # pred :: PublicNumber -> PublicNumber # toEnum :: Int -> PublicNumber # fromEnum :: PublicNumber -> Int # enumFrom :: PublicNumber -> [PublicNumber] # enumFromThen :: PublicNumber -> PublicNumber -> [PublicNumber] # enumFromTo :: PublicNumber -> PublicNumber -> [PublicNumber] # enumFromThenTo :: PublicNumber -> PublicNumber -> PublicNumber -> [PublicNumber] #
Eq PublicNumber # |
Methods (==) :: PublicNumber -> PublicNumber -> Bool # (/=) :: PublicNumber -> PublicNumber -> Bool #
Num PublicNumber # |
Methods (+) :: PublicNumber -> PublicNumber -> PublicNumber # (-) :: PublicNumber -> PublicNumber -> PublicNumber # (*) :: PublicNumber -> PublicNumber -> PublicNumber # negate :: PublicNumber -> PublicNumber # abs :: PublicNumber -> PublicNumber # signum :: PublicNumber -> PublicNumber # fromInteger :: Integer -> PublicNumber #
Ord PublicNumber # |
Methods compare :: PublicNumber -> PublicNumber -> Ordering # (<) :: PublicNumber -> PublicNumber -> Bool # (<=) :: PublicNumber -> PublicNumber -> Bool # (>) :: PublicNumber -> PublicNumber -> Bool # (>=) :: PublicNumber -> PublicNumber -> Bool # max :: PublicNumber -> PublicNumber -> PublicNumber # min :: PublicNumber -> PublicNumber -> PublicNumber #
Read PublicNumber # |
Methods readsPrec :: Int -> ReadS PublicNumber # readList :: ReadS [PublicNumber] # readPrec :: ReadPrec PublicNumber # readListPrec :: ReadPrec [PublicNumber] #
Real PublicNumber # |
Methods toRational :: PublicNumber -> Rational #
Show PublicNumber # |
Methods showsPrec :: Int -> PublicNumber -> ShowS # show :: PublicNumber -> String # showList :: [PublicNumber] -> ShowS #

newtype PrivateNumber #

Represent Diffie Hellman private number X.

Constructors

PrivateNumber Integer |

Instances

Enum PrivateNumber # |
Methods succ :: PrivateNumber -> PrivateNumber # pred :: PrivateNumber -> PrivateNumber # toEnum :: Int -> PrivateNumber # fromEnum :: PrivateNumber -> Int # enumFrom :: PrivateNumber -> [PrivateNumber] # enumFromThen :: PrivateNumber -> PrivateNumber -> [PrivateNumber] # enumFromTo :: PrivateNumber -> PrivateNumber -> [PrivateNumber] # enumFromThenTo :: PrivateNumber -> PrivateNumber -> PrivateNumber -> [PrivateNumber] #
Eq PrivateNumber # |
Methods (==) :: PrivateNumber -> PrivateNumber -> Bool # (/=) :: PrivateNumber -> PrivateNumber -> Bool #
Num PrivateNumber # |
Methods (+) :: PrivateNumber -> PrivateNumber -> PrivateNumber # (-) :: PrivateNumber -> PrivateNumber -> PrivateNumber # (*) :: PrivateNumber -> PrivateNumber -> PrivateNumber # negate :: PrivateNumber -> PrivateNumber # abs :: PrivateNumber -> PrivateNumber # signum :: PrivateNumber -> PrivateNumber # fromInteger :: Integer -> PrivateNumber #
Ord PrivateNumber # |
Methods compare :: PrivateNumber -> PrivateNumber -> Ordering # (<) :: PrivateNumber -> PrivateNumber -> Bool # (<=) :: PrivateNumber -> PrivateNumber -> Bool # (>) :: PrivateNumber -> PrivateNumber -> Bool # (>=) :: PrivateNumber -> PrivateNumber -> Bool # max :: PrivateNumber -> PrivateNumber -> PrivateNumber # min :: PrivateNumber -> PrivateNumber -> PrivateNumber #
Read PrivateNumber # |
Methods readsPrec :: Int -> ReadS PrivateNumber # readList :: ReadS [PrivateNumber] # readPrec :: ReadPrec PrivateNumber # readListPrec :: ReadPrec [PrivateNumber] #
Real PrivateNumber # |
Methods toRational :: PrivateNumber -> Rational #
Show PrivateNumber # |
Methods showsPrec :: Int -> PrivateNumber -> ShowS # show :: PrivateNumber -> String # showList :: [PrivateNumber] -> ShowS #

newtype SharedKey #

Represent Diffie Hellman shared secret.

Constructors

SharedKey Integer |

Instances

Enum SharedKey # |
Methods succ :: SharedKey -> SharedKey # pred :: SharedKey -> SharedKey # toEnum :: Int -> SharedKey # fromEnum :: SharedKey -> Int # enumFrom :: SharedKey -> [SharedKey] # enumFromThen :: SharedKey -> SharedKey -> [SharedKey] # enumFromTo :: SharedKey -> SharedKey -> [SharedKey] # enumFromThenTo :: SharedKey -> SharedKey -> SharedKey -> [SharedKey] #
Eq SharedKey # |
Methods (==) :: SharedKey -> SharedKey -> Bool # (/=) :: SharedKey -> SharedKey -> Bool #
Num SharedKey # |
Methods (+) :: SharedKey -> SharedKey -> SharedKey # (-) :: SharedKey -> SharedKey -> SharedKey # (*) :: SharedKey -> SharedKey -> SharedKey # negate :: SharedKey -> SharedKey # abs :: SharedKey -> SharedKey # signum :: SharedKey -> SharedKey # fromInteger :: Integer -> SharedKey #
Ord SharedKey # |
Methods compare :: SharedKey -> SharedKey -> Ordering # (<) :: SharedKey -> SharedKey -> Bool # (<=) :: SharedKey -> SharedKey -> Bool # (>) :: SharedKey -> SharedKey -> Bool # (>=) :: SharedKey -> SharedKey -> Bool # max :: SharedKey -> SharedKey -> SharedKey # min :: SharedKey -> SharedKey -> SharedKey #
Read SharedKey # |
Methods readsPrec :: Int -> ReadS SharedKey # readList :: ReadS [SharedKey] # readPrec :: ReadPrec SharedKey # readListPrec :: ReadPrec [SharedKey] #
Real SharedKey # |
Methods toRational :: SharedKey -> Rational #
Show SharedKey # |
Methods showsPrec :: Int -> SharedKey -> ShowS # show :: SharedKey -> String # showList :: [SharedKey] -> ShowS #