Code Monkey home page Code Monkey logo

haskell-libsodium's Introduction

libsodium Haskell bindings

CURRENTLY UNMAINTAINED! Please see issue #6.

Bindings to libsodium for Haskell.

The purpose of this library is to expose libsodium to Haskell applications. This library does not try to protect the developer from using libsodium incorrectly, so it is important to understand how to use libsodium. Refer to the libsodium documentation. Also, see the haddock documentation and tests for examples on how to use these bindings.

This library is not production-ready and should not be used for purposes where cryptographic failure may endanger anyone's life, liberty or pursuit of happiness.

haskell-libsodium's People

Contributors

dino- avatar dmp1ce avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

haskell-libsodium's Issues

MacOS: tests fail

MacOS, Xcode-9.3, GHC-8.2.2:

$ stack test
bindings-libsodium-0.1.0.0: unregistering (missing dependencies: Glob, QuickCheck, doctest, tasty, tasty-hunit, tasty-quickcheck, text)
base-compat-0.9.3: configure
async-2.1.1.1: download
base-compat-0.9.3: build
code-page-0.1.3: configure
code-page-0.1.3: build
clock-0.7.2: configure
code-page-0.1.3: copy/register
clock-0.7.2: build
async-2.1.1.1: configure
async-2.1.1.1: build
colour-2.3.4: configure
base-compat-0.9.3: copy/register
dlist-0.8.0.4: download
colour-2.3.4: build
dlist-0.8.0.4: configure
clock-0.7.2: copy/register
async-2.1.1.1: copy/register
dlist-0.8.0.4: build
ghc-paths-0.1.0.9: configure
mtl-2.2.2: download
dlist-0.8.0.4: copy/register
Glob-0.9.2: download
ghc-paths-0.1.0.9: build
mtl-2.2.2: configure
ghc-paths-0.1.0.9: copy/register
doctest-0.13.0: download
mtl-2.2.2: build
Glob-0.9.2: configure
colour-2.3.4: copy/register
ansi-terminal-0.8.0.2: download
Glob-0.9.2: build
doctest-0.13.0: configure
doctest-0.13.0: build
ansi-terminal-0.8.0.2: configure
ansi-terminal-0.8.0.2: build
mtl-2.2.2: copy/register
primitive-0.6.3.0: download
primitive-0.6.3.0: configure
Glob-0.9.2: copy/register
primitive-0.6.3.0: build
text-1.2.3.0: download
text-1.2.3.0: configure
text-1.2.3.0: build
ansi-terminal-0.8.0.2: copy/register
ansi-wl-pprint-0.6.8.2: download
ansi-wl-pprint-0.6.8.2: configure
ansi-wl-pprint-0.6.8.2: build
ansi-wl-pprint-0.6.8.2: copy/register
optparse-applicative-0.14.2.0: download
optparse-applicative-0.14.2.0: configure
optparse-applicative-0.14.2.0: build
primitive-0.6.3.0: copy/register
tf-random-0.5: download
tf-random-0.5: configure
doctest-0.13.0: copy/register
tf-random-0.5: build
unbounded-delays-0.1.1.0: configure
unbounded-delays-0.1.1.0: build
unbounded-delays-0.1.1.0: copy/register
tf-random-0.5: copy/register
QuickCheck-2.10.1: download
QuickCheck-2.10.1: configure
QuickCheck-2.10.1: build
optparse-applicative-0.14.2.0: copy/register
tasty-1.0.1.1: download
tasty-1.0.1.1: configure
tasty-1.0.1.1: build
tasty-1.0.1.1: copy/register
tasty-hunit-0.10.0.1: download
tasty-hunit-0.10.0.1: configure
tasty-hunit-0.10.0.1: build
tasty-hunit-0.10.0.1: copy/register
QuickCheck-2.10.1: copy/register
tasty-quickcheck-0.9.2: download
tasty-quickcheck-0.9.2: configure
tasty-quickcheck-0.9.2: build
tasty-quickcheck-0.9.2: copy/register
text-1.2.3.0: copy/register
bindings-libsodium-0.1.0.0: configure (lib + test)
Configuring bindings-libsodium-0.1.0.0...
bindings-libsodium-0.1.0.0: build (lib + test)
Preprocessing library for bindings-libsodium-0.1.0.0..
Building library for bindings-libsodium-0.1.0.0..
[1 of 2] Compiling Bindings.LibSodium ( .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Bindings/LibSodium.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Bindings/LibSodium.o )
[2 of 2] Compiling Crypto.LibSodium ( src/Crypto/LibSodium.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Crypto/LibSodium.o )
Preprocessing test suite 'libsodium-test' for bindings-libsodium-0.1.0.0..
Building test suite 'libsodium-test' for bindings-libsodium-0.1.0.0..
[1 of 4] Compiling TestHelpers      ( src-test/TestHelpers.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/libsodium-test/libsodium-test-tmp/TestHelpers.o )
[2 of 4] Compiling HighLevelTests   ( src-test/HighLevelTests.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/libsodium-test/libsodium-test-tmp/HighLevelTests.o )
[3 of 4] Compiling BindingTests     ( src-test/BindingTests.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/libsodium-test/libsodium-test-tmp/BindingTests.o )
[4 of 4] Compiling Main             ( src-test/Main.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/libsodium-test/libsodium-test-tmp/Main.o )
Linking .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/libsodium-test/libsodium-test ...
Preprocessing test suite 'libsodium-doctest' for bindings-libsodium-0.1.0.0..
Building test suite 'libsodium-doctest' for bindings-libsodium-0.1.0.0..
[1 of 1] Compiling Main             ( src-doctest/Main.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/libsodium-doctest/libsodium-doctest-tmp/Main.o )
Linking .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/libsodium-doctest/libsodium-doctest ...
bindings-libsodium-0.1.0.0: copy/register
Installing library in /Users/uri/src/haskell-libsodium/.stack-work/install/x86_64-osx/lts-11.5/8.2.2/lib/x86_64-osx-ghc-8.2.2/bindings-libsodium-0.1.0.0-JyTvnR9M6Z05zAdTw7NKwf
Registering library for bindings-libsodium-0.1.0.0..
bindings-libsodium-0.1.0.0: test (suite: libsodium-doctest)
               
Progress: 22/23Examples: 0  Tried: 0  Errors: 0  Failures: 0
               
bindings-libsodium-0.1.0.0: Test suite libsodium-doctest passed
bindings-libsodium-0.1.0.0: test (suite: libsodium-test)
               
all-tests
  Unit_tests_bindings
    c'sodium_init:                    OK
    c'sodium_memcmp:                  OK
    c'sodium_bin2hex:                 OK
      +++ OK, passed 100 tests.
    c'sodium_hex2bin:                 OK (0.02s)
      +++ OK, passed 100 tests.
    hex2bin_bin2hex:                  OK
      +++ OK, passed 100 tests.
    c'sodium_increment:               OK
    c'sodium_add:                     OK
    c'sodium_compare:                 OK
    c'sodium_is_zero:                 OK
    c'sodium_memzero:                 OK
    c'sodium_mlock:                   OK
    c'sodium_allocarray:              OK
    c'sodium_mprotect:                OK
    c'sodium_allocarray_crash:        FAIL (1.37s)
      src-test/BindingTests.hs:323:
      expected: -11
       but got: -10
    c'sodium_mprotect_noaccess_crash: FAIL (1.39s)
      src-test/BindingTests.hs:323:
      expected: -11
       but got: -10
    c'sodium_mprotect_readonly_crash: FAIL (1.38s)
      src-test/BindingTests.hs:323:
      expected: -11
       but got: -10
    c'randombytes_random:             OK
    c'randombytes_uniform:            OK
    c'randombytes_buf:                OK
    c'randombytes_stir:               OK
    c'crypto_secretbox_easy:          OK
      +++ OK, passed 100 tests.
    c'crypto_secretbox_detached:      OK
      +++ OK, passed 100 tests.
    c'crypto_scalarmult_base:         OK (0.02s)
      +++ OK, passed 100 tests.
  Unit_tests_high-level
    sodiumInit:                       OK
    sodiumMemcmp:                     OK
    sodiumBin2Hex:                    OK
      +++ OK, passed 100 tests.
    sodiumHex2Bin:                    OK
      +++ OK, passed 100 tests.
    sodiumHex2Bin_Bin2Hex:            OK
      +++ OK, passed 100 tests.
    sodiumIncrement:                  OK
    sodiumAdd:                        OK
    sodiumCompare:                    OK
    sodiumIsZero:                     OK
    sodiumMemZero:                    OK
    sodiumMLock:                      OK
    sodiumAllocArray:                 OK
    sodiumMProtect:                   OK
    randomBytesRandom:                OK
    randomBytesUniform:               OK
    randomBytesBuf:                   OK
    randomBytesStir:                  OK
    cryptoSecretBoxEasy:              OK (0.01s)
      +++ OK, passed 100 tests.
    cryptoSecretBoxDetached:          OK (0.07s)
      +++ OK, passed 100 tests.

3 out of 42 tests failed (1.39s)

bindings-libsodium-0.1.0.0: Test suite libsodium-test failed
Completed 23 action(s).
Test suite failure for package bindings-libsodium-0.1.0.0
    libsodium-test:  exited with: ExitFailure 1
Logs printed to console

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.2.2
$ stack --version
Version 1.6.5, Git revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9 (5514 commits) x86_64 hpack-0.20.0
$ cabal --version
cabal-install version 2.0.0.1
compiled using version 2.0.1.1 of the Cabal library 
$ $ cat /opt/local/include/sodium/version.h | fgrep VERSION
#define SODIUM_VERSION_STRING "1.0.16"
#define SODIUM_LIBRARY_VERSION_MAJOR 10
#define SODIUM_LIBRARY_VERSION_MINOR 1
$

Is this library still maintained?

Hi @dmp1ce, I'm currently trying to tidy up the bindings linked on the libsodium website. If this library is still maintained, then please let me know; otherwise, the link to this library will likely be removed from the bindings page to help users find up to date and maintained bindings.

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.