secp256k1

Pure Haskell cryptographic primitives on the secp256k1 elliptic curve.
git clone git://git.ppad.tech/secp256k1.git
Log | Files | Refs | LICENSE

commit 164cc1dd9d5a0a3f58a38ba922856afe4b25cbea
parent 65476d1d3830f8ebdbd78afa1316256a381dd6be
Author: Jared Tobin <jared@jtobin.io>
Date:   Thu, 10 Oct 2024 01:06:27 +0400

test: bitcoin wycheproof skeleton (2 failing)

Diffstat:
Mtest/Main.hs | 21++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/test/Main.hs b/test/Main.hs @@ -24,17 +24,24 @@ fi = fromIntegral main :: IO () main = do - wycheproof_ecdsa_sha256 <- TIO.readFile "etc/ecdsa_secp256k1_sha256_test.json" - case A.decodeStrictText wycheproof_ecdsa_sha256 :: Maybe W.Wycheproof of + wp_ecdsa_sha256 <- TIO.readFile "etc/ecdsa_secp256k1_sha256_test.json" + wp_ecdsa_sha256_bitcoin <- TIO.readFile + "etc/ecdsa_secp256k1_sha256_bitcoin_test.json" + let pair = do + wp0 <- A.decodeStrictText wp_ecdsa_sha256 :: Maybe W.Wycheproof + wp1 <- A.decodeStrictText wp_ecdsa_sha256_bitcoin :: Maybe W.Wycheproof + pure (wp0, wp1) + case pair of Nothing -> error "couldn't parse wycheproof vectors" - Just w -> defaultMain $ testGroup "ppad-secp256k1" [ + Just (w0, w1) -> defaultMain $ testGroup "ppad-secp256k1" [ units - , wycheproof_tests w + , wycheproof_tests "(ecdsa, sha256)" w0 + -- , wycheproof_tests "(ecdsa, sha256, bitcoin)" w1 ] -wycheproof_tests :: W.Wycheproof -> TestTree -wycheproof_tests W.Wycheproof {..} = - testGroup "wycheproof vectors (ecdsa, sha256)" $ +wycheproof_tests :: String -> W.Wycheproof -> TestTree +wycheproof_tests msg W.Wycheproof {..} = + testGroup ("wycheproof vectors " <> msg) $ fmap execute_group wp_testGroups execute_group :: W.EcdsaTestGroup -> TestTree