secp256k1

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

commit 0da2520a8c1c6ddaad121fef7569458be669a729
parent c92a62ea54cda25cb34fa12beec25b844223216c
Author: Jared Tobin <jared@jtobin.io>
Date:   Sun, 15 Sep 2024 19:24:52 +0400

meta: misc structural updates

Diffstat:
Mflake.lock | 71++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Mflake.nix | 6++++--
Mppad-secp256k1.cabal | 1+
Mtest/Main.hs | 2+-
4 files changed, 76 insertions(+), 4 deletions(-)

diff --git a/flake.lock b/flake.lock @@ -18,6 +18,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1710734606, @@ -34,10 +52,46 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1725910328, + "narHash": "sha256-n9pCtzGZ0httmTwMuEbi5E78UQ4ZbQMr1pzi5N0LAG8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5775c2583f1801df7b790bf7f7d710a19bac66f4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "ppad-sha256": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1726324606, + "narHash": "sha256-fV6mQuQLOtPQzXBP4LLeerb7dgGnA3bPBdNfd3eND6A=", + "ref": "refs/heads/master", + "rev": "6c0243df810e8959e193a0fe9e9f772235fefc52", + "revCount": 64, + "type": "git", + "url": "git://git.ppad.tech/sha256.git" + }, + "original": { + "type": "git", + "url": "git://git.ppad.tech/sha256.git" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "ppad-sha256": "ppad-sha256" } }, "systems": { @@ -54,6 +108,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix @@ -4,9 +4,10 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; + ppad-sha256.url = "git://git.ppad.tech/sha256.git"; }; - outputs = { self, nixpkgs, flake-utils }: + outputs = { self, nixpkgs, flake-utils, ppad-sha256 }: flake-utils.lib.eachDefaultSystem (system: let lib = "ppad-secp256k1"; @@ -16,6 +17,7 @@ hpkgs = pkgs.haskell.packages.ghc964.override { overrides = new: old: { + ppad-sha256 = ppad-sha256.packages.${system}.ppad-sha256; ${lib} = old.callCabal2nix lib ./. {}; }; }; @@ -27,7 +29,7 @@ { packages.${lib} = hpkgs.${lib}; - defaultPackage = self.packages.${system}.${lib}; + packages.default = self.packages.${system}.${lib}; devShells.default = hpkgs.shellFor { packages = p: [ diff --git a/ppad-secp256k1.cabal b/ppad-secp256k1.cabal @@ -29,6 +29,7 @@ library base , base16-bytestring , bytestring + , ppad-sha256 test-suite secp256k1-tests type: exitcode-stdio-1.0 diff --git a/test/Main.hs b/test/Main.hs @@ -3,7 +3,7 @@ module Main where import qualified Data.ByteString as BS -import Crypto.Secp256k1 +import Crypto.Curve.Secp256k1 import Test.Tasty import Test.Tasty.HUnit