diff --git a/.github/workflows/cabal.yml b/.github/workflows/cabal.yml index 4254bdf..ffb3f2b 100644 --- a/.github/workflows/cabal.yml +++ b/.github/workflows/cabal.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-16.04 strategy: matrix: - ghc: ["8.8.1", "8.6.5", "8.6.4", "8.6.3", "8.6.2"] + ghc: ["8.10.1", "8.8.1", "8.6.5", "8.6.4", "8.6.3", "8.6.2"] cabal: ["3.0"] steps: diff --git a/.github/workflows/stack.yml b/.github/workflows/stack.yml index 2f4910d..6ace4f9 100644 --- a/.github/workflows/stack.yml +++ b/.github/workflows/stack.yml @@ -13,8 +13,9 @@ jobs: matrix: os: [ubuntu-latest, macOS-latest] plan: - - { build: stack, resolver: "lts-14" } # ghc-8.6.5 - - { build: stack, resolver: "lts-15" } # ghc-8.8.2 + - { build: stack, resolver: "lts-14" } + - { build: stack, resolver: "lts-15" } + - { build: stack, resolver: "lts-16" } #- { build: stack, resolver: "nightly" } include: [] exclude: diff --git a/cloudbuild.yaml b/cloudbuild.yaml deleted file mode 100644 index 762092f..0000000 --- a/cloudbuild.yaml +++ /dev/null @@ -1,43 +0,0 @@ -timeout: 3600s # Cache misses are slow to rebuild -substitutions: - # Bump the version if you make changes to `ci/Dockerfile - _BUILD_IMAGE: gcr.io/uplink-test-cluster-174313/pairing-ci:v2 -options: - machineType: N1_HIGHCPU_8 -steps: - # Build uplink docker image with kaniko - - id: "build-ci-base-image" - name: gcr.io/cloud-builders/docker - entrypoint: 'bash' - args: - - '-c' - - | - set -euxo pipefail - if ! docker pull $_BUILD_IMAGE; then - docker build ci --tag $_BUILD_IMAGE - docker push $_BUILD_IMAGE - fi - - id: "build" - name: $_BUILD_IMAGE - waitFor: ["build-ci-base-image"] - entrypoint: bash - args: - - '-c' - - | - set -euxo pipefail - mkdir ./bin - stack install \ - --no-terminal \ - --fast \ - --test \ - --no-run-tests \ - --local-bin-path . - - id: "test" - name: $_BUILD_IMAGE - entrypoint: bash - waitFor: ['build'] - args: - - '-c' - - | - set -euxo pipefail - stack test pairing:pairing-tests --no-terminal --system-ghc diff --git a/package.yaml b/package.yaml deleted file mode 100644 index 885325a..0000000 --- a/package.yaml +++ /dev/null @@ -1,88 +0,0 @@ -name: pairing -version: 1.1.0 -synopsis: Bilinear pairings -description: Bilinear pairings over elliptic curves -maintainer: Adjoint Inc (info@adjoint.io) -license: MIT -github: adjoint-io/pairing -category: Cryptography - -default-extensions: - - LambdaCase - - RecordWildCards - - OverloadedStrings - - NoImplicitPrelude - - FlexibleInstances - - FlexibleContexts - - ScopedTypeVariables - - RankNTypes - - ConstraintKinds - - DataKinds - - DeriveGeneric - - GeneralizedNewtypeDeriving - - MultiParamTypeClasses - - OverloadedLists - - PatternSynonyms - - TypeFamilyDependencies - -dependencies: - - base >= 4.10 && < 5 - - protolude >= 0.2 && < 0.3 - - bytestring >= 0.10.8 && < 0.11 - - elliptic-curve >= 0.3 && < 0.4 - - errors >= 2.3.0 && < 2.4 - - galois-field >= 1.0.2 && < 2.0 - - groups >= 0.4.1 && < 0.5 - - MonadRandom >= 0.5.1 && < 0.6 - - tasty-quickcheck >= 0.10.1 && < 0.11 - -extra-source-files: - - README_notex.md - - ChangeLog.md - -ghc-options: - - -freverse-errors - - -O2 - - -Wall - -library: - exposed-modules: - - Data.Pairing - - Data.Pairing.Ate - - Data.Pairing.BLS12381 - - Data.Pairing.BN254 - - Data.Pairing.BN254A - - Data.Pairing.BN254B - - Data.Pairing.BN254C - - Data.Pairing.BN254D - - Data.Pairing.BN462 - - Data.Pairing.Hash - source-dirs: - - src - -tests: - pairing-tests: - main: Main - dependencies: - - pairing - - QuickCheck - - quickcheck-instances - - tasty - - tasty-hunit - - tasty-quickcheck - source-dirs: - - test - - example-tests: - main: Example.hs - dependencies: - - pairing - -benchmarks: - pairing-benchmarks: - main: Main - dependencies: - - criterion - - pairing - source-dirs: - - bench diff --git a/pairing.cabal b/pairing.cabal index 0bdb966..43d7cc7 100644 --- a/pairing.cabal +++ b/pairing.cabal @@ -1,11 +1,4 @@ -cabal-version: 1.12 - --- This file has been generated from package.yaml by hpack version 0.31.2. --- --- see: https://github.com/sol/hpack --- --- hash: 075b86ab510717df4b4541ad3c6652acc7d449010ebfe946f4f7c9d58205a186 - +cabal-version: 3.0 name: pairing version: 1.1.0 synopsis: Bilinear pairings @@ -25,57 +18,18 @@ source-repository head type: git location: https://github.com/adjoint-io/pairing -library - exposed-modules: - Data.Pairing - Data.Pairing.Ate - Data.Pairing.BLS12381 - Data.Pairing.BN254 - Data.Pairing.BN254A - Data.Pairing.BN254B - Data.Pairing.BN254C - Data.Pairing.BN254D - Data.Pairing.BN462 - Data.Pairing.Hash - - other-modules: Paths_pairing - hs-source-dirs: src - default-extensions: - NoImplicitPrelude - ConstraintKinds - DataKinds - DeriveGeneric - FlexibleContexts - FlexibleInstances - GeneralizedNewtypeDeriving - LambdaCase - MultiParamTypeClasses - OverloadedLists - OverloadedStrings - PatternSynonyms - RankNTypes - RecordWildCards - ScopedTypeVariables - TypeFamilyDependencies - - ghc-options: -freverse-errors -O2 -Wall +common shared-dependencies build-depends: - base >=4.10 && <5 - , bytestring >=0.10.8 && <0.11 - , elliptic-curve >=0.3 && <0.4 - , errors >=2.3.0 && <2.4 + , base >=4.10 && <5 + , bytestring ^>=0.10.8 + , elliptic-curve ^>=0.3 + , errors ^>=2.3.0 , galois-field >=1.0.2 && <2.0 - , groups >=0.4.1 && <0.5 - , MonadRandom >=0.5.1 && <0.6 - , protolude >=0.2 && <0.3 - , tasty-quickcheck >=0.10.1 && <0.11 - - default-language: Haskell2010 + , groups ^>=0.4.1 + , MonadRandom ^>=0.5.1 + , protolude >=0.2 && <0.4 + , tasty-quickcheck ^>=0.10.1 -test-suite example-tests - type: exitcode-stdio-1.0 - main-is: Example.hs - other-modules: Paths_pairing default-extensions: NoImplicitPrelude ConstraintKinds @@ -94,26 +48,36 @@ test-suite example-tests ScopedTypeVariables TypeFamilyDependencies - ghc-options: -freverse-errors -O2 -Wall - build-depends: - base >=4.10 && <5 - , bytestring >=0.10.8 && <0.11 - , elliptic-curve >=0.3 && <0.4 - , errors >=2.3.0 && <2.4 - , galois-field >=1.0.2 && <2.0 - , groups >=0.4.1 && <0.5 - , MonadRandom >=0.5.1 && <0.6 - , pairing - , protolude >=0.2 && <0.3 - , tasty-quickcheck >=0.10.1 && <0.11 +library + import: shared-dependencies + exposed-modules: + Data.Pairing + Data.Pairing.Ate + Data.Pairing.BLS12381 + Data.Pairing.BN254 + Data.Pairing.BN254A + Data.Pairing.BN254B + Data.Pairing.BN254C + Data.Pairing.BN254D + Data.Pairing.BN462 + Data.Pairing.Hash + + hs-source-dirs: src + ghc-options: -freverse-errors -O2 -Wall + default-language: Haskell2010 - default-language: Haskell2010 +test-suite example-tests + import: shared-dependencies + type: exitcode-stdio-1.0 + main-is: Example.hs + ghc-options: -freverse-errors -O2 -Wall + default-language: Haskell2010 test-suite pairing-tests - type: exitcode-stdio-1.0 - main-is: Main.hs + import: shared-dependencies + type: exitcode-stdio-1.0 + main-is: Main.hs other-modules: - Paths_pairing Test.BLS12381 Test.BN254 Test.BN254A @@ -125,83 +89,22 @@ test-suite pairing-tests Test.Field Test.Pairing - hs-source-dirs: test - default-extensions: - NoImplicitPrelude - ConstraintKinds - DataKinds - DeriveGeneric - FlexibleContexts - FlexibleInstances - GeneralizedNewtypeDeriving - LambdaCase - MultiParamTypeClasses - OverloadedLists - OverloadedStrings - PatternSynonyms - RankNTypes - RecordWildCards - ScopedTypeVariables - TypeFamilyDependencies - - ghc-options: -freverse-errors -O2 -Wall -main-is Main - build-depends: - base >=4.10 && <5 - , bytestring >=0.10.8 && <0.11 - , elliptic-curve >=0.3 && <0.4 - , errors >=2.3.0 && <2.4 - , galois-field >=1.0.2 && <2.0 - , groups >=0.4.1 && <0.5 - , MonadRandom >=0.5.1 && <0.6 - , pairing - , protolude >=0.2 && <0.3 - , QuickCheck - , quickcheck-instances - , tasty - , tasty-hunit - , tasty-quickcheck - - default-language: Haskell2010 + hs-source-dirs: test + ghc-options: -freverse-errors -O2 -Wall -main-is Main + default-language: Haskell2010 benchmark pairing-benchmarks - type: exitcode-stdio-1.0 - main-is: Main.hs + import: shared-dependencies + type: exitcode-stdio-1.0 + main-is: Main.hs other-modules: Bench.Hash Bench.Pairing - Paths_pairing - hs-source-dirs: bench - default-extensions: - NoImplicitPrelude - ConstraintKinds - DataKinds - DeriveGeneric - FlexibleContexts - FlexibleInstances - GeneralizedNewtypeDeriving - LambdaCase - MultiParamTypeClasses - OverloadedLists - OverloadedStrings - PatternSynonyms - RankNTypes - RecordWildCards - ScopedTypeVariables - TypeFamilyDependencies - - ghc-options: -freverse-errors -O2 -Wall -main-is Main + hs-source-dirs: bench + ghc-options: -freverse-errors -O2 -Wall -main-is Main build-depends: - base >=4.10 && <5 - , bytestring >=0.10.8 && <0.11 - , criterion - , elliptic-curve >=0.3 && <0.4 - , errors >=2.3.0 && <2.4 - , galois-field >=1.0.2 && <2.0 - , groups >=0.4.1 && <0.5 - , MonadRandom >=0.5.1 && <0.6 + , criterion ^>=1.5 , pairing - , protolude >=0.2 && <0.3 - , tasty-quickcheck >=0.10.1 && <0.11 - default-language: Haskell2010 + default-language: Haskell2010 diff --git a/stack.yaml b/stack.yaml index 38d4181..d511843 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-14.16 +resolver: lts-16.0 extra-deps: - elliptic-curve-0.3.0 - galois-field-1.0.2 diff --git a/stack.yaml.lock b/stack.yaml.lock index 1dc55f5..dc81ae3 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -62,7 +62,7 @@ packages: hackage: QuickCheck-2.13.2 snapshots: - completed: - size: 524804 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/16.yaml - sha256: 4d1519a4372d051d47a5eae2241cf3fb54e113d7475f89707ddb6ec06add2888 - original: lts-14.16 + size: 531237 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/0.yaml + sha256: 210e15b7043e2783115afe16b0d54914b1611cdaa73f3ca3ca7f8e0847ff54e5 + original: lts-16.0