blake2 0.3.0 → 0.3.0.1
raw patch · 7 files changed
+65/−113 lines, 7 filesdep ~QuickCheckdep ~basedep ~base16-bytestringsetup-changednew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: QuickCheck, base, base16-bytestring, bytestring, criterion, hlint, tasty, tasty-quickcheck
API changes (from Hackage documentation)
Files
- .travis.yml +0/−39
- README.md +9/−6
- Setup.hs +0/−2
- benchmarks/bench.hs +2/−2
- blake2.cabal +36/−57
- changelog.md +4/−0
- tests/properties.hs +14/−7
− .travis.yml
@@ -1,39 +0,0 @@-language: c-dist: trusty--cache:- directories:- - $HOME/.stack--addons:- apt:- packages:- - libgmp-dev--matrix:- include:- - env: ARGS="--resolver lts-12.25"- compiler: "stack-8.4.4"-- - env: ARGS=""- compiler: "stack-8.6.3"-- - env: ARGS="--resolver nightly"- compiler: "stack-nightly"-- allow_failures:- - env: ARGS="--resolver nightly"- compiler: "stack-nightly"--before_install:- - unset CC- - mkdir -p ~/.local/bin- - export PATH=$HOME/.local/bin:$PATH- - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'--install:- - stack $ARGS setup--script:- - stack $ARGS --no-terminal test --bench --no-run-benchmarks --haddock --no-haddock-deps- - stack $ARGS sdist
README.md view
@@ -1,9 +1,12 @@ # blake2 -[](https://travis-ci.org/centromere/blake2)-[](http://www.haskell.org)+This library provides the [BLAKE2] hash algorithms. -This library provides the [BLAKE2](https://blake2.net/) hash algorithms. While-[cryptonite](https://github.com/haskell-crypto/cryptonite) also provides a-BLAKE2 implemenation, this library has fewer dependencies and a richer API for-features like keyed hashing and variable length output.+## Comparison with other libraries++This library has fewer dependencies than [cryptonite] and a richer API for+features like keyed hashing and variable-length output.++ [BLAKE2]: https://blake2.net/++ [cryptonite]: https://github.com/haskell-crypto/cryptonite
− Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
benchmarks/bench.hs view
@@ -14,10 +14,10 @@ kb = B.replicate 1024 3 mb :: ByteString-mb = B.replicate (1024^2) 3+mb = B.replicate (1024 ^ (2 :: Int)) 3 gb :: ByteString-gb = B.replicate (1024^3) 3+gb = B.replicate (1024 ^ (3 :: Int)) 3 main :: IO () main = defaultMain
blake2.cabal view
@@ -1,33 +1,27 @@+cabal-version: 3.0+ name: blake2-version: 0.3.0+version: 0.3.0.1 synopsis: A library providing BLAKE2-license: PublicDomain+license: Unlicense license-file: LICENSE author: John Galt maintainer: jgalt@centromere.net-homepage: https://github.com/centromere/blake2-bug-reports: https://github.com/centromere/blake2/issues+homepage: https://github.com/haskell-cryptography/blake2+bug-reports: https://github.com/haskell-cryptography/blake2/issues category: Cryptography-build-type: Simple-cabal-version: >=1.10-tested-with: GHC == 8.4.4, GHC == 8.6.3 description: This library provides the <https://blake2.net/ BLAKE2> hash algorithms. extra-source-files:- .travis.yml README.md changelog.md- LICENSE include/ref/*.h include/sse/*.h source-repository head type: git- location: https://github.com/centromere/blake2.git------------------------------------------------------------------------------------- FLAGS+ location: https://github.com/haskell-cryptography/blake2.git flag hlint @@ -40,23 +34,23 @@ default: False manual: True ------------------------------------------------------------------------------------ LIBRARY+common base+ default-language: Haskell2010+ ghc-options: -Wall -fwarn-tabs+ build-depends:+ , base ^>= 4.15 || ^>= 4.16 || ^>= 4.17 || ^>= 4.18+ , bytestring ^>= 0.10.12 || ^>= 0.11 library- build-depends:- base >=4.8 && <5,- bytestring- hs-source-dirs: src- default-language: Haskell2010+ import: base+ hs-source-dirs: src exposed-modules: Crypto.Hash.BLAKE2.BLAKE2b Crypto.Hash.BLAKE2.BLAKE2bp Crypto.Hash.BLAKE2.BLAKE2s Crypto.Hash.BLAKE2.BLAKE2sp Crypto.Hash.BLAKE2.Internal- ghc-options: -Wall -fwarn-tabs- cc-options: -std=c99+ cc-options: -std=c99 if arch(x86_64) || flag(support_blake2_sse) c-sources:@@ -76,54 +70,39 @@ if flag(llvm) ghc-options: -fllvm ------------------------------------------------------------------------------------ TESTS- test-suite properties- type: exitcode-stdio-1.0- main-is: properties.hs- ghc-options: -Wall -fwarn-tabs- hs-source-dirs: tests- default-language: Haskell2010+ import: base+ type: exitcode-stdio-1.0+ main-is: properties.hs+ hs-source-dirs: tests build-depends:- base >=4.8 && <5,- base16-bytestring,- bytestring,- blake2,- QuickCheck,- tasty,- tasty-quickcheck+ , base16-bytestring ^>= 1.0.0+ , blake2+ , QuickCheck ^>= 2.14.3+ , tasty ^>= 1.4.3+ , tasty-quickcheck ^>= 0.10.2 other-modules: Imports test-suite hlint- type: exitcode-stdio-1.0- main-is: hlint.hs- ghc-options: -Wall -fwarn-tabs- hs-source-dirs: tests- default-language: Haskell2010+ import: base+ type: exitcode-stdio-1.0+ main-is: hlint.hs+ hs-source-dirs: tests if !flag(hlint) buildable: False else- build-depends:- base >=4.8 && <5,- hlint------------------------------------------------------------------------------------- BENCHMARKS+ build-depends: hlint ^>= 3.5 benchmark bench- type: exitcode-stdio-1.0- main-is: bench.hs- ghc-options: -Wall -fwarn-tabs- hs-source-dirs: benchmarks- default-language: Haskell2010+ import: base+ type: exitcode-stdio-1.0+ main-is: bench.hs+ hs-source-dirs: benchmarks build-depends:- base >=4.8 && <5,- blake2,- bytestring,- criterion+ , blake2+ , criterion ^>= 1.6.2
changelog.md view
@@ -1,3 +1,7 @@+# 0.3.0.1++* Miscellaneous cleanup and dependency version updates+ # 0.3.0 * Bring C code up to date
tests/properties.hs view
@@ -12,15 +12,22 @@ import Imports +hexDecode ::+ ByteString -- ^ Assumed to be valid hexadecimal+ -> ByteString+hexDecode x = case Hex.decode x of+ Left e -> error e+ Right y -> y+ key32 :: ByteString-key32 = fst . Hex.decode $ "000102030405060708090a0b0c0d0e0f\- \101112131415161718191a1b1c1d1e1f"+key32 = hexDecode "000102030405060708090a0b0c0d0e0f\+ \101112131415161718191a1b1c1d1e1f" key64 :: ByteString-key64 = fst . Hex.decode $ "000102030405060708090a0b0c0d0e0f\- \101112131415161718191a1b1c1d1e1f\- \202122232425262728292a2b2c2d2e2f\- \303132333435363738393a3b3c3d3e3f"+key64 = hexDecode "000102030405060708090a0b0c0d0e0f\+ \101112131415161718191a1b1c1d1e1f\+ \202122232425262728292a2b2c2d2e2f\+ \303132333435363738393a3b3c3d3e3f" compare :: (ByteString -> ByteString) -> ByteString@@ -28,7 +35,7 @@ -> Property compare f input expectation = property $ result === expectation where- result = Hex.encode . f . fst . Hex.decode $ input+ result = Hex.encode . f . hexDecode $ input test0s :: Property test0s = compare (B2s.hash 32 key32) "" "48a8997da407876b3d79c0d92325ad3b89cbb754d86ab71aee047ad345fd2c49"