1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
3 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
5 ;;; Copyright © 2017 rsiddharth <s@ricketyspace.net>
6 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages haskell-crypto)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages haskell)
27 #:use-module (gnu packages haskell-check)
28 #:use-module (guix build-system haskell)
29 #:use-module (guix download)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix utils))
34 (define-public ghc-asn1-types
36 (name "ghc-asn1-types")
40 (uri (string-append "https://hackage.haskell.org/package/"
41 "asn1-types/asn1-types-"
45 "05vjchyqiy9n275cygffhn0ma7fz7jx52j0dcdm9qm8h9bziymqc"))))
46 (build-system haskell-build-system)
48 `(("ghc-memory" ,ghc-memory)
49 ("ghc-hourglass" ,ghc-hourglass)))
50 (home-page "https://github.com/vincenthz/hs-asn1-types")
51 (synopsis "ASN.1 types for Haskell")
53 "The package provides the standard types for dealing with the ASN.1
55 (license license:bsd-3)))
57 (define-public ghc-asn1-encoding
59 (name "ghc-asn1-encoding")
63 (uri (string-append "https://hackage.haskell.org/package/"
64 "asn1-encoding/asn1-encoding-"
68 "0adgbamyq0mj1l1hdq4zyyllay714bac1wl0rih3fv1z6vykp1hy"))))
69 (build-system haskell-build-system)
71 `(("ghc-hourglass" ,ghc-hourglass)
72 ("ghc-asn1-types" ,ghc-asn1-types)
73 ("ghc-text" ,ghc-text)
74 ("ghc-mtl" ,ghc-mtl)))
76 `(("ghc-tasty" ,ghc-tasty)
77 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
78 (home-page "https://github.com/vincenthz/hs-asn1")
79 (synopsis "ASN1 data reader and writer in RAW, BER and DER forms")
81 "This package provides a reader and writer for ASN1 data in raw form with
82 supports for high level forms of ASN1 (BER, and DER).")
83 (license license:bsd-3)))
85 (define-public ghc-asn1-parse
87 (name "ghc-asn1-parse")
91 (uri (string-append "https://hackage.haskell.org/package/"
92 "asn1-parse/asn1-parse-"
96 "025prsihk5g6rdv9xlfmj0zpa0wa3qjzj5i4ilzvg7f6f3sji8y6"))))
97 (build-system haskell-build-system)
99 `(("ghc-asn1-types" ,ghc-asn1-types)
100 ("ghc-asn1-encoding" ,ghc-asn1-encoding)))
101 (home-page "https://github.com/vincenthz/hs-asn1")
102 (synopsis "Simple monadic parser for ASN1 stream types")
104 "This package provides a simple monadic parser for ASN1 stream types,
105 when ASN1 pattern matching is not convenient.")
106 (license license:bsd-3)))
108 (define-public ghc-crypto-api
110 (name "ghc-crypto-api")
115 (uri (string-append "https://hackage.haskell.org/package/"
116 "crypto-api-" version "/"
117 "crypto-api-" version ".tar.gz"))
120 "1vc27qcgbg7hf50rkqhlrs58zn1888ilh4b6wrrm07bnm48xacak"))))
121 (build-system haskell-build-system)
122 (inputs `(("ghc-cereal" ,ghc-cereal)
123 ("ghc-tagged" ,ghc-tagged)
124 ("ghc-entropy" ,ghc-entropy)))
125 (home-page "https://github.com/TomMD/crypto-api")
126 (synopsis "Provides generic interface for cryptographic operations
128 (description "This Haskell package provides a generic interface for
129 cryptographic operations (hashes, ciphers, randomness).
131 Maintainers of hash and cipher implementations are encouraged to add instances
132 for the classes defined in @code{Crypto.Classes}. @code{Crypto} users are
133 similarly encouraged to use the interfaces defined in the @code{Classes} module.
135 Any concepts or functions of general use to more than one cryptographic
136 algorithm (ex: padding) is within scope of this package.")
137 (license license:bsd-3)))
139 (define-public ghc-crypto-api-tests
141 (name "ghc-crypto-api-tests")
146 (uri (string-append "https://hackage.haskell.org/package/"
147 "crypto-api-tests-" version "/"
148 "crypto-api-tests-" version ".tar.gz"))
151 "0w3j43jdrlj28jryp18hc6q84nkl2yf4vs1hhgrsk7gb9kfyqjpl"))))
152 (build-system haskell-build-system)
153 (inputs `(("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
154 ("ghc-crypto-api" ,ghc-crypto-api)
155 ("ghc-cereal" ,ghc-cereal)
156 ("ghc-test-framework" ,ghc-test-framework)
157 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
158 ("ghc-hunit" ,ghc-hunit)
159 ("ghc-quickcheck" ,ghc-quickcheck)))
160 (home-page "https://github.com/TomMD/crypto-api-tests")
161 (synopsis "Test framework and KATs for cryptographic operations for Haskell")
162 (description "This Haskell package provides a test framework for hash and
163 cipher operations using the crypto-api interface. Known answer tests (KATs)
164 for common cryptographic algorithms are included.")
165 (license license:bsd-3)))
167 (define-public ghc-cryptohash
169 (name "ghc-cryptohash")
175 "https://hackage.haskell.org/package/cryptohash/cryptohash-"
179 "1yr2iyb779znj79j3fq4ky8l1y8a600a2x1fx9p5pmpwq5zq93y2"))))
180 (build-system haskell-build-system)
182 `(("ghc-byteable" ,ghc-byteable)
183 ("ghc-cryptonite" ,ghc-cryptonite)
184 ("ghc-memory" ,ghc-memory)
185 ("ghc-hunit" ,ghc-hunit)
186 ("ghc-quickcheck" ,ghc-quickcheck)
187 ("ghc-tasty" ,ghc-tasty)
188 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
189 ("ghc-tasty-hunit" ,ghc-tasty-hunit)))
190 (home-page "https://github.com/vincenthz/hs-cryptohash")
191 (synopsis "Collection of cryptographic hashes in Haskell")
193 "A collection of crypto hashes, with a practical incremental and one-pass,
194 pure APIs, with performance close to the fastest implementations available in
195 other languages. The implementations are made in C with a haskell FFI wrapper
196 that hides the C implementation.")
197 (license license:bsd-3)))
199 (define-public ghc-cryptohash-md5
201 (name "ghc-cryptohash-md5")
202 (version "0.11.100.1")
206 (uri (string-append "https://hackage.haskell.org/package/"
207 "cryptohash-md5-" version "/"
208 "cryptohash-md5-" version ".tar.gz"))
211 "1y8q7s2bn4gdknw1wjikdnar2b5pgz3nv3220lxrlgpsf23x82vi"))))
212 (build-system haskell-build-system)
214 `(#:tests? #f)) ; tests require old version of ghc-hunit (0.9)
215 (native-inputs `(("ghc-base16-bytestring" ,ghc-base16-bytestring)
216 ("ghc-puremd5" ,ghc-puremd5)
217 ("ghc-tasty" ,ghc-tasty)
218 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
219 ("ghc-hunit" ,ghc-hunit)))
220 (home-page "https://github.com/hvr/cryptohash-md5")
221 (synopsis "MD5 implementation for Haskell")
222 (description "This Haskell package provides implementation of MD5.")
223 (license license:bsd-3)))
225 (define-public ghc-cryptohash-sha1
227 (name "ghc-cryptohash-sha1")
228 (version "0.11.100.1")
232 (uri (string-append "https://hackage.haskell.org/package/"
233 "cryptohash-sha1-" version "/"
234 "cryptohash-sha1-" version ".tar.gz"))
237 "1aqdxdhxhl9jldh951djpwxx8z7gzaqspxl7iwpl84i5ahrsyy9w"))))
238 (build-system haskell-build-system)
240 `(#:tests? #f)) ; tests require old version of ghc-hunit (0.9)
241 (native-inputs `(("ghc-base16-bytestring" ,ghc-base16-bytestring)
243 ("ghc-tasty" ,ghc-tasty)
244 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
245 ("ghc-hunit" ,ghc-hunit)))
246 (home-page "https://github.com/hvr/cryptohash-sha1")
247 (synopsis "SHA-1 implementation for Haskell")
248 (description "This Haskell package provides an incremental and one-pass,
249 pure API to the @uref{https://en.wikipedia.org/wiki/SHA-1, SHA-1 hash algorithm},
250 including @uref{https://en.wikipedia.org/wiki/HMAC, HMAC support}, with
251 performance close to the fastest implementations available in other languages.
253 The implementation is made in C with a haskell FFI wrapper that hides
254 the C implementation.")
255 (license license:bsd-3)))
257 (define-public ghc-cryptonite
259 (name "ghc-cryptonite")
263 (uri (string-append "https://hackage.haskell.org/package/"
264 "cryptonite/cryptonite-"
268 "131wbbdr5yavs5k1ah9sz6fqx1ffyvaxf66pwjzsfc47mwc1mgl9"))))
269 (build-system haskell-build-system)
271 `(("ghc-basement" ,ghc-basement)
272 ("ghc-memory" ,ghc-memory)
273 ("ghc-byteable" ,ghc-byteable)))
275 `(("ghc-tasty" ,ghc-tasty)
276 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
277 ("ghc-tasty-hunit" ,ghc-tasty-hunit)
278 ("ghc-tasty-kat" ,ghc-tasty-kat)))
279 (home-page "https://github.com/haskell-crypto/cryptonite")
280 (synopsis "Cryptography primitives")
282 "This package is a repository of cryptographic primitives for Haskell.
283 It supports a wide range of symmetric ciphers, cryptographic hash functions,
284 public key algorithms, key derivation numbers, cryptographic random number
285 generators, and more.")
286 (license license:bsd-3)))
288 (define-public ghc-digest
296 "https://hackage.haskell.org/package/digest/digest-"
301 "04gy2zp8yzvv7j9bdfvmfzcz3sqyqa6rwslqcn4vyair2vmif5v4"))))
302 (build-system haskell-build-system)
306 "https://hackage.haskell.org/package/digest")
308 "Various cryptographic hashes for bytestrings")
310 "This package provides efficient cryptographic hash implementations for
311 strict and lazy bytestrings. For now, CRC32 and Adler32 are supported; they
312 are implemented as FFI bindings to efficient code from zlib.")
313 (license license:bsd-3)))
315 (define-public ghc-entropy
322 (uri (string-append "https://hackage.haskell.org/package/"
323 "entropy-" version "/"
324 "entropy-" version ".tar.gz"))
327 "1l3lfigqvdlmxkz1wl7zdkmc0i2r5p6z4xzhiw8xdsbsw7aljfkl"))))
328 (build-system haskell-build-system)
329 (home-page "https://github.com/TomMD/entropy")
330 (synopsis "Provides platform independent entropy source for Haskell")
331 (description "This Haskell package provides a platform independent method
332 to obtain cryptographically strong entropy.")
333 (license license:bsd-3)))
335 (define-public ghc-pem
341 (uri (string-append "https://hackage.haskell.org/package/"
342 "pem/pem-" version ".tar.gz"))
345 "162sk5sg22w21wqz5qv8kx6ibxp99v5p20g3nknhm1kddk3hha1p"))))
346 (build-system haskell-build-system)
348 `(("ghc-mtl" ,ghc-mtl)
349 ("ghc-base64-bytestring" ,ghc-base64-bytestring)))
351 `(("ghc-test-framework" ,ghc-test-framework)
352 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
353 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
354 ("ghc-hunit" ,ghc-hunit)
355 ("ghc-quickcheck" ,ghc-quickcheck)))
356 (home-page "https://github.com/vincenthz/hs-pem")
357 (synopsis "Privacy Enhanced Mail (PEM) format reader and writer")
359 "This library provides readers and writers for the @dfn{Privacy Enhanced
360 Mail} (PEM) format.")
361 (license license:bsd-3)))
363 (define-public ghc-puremd5
370 (uri (string-append "https://hackage.haskell.org/package/"
371 "pureMD5-" version "/"
372 "pureMD5-" version ".tar.gz"))
375 "0zdilz41cla2ck7mcw1a9702gyg2abq94mqahr4vci9sbs53bwxy"))))
376 (build-system haskell-build-system)
377 (inputs `(("ghc-cereal" ,ghc-cereal)
378 ("ghc-crypto-api" ,ghc-crypto-api)
379 ("ghc-tagged" ,ghc-tagged)))
380 (native-inputs `(("ghc-crypto-api-tests" ,ghc-crypto-api-tests)
381 ("ghc-quickcheck" ,ghc-quickcheck)
382 ("ghc-test-framework" ,ghc-test-framework)
383 ("ghc-test-framework-quickcheck2"
384 ,ghc-test-framework-quickcheck2)
385 ("ghc-pretty-hex" ,ghc-pretty-hex)))
386 (home-page "https://github.com/TomMD/pureMD5")
387 (synopsis "Haskell implementation of the MD5 hash algorithm")
388 (description "This package provides a Haskell-only implementation of
389 the MD5 digest (hash) algorithm. This now supports the @code{crypto-api} class
391 (license license:bsd-3)))
393 (define-public ghc-sha
399 (uri (string-append "https://hackage.haskell.org/package/"
400 "SHA/SHA-" version ".tar.gz"))
403 "134ajm87fm4lpsw86m9q8apv20dw4bpk46raa389zr6bcdpifw64"))))
404 (build-system haskell-build-system)
406 `(("ghc-quickcheck" ,ghc-quickcheck)
407 ("ghc-test-framework" ,ghc-test-framework)
408 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)))
409 (home-page "https://hackage.haskell.org/package/SHA")
410 (synopsis "SHA suite of message digest functions")
412 "This library implements the SHA suite of message digest functions,
413 according to NIST FIPS 180-2 (with the SHA-224 addendum), as well as the
414 SHA-based HMAC routines. The functions have been tested against most of the
415 NIST and RFC test vectors for the various functions. While some attention has
416 been paid to performance, these do not presently reach the speed of well-tuned
417 libraries, like OpenSSL.")
418 (license license:bsd-3)))
420 (define-public ghc-x509
426 (uri (string-append "https://hackage.haskell.org/package/"
427 "x509/x509-" version ".tar.gz"))
430 "0hixx76wpb4qxida017ka5zr6lrsycahrqyw8z90q9mxvndpy3my"))))
431 (build-system haskell-build-system)
433 `(("ghc-memory" ,ghc-memory)
435 ("ghc-hourglass" ,ghc-hourglass)
437 ("ghc-asn1-types" ,ghc-asn1-types)
438 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
439 ("ghc-asn1-parse" ,ghc-asn1-parse)
440 ("ghc-cryptonite" ,ghc-cryptonite)))
442 `(("ghc-tasty" ,ghc-tasty)
443 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
444 (home-page "https://github.com/vincenthz/hs-certificate")
445 (synopsis "X509 reader and writer")
447 "This library provides functions to read and write X509 certificates.")
448 (license license:bsd-3)))
450 (define-public ghc-x509-store
452 (name "ghc-x509-store")
456 (uri (string-append "https://hackage.haskell.org/package/"
457 "x509-store/x509-store-"
461 "0yw09nwkvr324qz4sc27c0p28bz2h6gns6lkaz9mz92mgqf2dza9"))))
462 (build-system haskell-build-system)
464 `(("ghc-mtl" ,ghc-mtl)
466 ("ghc-asn1-types" ,ghc-asn1-types)
467 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
468 ("ghc-cryptonite" ,ghc-cryptonite)
469 ("ghc-x509" ,ghc-x509)))
470 (home-page "https://github.com/vincenthz/hs-certificate")
471 (synopsis "X.509 collection accessing and storing methods")
473 "This package provides functions for accessing and storing X.509
474 collections, certificates, revocation lists, and exception lists.")
475 (license license:bsd-3)))
477 (define-public ghc-x509-validation
479 (name "ghc-x509-validation")
483 (uri (string-append "https://hackage.haskell.org/package/"
484 "x509-validation/x509-validation-"
488 "190w1sr3w6w49v3yvqz4grb0v09ym4gll3n8bxwijvbvcybk3xyi"))))
489 (build-system haskell-build-system)
491 `(("ghc-memory" ,ghc-memory)
492 ("ghc-byteable" ,ghc-byteable)
494 ("ghc-hourglass" ,ghc-hourglass)
495 ("ghc-data-default-class" ,ghc-data-default-class)
497 ("ghc-asn1-types" ,ghc-asn1-types)
498 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
499 ("ghc-x509" ,ghc-x509)
500 ("ghc-x509-store" ,ghc-x509-store)
501 ("ghc-cryptonite" ,ghc-cryptonite)))
502 (home-page "https://github.com/vincenthz/hs-certificate")
503 (synopsis "X.509 certificate and revocation list validation")
505 "This package provides functions for X.509 certificate and revocation
507 (license license:bsd-3)))
509 (define-public ghc-x509-system
511 (name "ghc-x509-system")
515 (uri (string-append "https://hackage.haskell.org/package/"
516 "x509-system/x509-system-"
520 "0k7zc0xp7r6kqmi39rpiicvq78xb0pr2cq6q5s3kmmsshllg13nr"))))
521 (build-system haskell-build-system)
523 `(("ghc-mtl" ,ghc-mtl)
525 ("ghc-x509" ,ghc-x509)
526 ("ghc-x509-store" ,ghc-x509-store)))
527 (home-page "https://github.com/vincenthz/hs-certificate")
528 (synopsis "Handle system X.509 accessors and storage")
530 "This package provides a library to handle system accessors and storage
531 for X.509 certificates.")
532 (license license:bsd-3)))
534 (define-public ghc-crypto-cipher-types
536 (name "ghc-crypto-cipher-types")
541 (uri (string-append "https://hackage.haskell.org/package/"
542 "crypto-cipher-types-" version "/"
543 "crypto-cipher-types-" version ".tar.gz"))
546 "03qa1i1kj07pfrxsi7fiaqnnd0vi94jd4jfswbmnm4gp1nvzcwr0"))))
547 (build-system haskell-build-system)
548 (inputs `(("ghc-byteable" ,ghc-byteable)
549 ("ghc-securemem" ,ghc-securemem)))
550 (home-page "https://github.com/vincenthz/hs-crypto-cipher")
551 (synopsis "Generic cryptography cipher types for Haskell")
552 (description "This Haskell package provides basic typeclasses and types
553 for symmetric ciphers.")
554 (license license:bsd-3)))
556 (define-public ghc-cipher-aes
558 (name "ghc-cipher-aes")
563 (uri (string-append "https://hackage.haskell.org/package/"
564 "cipher-aes-" version "/"
565 "cipher-aes-" version ".tar.gz"))
568 "05ahz6kjq0fl1w66gpiqy0vndli5yx1pbsbw9ni3viwqas4p3cfk"))))
569 (build-system haskell-build-system)
570 (inputs `(("ghc-byteable" ,ghc-byteable)
571 ("ghc-securemem" ,ghc-securemem)
572 ("ghc-crypto-cipher-types" ,ghc-crypto-cipher-types)))
573 (native-inputs `(("ghc-quickcheck" ,ghc-quickcheck)
574 ("ghc-test-framework" ,ghc-test-framework)
575 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
576 ("ghc-crypto-cipher-tests" ,ghc-crypto-cipher-tests)))
577 (home-page "https://github.com/vincenthz/hs-cipher-aes")
578 (synopsis "AES cipher implementation with advanced mode of operations for
580 (description "This Haskell package provides AES cipher implementation.
582 The modes of operations available are ECB (Electronic code book), CBC (Cipher
583 block chaining), CTR (Counter), XTS (XEX with ciphertext stealing),
584 GCM (Galois Counter Mode).
586 The AES implementation uses AES-NI when available (on x86 and x86-64
587 architecture), but fallback gracefully to a software C implementation.
589 The software implementation uses S-Boxes, which might suffer for cache timing
590 issues. However do notes that most other known software implementations,
591 including very popular one (openssl, gnutls) also uses similar
592 implementation. If it matters for your case, you should make sure you have
593 AES-NI available, or you'll need to use a different implementation.")
594 (license license:bsd-3)))