secp256k1-haskell 0.1.6 → 0.1.7
raw patch · 4 files changed
+31/−22 lines, 4 filesdep +deepseqnew-uploader
Dependencies added: deepseq
Files
- CHANGELOG.md +4/−0
- secp256k1-haskell.cabal +5/−3
- src/Crypto/Secp256k1.hs +4/−5
- src/Crypto/Secp256k1/Internal.hs +18/−14
CHANGELOG.md view
@@ -4,6 +4,10 @@ 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.1.7+### Added+- Add `NFData` instances for all types.+ ## 0.1.6 ### Added - Use `pkgconfig` for C library dependency.
secp256k1-haskell.cabal view
@@ -4,17 +4,17 @@ -- -- see: https://github.com/sol/hpack ----- hash: 4b3271042c18e5ae88246bdb5dd3462ca65939a7d3eea15f84adb96cfa14cdec+-- hash: 31ccf270598fdfc8d03cf317d6f7312b095657c13da49213c81d488825c3fb6f name: secp256k1-haskell-version: 0.1.6+version: 0.1.7 synopsis: Bindings for secp256k1 library from Bitcoin Core description: Sign and verify signatures using the very fast C secp256k1 library from Pieter Wuille. Has Haskell types and abstractions for keys and signatures. category: Crypto homepage: http://github.com/haskoin/secp256k1-haskell#readme bug-reports: https://github.com/haskoin/secp256k1-haskell.git/issues author: Jean-Pierre Rupp-maintainer: xenog@protonmail.com+maintainer: jprupp@protonmail.ch copyright: (c) 2017 Jean-Pierre Rupp license: PublicDomain license-file: UNLICENSE@@ -48,6 +48,7 @@ , base16-bytestring , bytestring , cereal+ , deepseq , entropy , hashable , string-conversions@@ -71,6 +72,7 @@ , base16-bytestring , bytestring , cereal+ , deepseq , entropy , hashable , hspec
src/Crypto/Secp256k1.hs view
@@ -74,11 +74,10 @@ import Data.Serialize (decode, encode) import Data.String (IsString (..)) import Data.String.Conversions (ConvertibleStrings, cs)-import Foreign (ForeignPtr (..), alloca,- allocaArray, allocaBytes,- mallocForeignPtr, nullFunPtr,- nullPtr, peek, poke, pokeArray,- withForeignPtr)+import Foreign (ForeignPtr, alloca, allocaArray,+ allocaBytes, mallocForeignPtr,+ nullFunPtr, nullPtr, peek, poke,+ pokeArray, withForeignPtr) import System.IO.Unsafe (unsafePerformIO) import Test.QuickCheck (Arbitrary (..), arbitraryBoundedRandom, suchThat)
src/Crypto/Secp256k1/Internal.hs view
@@ -1,4 +1,6 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveAnyClass #-}+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RecordWildCards #-} {-| Module : Crypto.Secp256k1.Internal@@ -12,6 +14,7 @@ -} module Crypto.Secp256k1.Internal where +import Control.DeepSeq import Control.Monad import Data.ByteString (ByteString) import qualified Data.ByteString as BS@@ -21,29 +24,30 @@ import qualified Data.Serialize.Put as Put import Foreign import Foreign.C+import GHC.Generics (Generic) import System.Entropy import System.IO.Unsafe data Ctx = Ctx newtype PubKey64 = PubKey64 { getPubKey64 :: ShortByteString }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) newtype Msg32 = Msg32 { getMsg32 :: ShortByteString }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) newtype Sig64 = Sig64 { getSig64 :: ShortByteString }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) data CompactSig = CompactSig { getCompactSigR :: !ShortByteString , getCompactSigS :: !ShortByteString }- deriving (Show, Eq, Ord)+ deriving (Show, Eq, Ord, Generic, NFData) newtype RecSig65 = RecSig65 { getRecSig65 :: ShortByteString }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) data CompactRecSig = CompactRecSig@@ -51,31 +55,31 @@ , getCompactRecSigS :: !ShortByteString , getCompactRecSigV :: !Word8 }- deriving (Show, Eq, Ord)+ deriving (Show, Eq, Ord, Generic, NFData) newtype Seed32 = Seed32 { getSeed32 :: ShortByteString }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) newtype SecKey32 = SecKey32 { getSecKey32 :: ShortByteString }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) newtype Tweak32 = Tweak32 { getTweak32 :: ShortByteString }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) newtype Nonce32 = Nonce32 { getNonce32 :: ShortByteString }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) newtype Algo16 = Algo16 { getAlgo16 :: ShortByteString }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) newtype CtxFlags = CtxFlags { getCtxFlags :: CUInt }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) newtype SerFlags = SerFlags { getSerFlags :: CUInt }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) newtype Ret = Ret { getRet :: CInt }- deriving (Read, Show, Eq, Ord)+ deriving (Read, Show, Eq, Ord, Generic, NFData) -- | Nonce32-generating function type NonceFunction a