License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
Elliptic curve Diffie Hellman
Synopsis
- data Curve
- type PublicPoint = Point
- type PrivateNumber = Integer
- newtype SharedKey = SharedKey ScrubbedBytes
- generatePrivate :: MonadRandom m => Curve -> m PrivateNumber
- calculatePublic :: Curve -> PrivateNumber -> PublicPoint
- getShared :: Curve -> PrivateNumber -> PublicPoint -> SharedKey
Documentation
Define either a binary curve or a prime curve.
Instances
Eq Curve Source # | |
Data Curve Source # | |
Defined in Crypto.PubKey.ECC.Types gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Curve -> c Curve Source # gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c Curve Source # toConstr :: Curve -> Constr Source # dataTypeOf :: Curve -> DataType Source # dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c Curve ) Source # dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c Curve ) Source # gmapT :: ( forall b. Data b => b -> b) -> Curve -> Curve Source # gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Curve -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Curve -> r Source # gmapQ :: ( forall d. Data d => d -> u) -> Curve -> [u] Source # gmapQi :: Int -> ( forall d. Data d => d -> u) -> Curve -> u Source # gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Curve -> m Curve Source # gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Curve -> m Curve Source # gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Curve -> m Curve Source # |
|
Read Curve Source # | |
Show Curve Source # | |
type PublicPoint = Point Source #
ECC Public Point
type PrivateNumber = Integer Source #
ECC Private Number
Represent Diffie Hellman shared secret.
Instances
generatePrivate :: MonadRandom m => Curve -> m PrivateNumber 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.