secp256k1-haskell 0.1.7 → 0.1.8
raw patch · 3 files changed
+25/−2 lines, 3 files
Files
- CHANGELOG.md +4/−0
- secp256k1-haskell.cabal +2/−2
- src/Crypto/Secp256k1.hs +19/−0
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.8+### Added+- Add missing `NFData` instances for some types.+ ## 0.1.7 ### Added - Add `NFData` instances for all types.
secp256k1-haskell.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 31ccf270598fdfc8d03cf317d6f7312b095657c13da49213c81d488825c3fb6f+-- hash: 89af02aeb2d034b30650caa8ac3da870deac12d246a8fa513ab1fdc3033461f5 name: secp256k1-haskell-version: 0.1.7+version: 0.1.8 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
src/Crypto/Secp256k1.hs view
@@ -84,6 +84,7 @@ import Text.Read (Lexeme (String), lexP, parens, pfail, readPrec) +import Control.DeepSeq import Crypto.Secp256k1.Internal newtype PubKey = PubKey (ForeignPtr PubKey64)@@ -92,6 +93,24 @@ newtype SecKey = SecKey (ForeignPtr SecKey32) newtype Tweak = Tweak (ForeignPtr Tweak32) newtype RecSig = RecSig (ForeignPtr RecSig65)++instance NFData PubKey where+ rnf (PubKey p) = p `seq` ()++instance NFData Msg where+ rnf (Msg p) = p `seq` ()++instance NFData Sig where+ rnf (Sig p) = p `seq` ()++instance NFData SecKey where+ rnf (SecKey p) = p `seq` ()++instance NFData Tweak where+ rnf (Tweak p) = p `seq` ()++instance NFData RecSig where+ rnf (RecSig p) = p `seq` () decodeHex :: ConvertibleStrings a ByteString => a -> Maybe ByteString decodeHex str = if BS.null r then Just bs else Nothing where