hecc 0.4 → 0.4.0.1
raw patch · 3 files changed
+26/−20 lines, 3 files
Files
- hecc.cabal +3/−2
- src/Codec/Crypto/ECC/ECDH.hs +23/−0
- src/Examples.hs +0/−18
hecc.cabal view
@@ -1,5 +1,5 @@ Name: hecc-Version: 0.4+Version: 0.4.0.1 Synopsis: Elliptic Curve Cryptography for Haskell Description: Pure math & algorithms for Elliptic Curve Cryptography in Haskell License: BSD3@@ -13,7 +13,7 @@ Cabal-Version: >=1.6 Data-Files: README Extra-Source-Files: src/bench.hs- src/Examples.hs+ Library hs-source-dirs: src@@ -24,6 +24,7 @@ hF2 Exposed-modules: Codec.Crypto.ECC.Base+ Codec.Crypto.ECC.ECDH Codec.Crypto.ECC.StandardCurves ghc-options: -Wall -O2 -fllvm -optlo-O3 -feager-blackholing
+ src/Codec/Crypto/ECC/ECDH.hs view
@@ -0,0 +1,23 @@+-----------------------------------------------------------------------------+-- |+-- 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
− src/Examples.hs
@@ -1,18 +0,0 @@--------------------------------------------------------------------------------- |--- Module : --- Copyright : (c) Marcel Fourné 20[09-13]--- License : BSD3--- Maintainer : Marcel Fourné (hecc@bitrot.dyndns.org------ computing ECDH-values as an example-----------------------------------------------------------------------------------import Codec.Crypto.ECC.Base--ecdh :: ECPF Integer -> Integer -> t -> Integer-ecdh a kprivA kprivB = let kpubA = pmul a kprivA- kpubB = pmul a kprivA- ergA = pmul kpubB kprivA- in getx ergA