Skip to content

Commit

Permalink
Temporarily drop EdDSA support until linking is sorted
Browse files Browse the repository at this point in the history
Packages which depend on tinfoil currently rely on linking with
libsodium, which makes the executables they build nonportable. The
right solution to this is linking to a static version of libsodium
(#65) and/or split the package (#59), but until this can be fully
implemented and pushed through to master, this is a temporary fix so
we can build working client executables (ref
https://github.com/ambiata/ambiata-cli/issues/59).
  • Loading branch information
olorin committed Nov 29, 2016
1 parent 87ea92a commit 2896121
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 182 deletions.
7 changes: 0 additions & 7 deletions ambiata-tinfoil.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,11 @@ library
Tinfoil.MAC
Tinfoil.Random
Tinfoil.Random.Internal
Tinfoil.Signing.Ed25519
Tinfoil.Signing.Ed25519.Internal
Tinfoil.Token

extra-libraries: sodium

pkgconfig-depends: libsodium >= 0.4.5

c-sources:
-- tinfoil's own c bits
cbits/tinfoil/memory.c
cbits/tinfoil/sodium/constants.c

-- scrypt (https://github.com/Tarsnap/scrypt)
, cbits/scrypt/insecure_memzero.c
Expand Down
16 changes: 0 additions & 16 deletions cbits/tinfoil/sodium/constants.c

This file was deleted.

14 changes: 0 additions & 14 deletions cbits/tinfoil/sodium/constants.h

This file was deleted.

1 change: 0 additions & 1 deletion cbits/tinfoil/tinfoil.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
#define H_TINFOIL

#include "memory.h"
#include "sodium/constants.h"

#endif
45 changes: 0 additions & 45 deletions test/Test/IO/Tinfoil/Signing/Ed25519.hs

This file was deleted.

49 changes: 0 additions & 49 deletions test/Test/IO/Tinfoil/Signing/Ed25519/Internal.hs

This file was deleted.

24 changes: 0 additions & 24 deletions test/Test/Tinfoil/Signing/Ed25519/Internal.hs

This file was deleted.

20 changes: 0 additions & 20 deletions test/bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import Disorder.Core.Gen (GenSeed(..), genDeterministic)

import P

import qualified Prelude

import System.IO
import qualified System.Random as R

Expand All @@ -24,12 +22,10 @@ import Test.QuickCheck
import Test.QuickCheck.Instances ()

import Tinfoil.Comparison
import Tinfoil.Data
import Tinfoil.Hash
import qualified Tinfoil.KDF.Scrypt as Scrypt
import Tinfoil.MAC
import Tinfoil.Random
import qualified Tinfoil.Signing.Ed25519 as Ed25519

generate' :: Gen a -> IO a
generate' = pure . genDeterministic (GenSeed 314159)
Expand All @@ -43,16 +39,6 @@ bsTriple small big = do
let big2 = BS.copy big1
pure (BS.pack $ short1 <> long, big1, big2)

genEd25519 :: IO (SecretKey Ed25519, PublicKey Ed25519, Signature Ed25519, ByteString)
genEd25519 = do
(pk, sk) <- Ed25519.genKeyPair
msg <- generate' arbitrary
let sig = fromJust' $ Ed25519.signMessage sk msg
pure (sk, pk, sig, msg)
where
fromJust' Nothing' = Prelude.error "impossible: signing valid message failed"
fromJust' (Just' x) = x

-- non-CSPRNG, just a performance baseline.
stdRandom :: Int -> IO ByteString
stdRandom n = BS.pack <$> R.getStdRandom (genBytes n [])
Expand Down Expand Up @@ -116,10 +102,4 @@ main = tinfoilBench [
, env ((,) <$> generate' arbitrary <*> generate' arbitrary) $ \ ~(sk, bs) ->
bgroup "mac/hmacSHA256" $ [ bench "hmacSHA256" $ nf (hmacSHA256 sk) bs
]
, env genEd25519 $ \ ~(sk, pk, sig, msg) ->
bgroup "signing/ed25519" $ [
bench "genKeyPair" $ nfIO Ed25519.genKeyPair
, bench "signMessage" $ nf (Ed25519.signMessage sk) msg
, bench "verifyMessage" $ nf (Ed25519.verifyMessage pk sig) msg
]
]
4 changes: 0 additions & 4 deletions test/test-io.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import qualified Test.IO.Tinfoil.KDF.Scrypt
import qualified Test.IO.Tinfoil.KDF.Scrypt.Compat
import qualified Test.IO.Tinfoil.MAC
import qualified Test.IO.Tinfoil.Random
import qualified Test.IO.Tinfoil.Signing.Ed25519
import qualified Test.IO.Tinfoil.Signing.Ed25519.Internal

main :: IO ()
main =
Expand All @@ -22,6 +20,4 @@ main =
, Test.IO.Tinfoil.KDF.Scrypt.Compat.tests
, Test.IO.Tinfoil.MAC.tests
, Test.IO.Tinfoil.Random.tests
, Test.IO.Tinfoil.Signing.Ed25519.tests
, Test.IO.Tinfoil.Signing.Ed25519.Internal.tests
]
2 changes: 0 additions & 2 deletions test/test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import qualified Test.Tinfoil.Hash.TestVectors
import qualified Test.Tinfoil.KDF.Scrypt
import qualified Test.Tinfoil.MAC
import qualified Test.Tinfoil.Random
import qualified Test.Tinfoil.Signing.Ed25519.Internal

main :: IO ()
main =
Expand All @@ -27,5 +26,4 @@ main =
, Test.Tinfoil.MAC.tests
, Test.Tinfoil.KDF.Scrypt.tests
, Test.Tinfoil.Random.tests
, Test.Tinfoil.Signing.Ed25519.Internal.tests
]

0 comments on commit 2896121

Please sign in to comment.