-- Initial cipher.cabal generated by cabal init.  For further 
-- documentation, see http://haskell.org/cabal/users-guide/

name:                cipher-aes128
version:             0.7.0.6
synopsis:            AES and common modes using AES-NI when available.
description:         Cipher-aes128 is an implementation of AES and common modes of operation.  It borrows Hanquez's C AES code (see 'cipher-aes') but
                     is unique due to including compile-time detection of
                     NI compiler support, a slightly more functional interface
                     for GCM operations, exposure of 'Ptr' based operations via the .Internal module, and build-in crypto-api support.
                     Cipher-aes128 was originally developed as "'cipher-aes' plus trampolines", which has since been adopted into cipher-aes.
license:             BSD3
license-file:        LICENSE
author:              Thomas M. DuBuisson, Vincent Hanquez (See AUTHORS file)
maintainer:          thomas.dubuisson@gmail.com
copyright:           Thomas M. DuBuisson
category:            Cryptography
homepage:            https://github.com/TomMD/cipher-aes128
bug-reports:         https://github.com/TomMD/cipher-aes128/issues
build-type:          Custom
cabal-version:       >=1.10
tested-with:         GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, GHC==8.6.2, GHC==8.10.4, GHC==9.0.1

extra-source-files:       ./cbits/*.h, ./cbits/*.c
                        , AUTHORS
                        , cbits/LICENSE
flag test
  description: Build a program to test the AES implementation
  default: False

custom-setup
  setup-depends: base >= 4.2 && <5, Cabal >= 1.10 && < 3.7, process >=1.0

library
  default-language:    Haskell2010
  exposed-modules:     Crypto.Cipher.AES128, Crypto.Cipher.AES128.Internal
  build-depends:       base >=4.2 && < 5,
                       bytestring >= 0.10.2,
                       crypto-api >= 0.13,
                       tagged,
                       cereal
  ghc-options:         -Wall -O2

  c-sources:           ./cbits/aes.c
                     , ./cbits/aes_generic.c
                     , ./cbits/aes_x86ni.c
                     , ./cbits/cpu.c
                     , ./cbits/gf.c
  include-dirs:        cbits/
  cc-options:
  -- None by default cc-options:          -mssse3 -maes -mpclmul

source-repository head
  type:         git
  location:     https://github.com/TomMD/cipher-aes128

benchmark bench
  type:         exitcode-stdio-1.0
  hs-source-dirs:       . Benchmark
  main-is:              bench.hs
  other-modules: Crypto.Cipher.AES128, Crypto.Cipher.AES128.Internal
  build-depends:        base < 5, criterion, crypto-api, entropy, bytestring, tagged, cereal
  ghc-options:          -O2
  include-dirs:        cbits
  default-language:    Haskell2010
  c-sources:           ./cbits/aes.c
                     , ./cbits/aes_generic.c
                     , ./cbits/aes_x86ni.c
                     , ./cbits/cpu.c
                     , ./cbits/gf.c

Executable aes128_test
  default-language:    Haskell2010
  if !flag(test)
    buildable: False
  main-is: Test/test.hs
  if flag(test)
    build-depends:    base
                    , crypto-api-tests
                    , test-framework
                    , cipher-aes128
                    , bytestring >= 0.10.2
                    , tagged, cereal, crypto-api
