----------------------------------------------------------------------------- -- | -- Module : Codec.Crypto.ECC.ECDH -- Copyright : (c) Marcel Fourné 20[09..13] -- License : BSD3 -- Maintainer : Marcel Fourné (hecc@bitrot.dyndns.org -- -- basic ECDH functions using hecc -- ----------------------------------------------------------------------------- module Codec.Crypto.ECC.ECDH where import Codec.Crypto.ECC.Base -- import Codec.Crypto.ECC.StandardCurves -- private key dA of this side and public key qB of the communication partner, returning the simple x coordinate as result -- to be executed on both sides with fitting parameters... -- d = pickOne [1..N-1] -- q = pmul G d basicecdh :: Integer -> ECPF Integer -> Integer basicecdh dA qB = getx $ pmul qB dA