packages feed

cacophony-0.9.0: cacophony.cabal

name:          cacophony
version:       0.9.0
synopsis:      A library implementing the Noise protocol.
license:       PublicDomain
license-file:  LICENSE
author:        John Galt
maintainer:    jgalt@centromere.net
homepage:      https://github.com/centromere/cacophony
bug-reports:   https://github.com/centromere/cacophony/issues
category:      Cryptography
build-type:    Simple
cabal-version: >=1.10
tested-with:   GHC == 7.10.3, GHC == 8.0.2
description:
  This library implements the <https://github.com/trevp/noise/blob/master/noise.md Noise>
  protocol.

extra-source-files:
  .travis.yml
  README.md
  changelog.md
  LICENSE
  tests/.hlint
  tools/convert_vectors.py
  tools/run_benchmarks.sh
  tools/vector_template.jinja
  vectors/cacophony.txt
  vectors/noise-c-basic.txt

source-repository head
  type: git
  location: https://github.com/centromere/cacophony.git

--------------------------------------------------------------------------------
-- FLAGS

flag hlint
  description: Build hlint test

flag vectors
  description: Build vector test

flag build-examples
  description: Build example executables
  default: False
  manual: True

flag llvm
  default: False
  manual: True

--------------------------------------------------------------------------------
-- LIBRARY

library
  build-depends:
    base       >=4.8 && <5,
    bytestring,
    cryptonite >=0.16,
    deepseq,
    exceptions >=0.8.3,
    free,
    lens,
    memory     >=0.14,
    monad-coroutine,
    mtl,
    safe-exceptions,
    transformers
  hs-source-dirs:   src
  default-language: Haskell2010
  exposed-modules:
    Crypto.Noise
    Crypto.Noise.Cipher
    Crypto.Noise.Cipher.AESGCM
    Crypto.Noise.Cipher.ChaChaPoly1305
    Crypto.Noise.DH
    Crypto.Noise.DH.Curve25519
    Crypto.Noise.DH.Curve448
    Crypto.Noise.HandshakePatterns
    Crypto.Noise.Hash
    Crypto.Noise.Hash.BLAKE2b
    Crypto.Noise.Hash.BLAKE2s
    Crypto.Noise.Hash.SHA256
    Crypto.Noise.Hash.SHA512
    Crypto.Noise.Internal.CipherState
    Crypto.Noise.Internal.HandshakePattern
    Crypto.Noise.Internal.Handshake
    Crypto.Noise.Internal.NoiseState
    Crypto.Noise.Internal.SymmetricState
    Crypto.Noise.Internal.Types
  ghc-options:      -Wall -fwarn-tabs

  if flag(llvm)
    ghc-options: -fllvm

--------------------------------------------------------------------------------
-- EXAMPLES

executable echo-server
  default-language: Haskell2010
  hs-source-dirs:   examples/echo-server
  main-is:          Main.hs

  if flag(build-examples)
    build-depends:
      aeson,
      attoparsec,
      auto-update,
      base               >=4.8 && <5,
      base16-bytestring,
      base64-bytestring,
      bytestring,
      cacophony,
      directory,
      fast-logger,
      lens,
      memory             >=0.14,
      network,
      network-simple,
      unix,
      unix-time
  else
    buildable: False

  other-modules:
    Handshakes
    Log
    Parse
    Server
    Types

  ghc-options:      -threaded -O2 -rtsopts -with-rtsopts=-N -Wall -fwarn-tabs

executable echo-client
  default-language: Haskell2010
  hs-source-dirs:   examples/echo-client
  main-is:          Main.hs

  if flag(build-examples)
    build-depends:
      attoparsec,
      base               >=4.8 && <5,
      base16-bytestring,
      base64-bytestring,
      bytestring,
      cacophony,
      directory,
      lens,
      memory             >=0.14,
      network,
      network-simple,
      unix
  else
    buildable: False

  other-modules:
    Client
    Parse

  ghc-options:      -threaded -O2 -rtsopts -with-rtsopts=-N -Wall -fwarn-tabs

--------------------------------------------------------------------------------
-- TESTS

test-suite hlint
  type:             exitcode-stdio-1.0
  main-is:          hlint.hs
  ghc-options:      -Wall -fwarn-tabs
  hs-source-dirs:   tests/hlint
  default-language: Haskell2010

  if !flag(hlint)
    buildable: False
  else
    build-depends:
      base  >=4.8 && <5,
      hlint

test-suite vectors
  type:             exitcode-stdio-1.0
  main-is:          vectors.hs
  ghc-options:      -threaded -O2 -rtsopts -with-rtsopts=-N -Wall -fwarn-tabs
  hs-source-dirs:   tests/vectors
  default-language: Haskell2010

  if !flag(vectors)
    buildable: False
  else
    build-depends:
      aeson,
      async,
      base              >=4.8 && <5,
      base16-bytestring,
      bytestring,
      cacophony,
      directory,
      free,
      lens,
      memory            >=0.14,
      mtl,
      text

  other-modules:
    Generate,
    Handshakes,
    Types
    VectorFile,
    Verify

--------------------------------------------------------------------------------
-- BENCHMARKS

benchmark bench
  type:             exitcode-stdio-1.0
  main-is:          bench.hs
  ghc-options:      -threaded -O2 -rtsopts -with-rtsopts=-N -Wall -fwarn-tabs
  hs-source-dirs:   benchmarks
  default-language: Haskell2010

  build-depends:
    async,
    base               >=4.8 && <5,
    base16-bytestring,
    bytestring,
    cacophony,
    criterion,
    deepseq,
    lens,
    memory             >=0.14

  other-modules:
    Handshakes
    Types