packages feed

mlkem-0.2.2.0: mlkem.cabal

cabal-version: 2.2

-- This file has been generated from package.yaml by hpack version 0.39.1.
--
-- see: https://github.com/sol/hpack

name:           mlkem
version:        0.2.2.0
synopsis:       Module-Lattice-based Key-Encapsulation Mechanism
description:    Module-Lattice-based Key-Encapsulation Mechanism (ML-KEM) implemented in
                Haskell.
category:       Crypto
homepage:       https://codeberg.org/ocheron/hs-mlkem#readme
bug-reports:    https://codeberg.org/ocheron/hs-mlkem/issues
author:         Olivier Chéron
maintainer:     olivier.cheron@gmail.com
copyright:      2025 Olivier Chéron
license:        BSD-3-Clause
license-file:   LICENSE
build-type:     Simple
extra-source-files:
    README.md
    tests/get-vectors.sh
extra-doc-files:
    CHANGELOG.md

source-repository head
  type: git
  location: https://codeberg.org/ocheron/hs-mlkem

flag use_crypton
  description: Use crypton instead of cryptonite
  manual: True
  default: True

library
  exposed-modules:
      Crypto.PubKey.ML_KEM
  other-modules:
      Auxiliary
      Base
      Block
      BlockN
      Builder
      ByteArrayST
      Crypto
      Equality
      Fusion
      Internal
      Iterate
      K_PKE
      Machine
      Marking
      Math
      Matrix
      ScrubbedBlock
      SecureBlock
      SecureBytes
      Vector
      Paths_mlkem
  autogen-modules:
      Paths_mlkem
  hs-source-dirs:
      src
  ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-unticked-promoted-constructors -O2
  build-depends:
      base >=4.7 && <5
    , deepseq
    , primitive >=0.7.2
  default-language: Haskell2010
  if flag(use_crypton)
    build-depends:
        crypton >=1.1.1
      , ram
  else
    build-depends:
        cryptonite >=0.26
      , memory

test-suite mlkem-test
  type: exitcode-stdio-1.0
  main-is: Tests.hs
  other-modules:
      EncapDecap
      KeyGen
      Util
      Vectors
      Paths_mlkem
  autogen-modules:
      Paths_mlkem
  hs-source-dirs:
      tests
  ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-unticked-promoted-constructors -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      aeson
    , base >=4.7 && <5
    , bytestring
    , deepseq
    , directory
    , mlkem
    , primitive >=0.7.2
    , process
    , tasty
    , tasty-hunit
    , tasty-quickcheck
    , text
    , zlib
  default-language: Haskell2010
  if flag(use_crypton)
    build-depends:
        crypton >=1.1.1
      , ram
  else
    build-depends:
        cryptonite >=0.26
      , memory

test-suite mlkem-test-full
  type: exitcode-stdio-1.0
  main-is: Tests.hs
  other-modules:
      Auxiliary
      Base
      Block
      BlockN
      Builder
      ByteArrayST
      Crypto
      Crypto.PubKey.ML_KEM
      Equality
      Fusion
      Internal
      Iterate
      K_PKE
      Machine
      Marking
      Math
      Matrix
      ScrubbedBlock
      SecureBlock
      SecureBytes
      Vector
      EncapDecap
      KeyGen
      Util
      Vectors
      Paths_mlkem
  autogen-modules:
      Paths_mlkem
  hs-source-dirs:
      src
      tests
  ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-unticked-promoted-constructors -fno-ignore-asserts -threaded -rtsopts -with-rtsopts=-N
  cpp-options: -DML_KEM_TESTING
  build-depends:
      aeson
    , base >=4.7 && <5
    , bytestring
    , deepseq
    , directory
    , primitive >=0.7.2
    , process
    , tasty
    , tasty-hunit
    , tasty-quickcheck
    , text
    , zlib
  default-language: Haskell2010
  if flag(use_crypton)
    build-depends:
        crypton >=1.1.1
      , ram
  else
    build-depends:
        cryptonite >=0.26
      , memory

benchmark mlkem-bench
  type: exitcode-stdio-1.0
  main-is: Bench.hs
  other-modules:
      Paths_mlkem
  autogen-modules:
      Paths_mlkem
  hs-source-dirs:
      benchs
  ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wno-unticked-promoted-constructors -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-A48m
  build-depends:
      base >=4.7 && <5
    , criterion
    , deepseq
    , mlkem
    , primitive >=0.7.2
  default-language: Haskell2010
  if flag(use_crypton)
    build-depends:
        crypton >=1.1.1
      , ram
  else
    build-depends:
        cryptonite >=0.26
      , memory