Skip to content

Commit

Permalink
Remove non-standard support
Browse files Browse the repository at this point in the history
I removed support for all non-standard features:

- ECDH
- Schnorr Signatures
- Signature Recovery

These features are rarely compiled in shared libraries avaliable
from distribution repositories. Also, they are not needed for any
Haskoin project, so there is little incentive for me to continue
maintaining them, especially when I have no good way to test this
code.

Please make your own fork of this library if you wish to add these
back.
  • Loading branch information
jprupp committed Jun 13, 2020
1 parent f8e9dfb commit 0f862c2
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 767 deletions.
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This is the simple Travis configuration, which is intended for use
# on applications which do not require cross-platform and
# multiple-GHC-version support. For more information and other
# options, see:
#
# https://docs.haskellstack.org/en/stable/travis_ci/
#
# Copy these contents into the root directory of your Github project in a file
# named .travis.yml

# Choose a build environment
dist: xenial

# Do not choose a language; we provide our own build tools.
language: generic

# Caching so the next build will be fast too.
cache:
directories:
- $HOME/.stack

# Ensure necessary system libraries are present
addons:
apt:
packages:
- libgmp-dev
- secp256k1

before_install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'

install:
# Build dependencies
- stack --no-terminal --install-ghc test --only-dependencies

script:
# Build the package, its tests, and its docs and run the tests
- stack --no-terminal test --haddock --no-haddock-deps
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.2.6
### Fixed
- Compiles with all flags now.

### Added
- Script to compile with all flags.

### Removed
- Remove ECDH support.
- Remove Schnorr support.
- Remove Recovery support.

## 0.2.5
### Changed
- Reuse context aggressively.
- Generate context in a single thread.

### Fixed
- Memory deallocation bug.

## 0.2.4
### Changed
- Update Cabal and package version.
Expand Down
28 changes: 1 addition & 27 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: secp256k1-haskell
version: 0.2.5
version: 0.3.0
synopsis: Bindings for secp256k1
description: Sign and verify signatures using the secp256k1 library.
category: Crypto
Expand All @@ -23,15 +23,6 @@ dependencies:
- hashable
- QuickCheck
- string-conversions
when:
- condition: flag(ecdh)
cpp-options: -DECDH
- condition: flag(schnorr)
cpp-options: -DSCHNORR
- condition: flag(recovery)
cpp-options: -DRECOVERY
- condition: flag(negate)
cpp-options: -DNEGATE
library:
source-dirs: src
generated-exposed-modules:
Expand All @@ -55,20 +46,3 @@ tests:
- monad-par
- mtl
- HUnit
flags:
negate:
description: "Enable tweak negate"
manual: true
default: false
ecdh:
description: "Enable (experimental) ECDH APIs"
manual: true
default: false
schnorr:
description: "Enable BIP-340 (Schnorr) APIs"
manual: true
default: false
recovery:
description: "Enable signature key recovery APIs"
manual: true
default: false
40 changes: 2 additions & 38 deletions secp256k1-haskell.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ cabal-version: 2.0
--
-- see: https://github.com/sol/hpack
--
-- hash: f64a6c7d68d58fab5fc141dd7bda78089fe9403dc39525641eba1ca0fd92593c
-- hash: d55c31829652e236145323f89ee1ec9c61e4f18712778a13011c688d36db8b19

name: secp256k1-haskell
version: 0.2.5
version: 0.3.0
synopsis: Bindings for secp256k1
description: Sign and verify signatures using the secp256k1 library.
category: Crypto
Expand All @@ -27,26 +27,6 @@ source-repository head
type: git
location: https://github.com/haskoin/secp256k1-haskell.git

flag ecdh
description: Enable (experimental) ECDH APIs
manual: True
default: False

flag negate
description: Enable tweak negate
manual: True
default: False

flag recovery
description: Enable signature key recovery APIs
manual: True
default: False

flag schnorr
description: Enable BIP-340 (Schnorr) APIs
manual: True
default: False

library
exposed-modules:
Crypto.Secp256k1
Expand All @@ -68,14 +48,6 @@ library
, entropy
, hashable
, string-conversions
if flag(ecdh)
cpp-options: -DECDH
if flag(schnorr)
cpp-options: -DSCHNORR
if flag(recovery)
cpp-options: -DRECOVERY
if flag(negate)
cpp-options: -DNEGATE
default-language: Haskell2010

test-suite spec
Expand Down Expand Up @@ -103,13 +75,5 @@ test-suite spec
, mtl
, secp256k1-haskell
, string-conversions
if flag(ecdh)
cpp-options: -DECDH
if flag(schnorr)
cpp-options: -DSCHNORR
if flag(recovery)
cpp-options: -DRECOVERY
if flag(negate)
cpp-options: -DNEGATE
default-language: Haskell2010
build-tool-depends: hspec-discover:hspec-discover
Loading

0 comments on commit 0f862c2

Please sign in to comment.