Giter Club home page Giter Club logo

hs-ed25519's Introduction

Minimal package for ed25519 signatures

Linux Build Status Windows Build Status Hackage version Stackage version MIT Haskell

This package implements minimal bindings to the ed25519 signature scheme. It's designed to be small, with no dependencies, and fast. It also comes with extensive guidelines and detailed documentation. It should be relatively easy to both depend on directly with Cabal or even copy into any projects that need it directly.

For full details (including notes on the underlying implementation), check out the docs.

Installation

It's just a cabal install away on Hackage:

$ cabal install ed25519

Join in

Be sure to read the contributing guidelines. File bugs in the GitHub issue tracker.

Master git repository:

  • git clone https://github.com/thoughtpolice/hs-ed25519.git

There's also a BitBucket mirror:

  • git clone https://bitbucket.org/thoughtpolice/hs-ed25519.git

Authors

See AUTHORS.txt.

License

MIT. See LICENSE.txt for terms of copyright and redistribution.

hs-ed25519's People

Contributors

andreasabel avatar bergmark avatar domenkozar avatar eddiejessup avatar jprider63 avatar juhp avatar l29ah avatar mithrandi avatar peti avatar phadej avatar thoughtpolice avatar tristancacqueray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hs-ed25519's Issues

Needs update for QuickCheck 2.7

Hi,

I’m getting build failures on Debian:

Preprocessing test suite 'properties' for ed25519-0.0.2.0...
[1 of 1] Compiling Main             ( tests/properties.hs, dist-ghc/build/properties/properties-tmp/Main.o )

tests/properties.hs:90:9:
    Constructor `Failure' should have 10 arguments, but has been given 8
    In the pattern: Failure n _ _ _ _ _ _ _
    In a case alternative: Failure n _ _ _ _ _ _ _ -> return (False, n)
    In a stmt of a 'do' block:
      case r of {
        Success n _ _ -> return (True, n)
        GaveUp n _ _ -> return (True, n)
        Failure n _ _ _ _ _ _ _ -> return (False, n)
        _ -> return (False, 0) }
make: *** [build-ghc-stamp] Error 1

http://aws-logs.debian.net/ftbfs-logs/2014/08/30/haskell-ed25519_0.0.2.0-2_unstable.log

It seems that you need to upgrade to the latest QuickCheck.

another hlint testsuite failure

Test suite hlint: RUNNING...
hlint: Cannot expand #if directive in file benchmarks/bench1.hs at line 14 col 1:
MIN_VERSION_bytestring(a,b,c) is not a defined macro
Test suite hlint: FAIL

build failure with ghc-8.6.5

Building test suite 'properties' for ed25519-0.0.5.0..
[1 of 1] Compiling Main             ( tests/properties.hs, dist-ghc/build/properties/properties-tmp/Main.o )

tests/properties.hs:87:9: error:
    * The constructor `Success' should have 6 arguments, but has been given 3
    * In the pattern: Success n _ _
      In a case alternative: Success n _ _ -> return (True, n)
      In a stmt of a 'do' block:
        case r of
          Success n _ _ -> return (True, n)
          GaveUp n _ _ -> return (True, n)
          Failure n _ _ _ _ _ _ _ _ _ _ -> return (False, n)
          _ -> return (False, 0)
   |
87 |         Success n _ _           -> return (True, n)
   |         ^^^^^^^^^^^^^

cope with QuickCheck >= 2.12

tests/properties.hs needs 5 underscores after Success n, 5 underscores after GaveUp n, and 12 underscores after Failure n for QuickCheck 2.12 and 2.13.

Test suite failure with GHC 8

This is due to hlint failing, I'm not sure if it's related to GHC 8:

> /tmp/stackage-build8/ed25519-0.0.5.0$ runghc -clear-package-db -global-package-db -package-db=/home/stackage/work/builds/nightly/pkgdb Setup configure --enable-tests --package-db=clear --package-db=global --package-db=/home/stackage/work/builds/nightly/pkgdb --libdir=/home/stackage/work/builds/nightly/lib --bindir=/home/stackage/work/builds/nightly/bin --datadir=/home/stackage/work/builds/nightly/share --libexecdir=/home/stackage/work/builds/nightly/libexec --sysconfdir=/home/stackage/work/builds/nightly/etc --docdir=/home/stackage/work/builds/nightly/doc/ed25519-0.0.5.0 --htmldir=/home/stackage/work/builds/nightly/doc/ed25519-0.0.5.0 --haddockdir=/home/stackage/work/builds/nightly/doc/ed25519-0.0.5.0 --flags=
Configuring ed25519-0.0.5.0...
> /tmp/stackage-build8/ed25519-0.0.5.0$ runghc -clear-package-db -global-package-db -package-db=/home/stackage/work/builds/nightly/pkgdb Setup build
Building ed25519-0.0.5.0...
Preprocessing library ed25519-0.0.5.0...
[1 of 1] Compiling Crypto.Sign.Ed25519 ( src/Crypto/Sign/Ed25519.hs, dist/build/Crypto/Sign/Ed25519.o )
Preprocessing test suite 'properties' for ed25519-0.0.5.0...
[1 of 1] Compiling Main             ( tests/properties.hs, dist/build/properties/properties-tmp/Main.o )
Linking dist/build/properties/properties ...
Preprocessing test suite 'hlint' for ed25519-0.0.5.0...
[1 of 1] Compiling Main             ( tests/hlint.hs, dist/build/hlint/hlint-tmp/Main.o )
Linking dist/build/hlint/hlint ...
Preprocessing test suite 'doctests' for ed25519-0.0.5.0...
[1 of 1] Compiling Main             ( tests/doctests.hs, dist/build/doctests/doctests-tmp/Main.o )
Linking dist/build/doctests/doctests ...
> /tmp/stackage-build8/ed25519-0.0.5.0$ dist/build/properties/properties
Signature roundtrip                     : +++ OK, passed 100 tests.
Detached signature roundtrip            : +++ OK, passed 100 tests.
Detached signature length               : +++ OK, passed 100 tests.
Detached signature length (#2)          : +++ OK, passed 100 tests.
Passed 400 tests!
> /tmp/stackage-build8/ed25519-0.0.5.0$ dist/build/hlint/hlint
src/Crypto/Sign/Ed25519.hs:391:1: Warning: Eta reduce
Found:
  sign' sk xs = dsign sk xs
Why not:
  sign' = dsign

src/Crypto/Sign/Ed25519.hs:406:1: Warning: Eta reduce
Found:
  verify' pk xs sig = dverify pk xs sig
Why not:
  verify' = dverify

2 hints

Support for deserializing PublicKey and Signature

I'm building a server where I need to send signatures and public keys back and forth, in order for the client and server to verify each other's messages. I can send both PublicKeys and Signatures as ByteStrings using unPublicKey and unSignature, respectively, but I cannot construct the original objects back from this serialization, as far as I can see.

ed25519-0.0.2.0 can't compile its test suite

Citing from http://hydra.cryp.to/build/1113684/nixlog/1/raw:

Preprocessing test suite 'properties' for ed25519-0.0.2.0...
[1 of 1] Compiling Main             ( tests/properties.hs, dist/build/properties/properties-tmp/Main.dyn_o )

tests/properties.hs:90:9:
    Constructor ‘Failure’ should have 10 arguments, but has been given 8
    In the pattern: Failure n _ _ _ _ _ _ _
    In a case alternative: Failure n _ _ _ _ _ _ _ -> return (False, n)
    In a stmt of a 'do' block:
      case r of {
        Success n _ _ -> return (True, n)
        GaveUp n _ _ -> return (True, n)
        Failure n _ _ _ _ _ _ _ -> return (False, n)
        _ -> return (False, 0) }

hlint testsuite failure

Test suite hlint: RUNNING...
src/Crypto/Sign/Ed25519.hs:86:28: Warning: Redundant bracket
Found:
do _ <- (c_crypto_sign out smlen mstr (fromIntegral mlen) psk)
fromIntegral fmap peek smlen
Why not:
do _ <- c_crypto_sign out smlen mstr (fromIntegral mlen) psk
fromIntegral fmap peek smlen

1 suggestion
Test suite hlint: FAIL

ubuntu 16.04.2 server install ed25519 error

$ sudo npm install -g --unsafe-perm ed25519

[email protected] install /usr/lib/node_modules/ed25519
node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack at PythonFinder. (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:114:15)
gyp ERR! System Linux 4.4.0-79-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/ed25519
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2017-06-14T23_50_43_206Z-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.