packages feed

ppad-sha512-0.2.2: ppad-sha512.cabal

cabal-version:      3.0
name:               ppad-sha512
version:            0.2.2
synopsis:           The SHA-512 and HMAC-SHA512 algorithms
license:            MIT
license-file:       LICENSE
author:             Jared Tobin
maintainer:         jared@ppad.tech
category:           Cryptography
build-type:         Simple
tested-with:        GHC == 9.10.3
extra-doc-files:    CHANGELOG
description:
  A pure implementation of SHA-512 and HMAC-SHA512 on strict and lazy
  ByteStrings, as specified by RFC's 6234 and 2104.

flag llvm
  description: Use GHC's LLVM backend.
  default:     False
  manual:      True

flag sanitize
  description: Build with AddressSanitizer and UndefinedBehaviorSanitizer.
  default:     False
  manual:      True

source-repository head
  type:     git
  location: git.ppad.tech/sha512.git

library
  default-language: Haskell2010
  hs-source-dirs:   lib
  ghc-options:
      -Wall
  if flag(llvm)
    ghc-options: -fllvm -O2
  exposed-modules:
      Crypto.Hash.SHA512
      Crypto.Hash.SHA512.Arm
      Crypto.Hash.SHA512.Internal
      Crypto.Hash.SHA512.Lazy
  build-depends:
      base >= 4.9 && < 5
    , bytestring >= 0.9 && < 0.13
  c-sources:
      cbits/sha512_arm.c
  if arch(aarch64)
    cc-options: -march=armv8.2-a+sha3
  if flag(sanitize)
    cc-options: -fsanitize=address,undefined -fno-omit-frame-pointer
    ghc-options: -optl=-fsanitize=address,undefined

test-suite sha512-tests
  type:                exitcode-stdio-1.0
  default-language:    Haskell2010
  hs-source-dirs:      test
  main-is:             Main.hs
  other-modules:
    Property
    Wycheproof

  ghc-options:
    -rtsopts -Wall -O2
  if flag(sanitize)
    ghc-options: -optl=-fsanitize=address,undefined

  build-depends:
      aeson
    , base
    , bytestring
    , ppad-base16
    , ppad-sha512
    , quickcheck-instances
    , tasty
    , tasty-hunit
    , tasty-quickcheck
    , text

benchmark sha512-bench
  type:                exitcode-stdio-1.0
  default-language:    Haskell2010
  hs-source-dirs:      bench
  main-is:             Main.hs

  ghc-options:
    -rtsopts -O2 -Wall

  build-depends:
      base
    , bytestring
    , criterion
    , ppad-sha512
    , SHA

benchmark sha512-weigh
  type:                exitcode-stdio-1.0
  default-language:    Haskell2010
  hs-source-dirs:      bench
  main-is:             Weight.hs

  ghc-options:
    -rtsopts -O2 -Wall -fno-warn-orphans
  if flag(llvm)
    ghc-options: -fllvm

  build-depends:
      base
    , bytestring
    , deepseq
    , ppad-sha512
    , weigh