poly1305

The Poly1305 message authentication code (docs.ppad.tech/poly1305).
git clone git://git.ppad.tech/poly1305.git
Log | Files | Refs | README | LICENSE

ppad-poly1305.cabal (2766B)


      1 cabal-version:      3.0
      2 name:               ppad-poly1305
      3 version:            0.4.8
      4 synopsis:           A fast Poly1305 MAC
      5 license:            MIT
      6 license-file:       LICENSE
      7 author:             Jared Tobin
      8 maintainer:         jared@ppad.tech
      9 category:           Cryptography
     10 build-type:         Simple
     11 tested-with:        GHC == 9.10.3
     12 extra-doc-files:    CHANGELOG
     13 description:
     14   A fast Poly1305 message authentication code, per
     15   [RFC8439](https://datatracker.ietf.org/doc/html/rfc8439).
     16 
     17 flag llvm
     18   description: Use GHC's LLVM backend.
     19   default:     False
     20   manual:      True
     21 
     22 flag sanitize
     23   description: Build with AddressSanitizer and UndefinedBehaviorSanitizer.
     24   default:     False
     25   manual:      True
     26 
     27 source-repository head
     28   type:     git
     29   location: git.ppad.tech/poly1305.git
     30 
     31 library
     32   default-language: Haskell2010
     33   hs-source-dirs:   lib
     34   ghc-options:
     35       -Wall
     36   if flag(llvm)
     37     ghc-options: -fllvm -O2
     38   -- LLVM's x86 backend rewrites a cmov whose operand is a load as a
     39   -- branch (its cmov converter), which would make the borrow-masked
     40   -- correction of ppad-fixed's sub_mod# (inlinable here) a branch on
     41   -- the borrow; keep the cmov.
     42   if flag(llvm) && arch(x86_64)
     43     ghc-options: -optlc=-x86-cmov-converter=false
     44   exposed-modules:
     45       Crypto.MAC.Poly1305
     46   other-modules:
     47       Crypto.MAC.Poly1305.Native
     48       Data.Barrier
     49   build-depends:
     50       base >= 4.9 && < 5
     51     , bytestring >= 0.9 && < 0.13
     52     , ppad-fixed >= 0.2.1 && < 0.3
     53   c-sources:
     54       cbits/poly1305_native.c
     55   if arch(aarch64)
     56     cc-options: -march=armv8-a
     57   if flag(sanitize)
     58     cc-options: -fsanitize=address,undefined -fno-omit-frame-pointer
     59     ghc-options: -optl=-fsanitize=address,undefined
     60 
     61 test-suite poly1305-tests
     62   type:                exitcode-stdio-1.0
     63   default-language:    Haskell2010
     64   hs-source-dirs:      test
     65   main-is:             Main.hs
     66 
     67   ghc-options:
     68     -rtsopts -Wall -O2
     69   if flag(sanitize)
     70     ghc-options: -optl=-fsanitize=address,undefined
     71 
     72   build-depends:
     73       base
     74     , bytestring
     75     , ppad-base16
     76     , ppad-poly1305
     77     , primitive
     78     , tasty
     79     , tasty-hunit
     80 
     81 benchmark poly1305-bench
     82   type:                exitcode-stdio-1.0
     83   default-language:    Haskell2010
     84   hs-source-dirs:      bench
     85   main-is:             Main.hs
     86 
     87   ghc-options:
     88     -rtsopts -O2 -Wall
     89 
     90   build-depends:
     91       base
     92     , bytestring
     93     , criterion
     94     , deepseq
     95     , ppad-base16
     96     , ppad-poly1305
     97 
     98 benchmark poly1305-weigh
     99   type:                exitcode-stdio-1.0
    100   default-language:    Haskell2010
    101   hs-source-dirs:      bench
    102   main-is:             Weight.hs
    103 
    104   ghc-options:
    105     -rtsopts -O2 -Wall
    106   if flag(llvm)
    107     ghc-options: -fllvm
    108 
    109   build-depends:
    110       base
    111     , bytestring
    112     , deepseq
    113     , ppad-poly1305
    114     , weigh