bitcoin-hs-0.0.1: Partial implementation of the Bitcoin protocol (as of 2013)

Bitcoin.Crypto.EC.DiffieHellman

Description

Diffie-Hellman key exchange

Synopsis

# Documentation

newtype SharedSecret Source #

Constructors

 SharedSecret [Word8]

Instances

 Source # Methods Source # Methods Source # MethodsshowList :: [SharedSecret] -> ShowS # Source # Methods

Given your private key and somebody else's public key, this compute a (256 bit) shared secret.

This is actually very simple: since pubkey = G * privkey, the shared secret will be simply G * privkey1 * privkey2.

This can fail if for example an invalid pubkey is given, and in some other special circumstances.