|Maintainer||Vincent Hanquez <firstname.lastname@example.org>|
- type Params = (Integer, Integer)
- data PublicNumber
- data PrivateNumber
- data SharedKey
- generateParams :: CryptoRandomGen g => g -> Int -> Integer -> Either GenError (Params, g)
- generatePrivate :: CryptoRandomGen g => g -> Int -> Either GenError (PrivateNumber, g)
- generatePublic :: Params -> PrivateNumber -> PublicNumber
- getShared :: Params -> PrivateNumber -> PublicNumber -> SharedKey
Represent Diffie Hellman parameters namely P (prime), and G (generator).
Represent Diffie Hellman public number Y.
Represent Diffie Hellman private number X.
Represent Diffie Hellman shared secret.
generate params from a specific generator (2 or 5 are common values) we generate a safe prime (a prime number of the form 2p+1 where p is also prime)
generate a private number with no specific property this number is usually called X in DH text.
generate a public number that is for the other party benefits. this number is usually called Y in DH text.