commit 5f6fe8ddd9ce34760f1697548956af1b23ffbca0
parent c7212007028054431bd1514717d415d50825910a
Author: Jared Tobin <jared@jtobin.io>
Date: Mon, 26 Feb 2024 16:50:13 +0400
test: add csecp256k1-tests skeleton
Diffstat:
2 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/ppad-csecp256k1.cabal b/ppad-csecp256k1.cabal
@@ -2,13 +2,20 @@ cabal-version: 3.0
name: ppad-csecp256k1
version: 0.1.0
synopsis: bitcoin-core/secp256k1 bindings
-description: bitcoin-core/secp256k1 bindings.
license: MIT
license-file: LICENSE
author: Jared Tobin
maintainer: jared@ppad.tech
category: Cryptography
build-type: Simple
+tested-with: GHC == 9.6.4
+description: bitcoin-core/secp256k1 bindings.
+ Bindings to bitcoin-core/secp256k1, which provides digital
+ signatures and other cryptographic primitives on the secp256k1
+ elliptic curve.
+ .
+ This library exposes a minimal subset of functionality, primarily
+ supporting ECDSA/Schnorr signatures and ECDH secret computation.
source-repository head
type: git
@@ -76,3 +83,20 @@ test-suite secp256k1-sys-tests
, tasty
, tasty-hunit
+test-suite csecp256k1-tests
+ type: exitcode-stdio-1.0
+ default-language: Haskell2010
+ hs-source-dirs: test
+ main-is: Main.hs
+
+ ghc-options:
+ -rtsopts -Wall
+
+ build-depends:
+ base
+ , bytestring
+ , entropy
+ , ppad-csecp256k1
+ , tasty
+ , tasty-hunit
+
diff --git a/test/Main.hs b/test/Main.hs
@@ -0,0 +1,24 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Main where
+
+import qualified Data.ByteString as BS
+import Crypto.Secp256k1
+import qualified System.Entropy as E
+import Test.Tasty
+import Test.Tasty.HUnit
+
+main :: IO ()
+main = defaultMain units
+
+units :: TestTree
+units = testGroup "unit tests" [
+ ]
+
+-- XX check rust-secp256k1 for examples
+-- more generally, any secret key can provide a pubkey; the issue is in
+-- knowing the implementation is performing correctly.
+--
+-- i can likely use secp256k1-haskell to confirm same behaviour, though.
+
+