packages feed

cacophony-0.6.0: cacophony.cabal

name:          cacophony
version:       0.6.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.1, GHC == 7.10.2, GHC == 7.10.3
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

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

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

flag hlint

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.13,
    deepseq,
    free,
    lens,
    memory,
    mtl
  hs-source-dirs:   src
  default-language: Haskell2010
  exposed-modules:
    Crypto.Noise.Cipher
    Crypto.Noise.Cipher.AESGCM
    Crypto.Noise.Cipher.ChaChaPoly1305
    Crypto.Noise.Curve
    Crypto.Noise.Curve.Curve25519
    Crypto.Noise.Curve.Curve448
    Crypto.Noise.Handshake
    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.SymmetricState
    Crypto.Noise.Internal.HandshakePattern
    Crypto.Noise.Internal.HandshakeState
    Crypto.Noise.Types
    Data.ByteArray.Extend
  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,
      base64-bytestring,
      bytestring,
      cacophony          >=0.6,
      directory,
      fast-logger,
      network,
      network-simple,
      unix,
      unix-time
  else
    buildable: False

  other-modules:
    Handshakes
    Log
    Parse
    Server
    Types

  ghc-options:      -threaded -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,
      base64-bytestring,
      bytestring,
      cacophony          >=0.6,
      directory,
      network,
      network-simple,
      unix
  else
    buildable: False

  other-modules:
    Client
    Parse

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

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

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

  build-depends:
    async,
    base >=4.8 && <5,
    bytestring,
    cacophony,
    mtl,
    QuickCheck,
    tasty,
    tasty-quickcheck

  other-modules:
    CipherState,
    Handshake,
    Handshakes
    Imports,
    Instances,
    SymmetricState

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

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

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

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

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