cabal-version: 1.18

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

name:           secure-memory
version:        0.0.0.1
synopsis:       Securely allocated and deallocated memory.
description:    Securely allocated and deallocated memory.
                .
                When handling sensitive data in your program, you want to be extra
                careful and make sure that it is gone as soon as you are done working
                with it. In a garbage-collected language like Haskell this is not so easy,
                since the garbage collector can move your bytes around and create copies
                of it. In addition to that, even if the memory gets eventually deallocated,
                it is not guaranteed that the data will actually be zeroed-out or overriden.
                .
                To make matters even worse, if the operating system runs out of RAM while
                your sensitive data remains in the memory, the page that contains your data
                can get swapped out and, thus, end up on the disk, which you, of course,
                absolutely want to never happen.
                .
                This library provides a (relatively) easy to use interface for working
                with data allocated in a secure memory location that is guaranteed to never
                end up on the disk and that will be zeroed-out as soon as you finish using it.
category:       Cryptography, Memory
homepage:       https://github.com/serokell/haskell-crypto#readme
bug-reports:    https://github.com/serokell/haskell-crypto/issues
author:         Kirill Elagin <kirelagin@serokell.io>
maintainer:     Serokell <libraries@serokell.io>
copyright:      2021 Serokell
license:        MPL-2.0
license-file:   LICENSES/MPL-2.0.txt
build-type:     Simple
extra-doc-files:
    CHANGELOG.md
    README.md

source-repository head
  type: git
  location: https://github.com/serokell/haskell-crypto

library
  exposed-modules:
      Data.SensitiveBytes
      Data.SensitiveBytes.Internal
      Data.SensitiveBytes.IO
      Data.SensitiveBytes.IO.Internal.Password
  other-modules:
      Paths_secure_memory
  hs-source-dirs:
      lib
  default-extensions:
      DataKinds
      FlexibleContexts
      FlexibleInstances
      GeneralizedNewtypeDeriving
      KindSignatures
      LambdaCase
      MultiParamTypeClasses
      NamedFieldPuns
      NumericUnderscores
      OverloadedStrings
      PolyKinds
      ScopedTypeVariables
      TypeApplications
  ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
  c-sources:
      ./cbits/readline_max.c
  build-depends:
      base >=4.10 && <4.15
    , bytestring >=0.9 && <0.11
    , libsodium >=1.0.18.2
    , memory >=0.14.15 && <0.16
    , reflection >=1.2.0.1 && <2.2
    , safe-exceptions ==0.1.*
    , text >=0.7 && <1.3
  if !os(windows)
    build-depends:
        unix >=2.0 && <2.8
  default-language: Haskell2010

executable checkpw
  main-is: Main.hs
  other-modules:
      Paths_secure_memory
  hs-source-dirs:
      app/checkpw
  default-extensions:
      DataKinds
      FlexibleContexts
      FlexibleInstances
      GeneralizedNewtypeDeriving
      KindSignatures
      LambdaCase
      MultiParamTypeClasses
      NamedFieldPuns
      NumericUnderscores
      OverloadedStrings
      PolyKinds
      ScopedTypeVariables
      TypeApplications
  ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
  build-depends:
      base >=4.10 && <4.15
    , bytestring >=0.9 && <0.11
    , libsodium >=1.0.11 && <2
    , memory >=0.14.15 && <0.16
    , safe-exceptions ==0.1.*
    , secure-memory
  default-language: Haskell2010

test-suite test-pipe
  type: exitcode-stdio-1.0
  main-is: Test.hs
  other-modules:
      Test.Data.SensitiveBytes.IO.Password
      Paths_secure_memory
  hs-source-dirs:
      test/pipe
  default-extensions:
      DataKinds
      FlexibleContexts
      FlexibleInstances
      GeneralizedNewtypeDeriving
      KindSignatures
      LambdaCase
      MultiParamTypeClasses
      NamedFieldPuns
      NumericUnderscores
      OverloadedStrings
      PolyKinds
      ScopedTypeVariables
      TypeApplications
  ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
  build-tool-depends:
      tasty-discover:tasty-discover
  build-depends:
      HUnit
    , async
    , base >=4.10 && <4.15
    , bytestring >=0.9 && <0.11
    , hedgehog
    , libsodium >=1.0.11 && <2
    , memory >=0.14.15 && <0.16
    , safe-exceptions ==0.1.*
    , secure-memory
    , tasty
    , tasty-hedgehog
    , tasty-hunit
    , unix
  if os(windows)
    buildable: False
  default-language: Haskell2010

test-suite test-simple
  type: exitcode-stdio-1.0
  main-is: Test.hs
  other-modules:
      Test.Data.SensitiveBytes
      Paths_secure_memory
  hs-source-dirs:
      test/simple
  default-extensions:
      DataKinds
      FlexibleContexts
      FlexibleInstances
      GeneralizedNewtypeDeriving
      KindSignatures
      LambdaCase
      MultiParamTypeClasses
      NamedFieldPuns
      NumericUnderscores
      OverloadedStrings
      PolyKinds
      ScopedTypeVariables
      TypeApplications
  ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
  build-tool-depends:
      tasty-discover:tasty-discover
  build-depends:
      HUnit
    , base >=4.10 && <4.15
    , bytestring >=0.9 && <0.11
    , libsodium >=1.0.11 && <2
    , memory >=0.14.15 && <0.16
    , safe-exceptions ==0.1.*
    , secure-memory
    , tasty
    , tasty-hunit
  default-language: Haskell2010
