crypto-sodium-0.0.2.0: crypto-sodium.cabal
cabal-version: 1.22
-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 745d63b84deb20c2dc71acc5006fea4028aa386b595bb6e1d9016deba28aeca5
name: crypto-sodium
version: 0.0.2.0
synopsis: Easy-and-safe-to-use high-level cryptography based on Sodium
description: This is a collection of high-level cryptographic primitives based on
<https://libsodium.io/ Sodium>, spiced up with extra type-safety
of the Haskell type system.
.
__Note: this package is experimental and WIP.__
.
= Why
.
Cryptography is hard to do right and you should never try to implement it
on your own, even if you have access to safe and secure cryptographic
primitives. Luckily, D. J. Bernstein created <https://nacl.cr.yp.to/ NaCl>.
.
NaCl was designed specifically to make it hard to use it incorrectly and
thus save you from a disaster. It exposes high-level cryptographic
algorithms with underlying implementations chosen for you, so you do not
get flexibility, but you get security, which is more important.
.
= What
.
<https://libsodium.org Sodium> is a reimplementation of NaCl
with the goal to make it more portable across different platforms.
With time, it started providing more than the same interface as NaCl.
Nowadays it implements additional primitives and utility functions.
.
= How
.
== Secret-key cryptography
.
* Authenticated encryption: "Crypto.Secretbox"
* Encryption: "Crypto.Stream"
* Authentication: "Crypto.Auth"
.
.
= Thread-safety #threadSafety#
.
Some of the Sodium (and NaCl) functions (those that generate random data)
are not thread-safe. All these functions are explicitly marked as such
in their Haddock documentation.
.
Calling 'sodiumInit' before they are used makes them thread-safe, see
"Crypto.Init".
.
= Performance
.
Sodium contains multiple implementations of the primitives it provides.
There are generic implementations, that are used by default, and
multiple alternatives optimised for various platforms.
.
'sodiumInit' will quickly benchmark all available implementations and choose
the bests ones for each primitive, see "Crypto.Init".
category: Cryptography
homepage: https://github.com/serokell/haskell-crypto#readme
bug-reports: https://github.com/serokell/haskell-crypto/issues
author: Kirill Elagin <kirelagin@serokell.io>
maintainer: Kirill Elagin <kirelagin@serokell.io>
copyright: 2020 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:
Crypto.Init
Crypto.Random
other-modules:
Paths_crypto_sodium
reexported-modules:
NaCl:Crypto.Secretbox
hs-source-dirs:
lib
default-extensions: DataKinds FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving KindSignatures LambdaCase MultiParamTypeClasses NumericUnderscores OverloadedStrings PolyKinds ScopedTypeVariables
ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints
build-depends:
NaCl >=0.0.1.0 && <0.1
, base >=4.10 && <4.15
, bytestring >=0.9 && <0.11
, gdp >=0.0.0.1 && <0.1
, libsodium >=1.0.11 && <2
, memory >=0.1 && <0.16
, safe-exceptions >=0.1 && <0.2
default-language: Haskell2010
test-suite test
type: exitcode-stdio-1.0
main-is: Test.hs
other-modules:
Test.Crypto.Random
Paths_crypto_sodium
hs-source-dirs:
test
default-extensions: DataKinds FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving KindSignatures LambdaCase MultiParamTypeClasses NumericUnderscores OverloadedStrings PolyKinds ScopedTypeVariables
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
, crypto-sodium
, libsodium
, memory
, tasty
, tasty-hunit
default-language: Haskell2010