crypto-pubkey-0.2.8: Public Key cryptography

Safe Haskell | None
Language | Haskell98

Crypto.PubKey.ECC.DH

Synopsis

- data Curve :: *
- type PublicPoint = Point
- type PrivateNumber = Integer
- newtype SharedKey :: * = SharedKey Integer
- generatePrivate :: CPRG g => g -> Curve -> (PrivateNumber, g)
- calculatePublic :: Curve -> PrivateNumber -> PublicPoint
- getShared :: Curve -> PrivateNumber -> PublicPoint -> SharedKey

# Documentation

data Curve :: *

Define either a binary curve or a prime curve.

Instances

Eq Curve |
Data Curve |
Read Curve |
Show Curve |

type PublicPoint = Point

ECC Public Point

type PrivateNumber = Integer

ECC Private Number

newtype SharedKey :: *

Represent Diffie Hellman shared secret.

Constructors

SharedKey Integer |

Instances

Enum SharedKey |
Eq SharedKey |
Num SharedKey |
Ord SharedKey |
Read SharedKey |
Real SharedKey |
Show SharedKey |

generatePrivate :: CPRG g => g -> Curve -> (PrivateNumber, g) Source

Generating a private number d.

calculatePublic :: Curve -> PrivateNumber -> PublicPoint Source

Generating a public point Q.

getShared :: Curve -> PrivateNumber -> PublicPoint -> SharedKey Source

Generating a shared key using our private number and the other party public point.