gnu: Add ghc-hsopenssl.
[jackhill/guix/guix.git] / gnu / packages / haskell-crypto.scm
CommitLineData
f24eba89
RW
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
3d7ad1dc 3;;; Copyright © 2015, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
47956fa0 4;;; Copyright © 2016 ng0 <ng0@n0.is>
f24eba89 5;;; Copyright © 2017 rsiddharth <s@ricketyspace.net>
a8a60101 6;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
f24eba89
RW
7;;;
8;;; This file is part of GNU Guix.
9;;;
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.
14;;;
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.
19;;;
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/>.
22
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)
0925b804 28 #:use-module (gnu packages tls)
f24eba89
RW
29 #:use-module (guix build-system haskell)
30 #:use-module (guix download)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
33 #:use-module (guix utils))
34
35(define-public ghc-asn1-types
36 (package
37 (name "ghc-asn1-types")
17c3a50d 38 (version "0.3.2")
f24eba89
RW
39 (source (origin
40 (method url-fetch)
41 (uri (string-append "https://hackage.haskell.org/package/"
42 "asn1-types/asn1-types-"
43 version ".tar.gz"))
44 (sha256
45 (base32
17c3a50d 46 "05vjchyqiy9n275cygffhn0ma7fz7jx52j0dcdm9qm8h9bziymqc"))))
f24eba89
RW
47 (build-system haskell-build-system)
48 (inputs
49 `(("ghc-memory" ,ghc-memory)
50 ("ghc-hourglass" ,ghc-hourglass)))
51 (home-page "https://github.com/vincenthz/hs-asn1-types")
52 (synopsis "ASN.1 types for Haskell")
53 (description
54 "The package provides the standard types for dealing with the ASN.1
55format.")
56 (license license:bsd-3)))
57
58(define-public ghc-asn1-encoding
59 (package
60 (name "ghc-asn1-encoding")
c24bfc3d 61 (version "0.9.5")
f24eba89
RW
62 (source (origin
63 (method url-fetch)
64 (uri (string-append "https://hackage.haskell.org/package/"
65 "asn1-encoding/asn1-encoding-"
66 version ".tar.gz"))
67 (sha256
68 (base32
c24bfc3d 69 "0adgbamyq0mj1l1hdq4zyyllay714bac1wl0rih3fv1z6vykp1hy"))))
f24eba89
RW
70 (build-system haskell-build-system)
71 (inputs
72 `(("ghc-hourglass" ,ghc-hourglass)
a1eb8be8 73 ("ghc-asn1-types" ,ghc-asn1-types)))
f24eba89
RW
74 (native-inputs
75 `(("ghc-tasty" ,ghc-tasty)
76 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
77 (home-page "https://github.com/vincenthz/hs-asn1")
78 (synopsis "ASN1 data reader and writer in RAW, BER and DER forms")
79 (description
80 "This package provides a reader and writer for ASN1 data in raw form with
81supports for high level forms of ASN1 (BER, and DER).")
82 (license license:bsd-3)))
83
84(define-public ghc-asn1-parse
85 (package
86 (name "ghc-asn1-parse")
87 (version "0.9.4")
88 (source (origin
89 (method url-fetch)
90 (uri (string-append "https://hackage.haskell.org/package/"
91 "asn1-parse/asn1-parse-"
92 version ".tar.gz"))
93 (sha256
94 (base32
95 "025prsihk5g6rdv9xlfmj0zpa0wa3qjzj5i4ilzvg7f6f3sji8y6"))))
96 (build-system haskell-build-system)
97 (inputs
98 `(("ghc-asn1-types" ,ghc-asn1-types)
99 ("ghc-asn1-encoding" ,ghc-asn1-encoding)))
100 (home-page "https://github.com/vincenthz/hs-asn1")
101 (synopsis "Simple monadic parser for ASN1 stream types")
102 (description
103 "This package provides a simple monadic parser for ASN1 stream types,
104when ASN1 pattern matching is not convenient.")
105 (license license:bsd-3)))
106
107(define-public ghc-crypto-api
108 (package
109 (name "ghc-crypto-api")
0f108b33 110 (version "0.13.3")
f24eba89
RW
111 (source
112 (origin
113 (method url-fetch)
114 (uri (string-append "https://hackage.haskell.org/package/"
115 "crypto-api-" version "/"
116 "crypto-api-" version ".tar.gz"))
117 (sha256
118 (base32
0f108b33 119 "19bsmkqkpnvh01b77pmyarx00fic15j4hvg4pzscrj4prskrx2i9"))))
f24eba89
RW
120 (build-system haskell-build-system)
121 (inputs `(("ghc-cereal" ,ghc-cereal)
122 ("ghc-tagged" ,ghc-tagged)
123 ("ghc-entropy" ,ghc-entropy)))
124 (home-page "https://github.com/TomMD/crypto-api")
125 (synopsis "Provides generic interface for cryptographic operations
126for Haskell")
127 (description "This Haskell package provides a generic interface for
128cryptographic operations (hashes, ciphers, randomness).
129
130Maintainers of hash and cipher implementations are encouraged to add instances
131for the classes defined in @code{Crypto.Classes}. @code{Crypto} users are
132similarly encouraged to use the interfaces defined in the @code{Classes} module.
133
134Any concepts or functions of general use to more than one cryptographic
135algorithm (ex: padding) is within scope of this package.")
136 (license license:bsd-3)))
137
138(define-public ghc-crypto-api-tests
139 (package
140 (name "ghc-crypto-api-tests")
141 (version "0.3")
142 (source
143 (origin
144 (method url-fetch)
145 (uri (string-append "https://hackage.haskell.org/package/"
146 "crypto-api-tests-" version "/"
147 "crypto-api-tests-" version ".tar.gz"))
148 (sha256
149 (base32
150 "0w3j43jdrlj28jryp18hc6q84nkl2yf4vs1hhgrsk7gb9kfyqjpl"))))
151 (build-system haskell-build-system)
152 (inputs `(("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
153 ("ghc-crypto-api" ,ghc-crypto-api)
154 ("ghc-cereal" ,ghc-cereal)
155 ("ghc-test-framework" ,ghc-test-framework)
156 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
157 ("ghc-hunit" ,ghc-hunit)
158 ("ghc-quickcheck" ,ghc-quickcheck)))
159 (home-page "https://github.com/TomMD/crypto-api-tests")
160 (synopsis "Test framework and KATs for cryptographic operations for Haskell")
161 (description "This Haskell package provides a test framework for hash and
162cipher operations using the crypto-api interface. Known answer tests (KATs)
163for common cryptographic algorithms are included.")
164 (license license:bsd-3)))
165
166(define-public ghc-cryptohash
167 (package
168 (name "ghc-cryptohash")
169 (version "0.11.9")
170 (source
171 (origin
172 (method url-fetch)
173 (uri (string-append
174 "https://hackage.haskell.org/package/cryptohash/cryptohash-"
175 version ".tar.gz"))
176 (sha256
177 (base32
178 "1yr2iyb779znj79j3fq4ky8l1y8a600a2x1fx9p5pmpwq5zq93y2"))))
179 (build-system haskell-build-system)
180 (inputs
181 `(("ghc-byteable" ,ghc-byteable)
182 ("ghc-cryptonite" ,ghc-cryptonite)
183 ("ghc-memory" ,ghc-memory)
184 ("ghc-hunit" ,ghc-hunit)
185 ("ghc-quickcheck" ,ghc-quickcheck)
186 ("ghc-tasty" ,ghc-tasty)
187 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
188 ("ghc-tasty-hunit" ,ghc-tasty-hunit)))
189 (home-page "https://github.com/vincenthz/hs-cryptohash")
190 (synopsis "Collection of cryptographic hashes in Haskell")
191 (description
192 "A collection of crypto hashes, with a practical incremental and one-pass,
193pure APIs, with performance close to the fastest implementations available in
194other languages. The implementations are made in C with a haskell FFI wrapper
195that hides the C implementation.")
196 (license license:bsd-3)))
197
198(define-public ghc-cryptohash-md5
199 (package
200 (name "ghc-cryptohash-md5")
201 (version "0.11.100.1")
202 (source
203 (origin
204 (method url-fetch)
205 (uri (string-append "https://hackage.haskell.org/package/"
206 "cryptohash-md5-" version "/"
207 "cryptohash-md5-" version ".tar.gz"))
208 (sha256
209 (base32
210 "1y8q7s2bn4gdknw1wjikdnar2b5pgz3nv3220lxrlgpsf23x82vi"))))
211 (build-system haskell-build-system)
212 (arguments
6ef7c05c
TS
213 `(#:cabal-revision
214 ("2" "0vyb9cfvpfxpslxvvhd48gw37i9g8ry5x63xwxd9q7xfiqhs7p3a")
215 #:tests? #f)) ; tests require old version of ghc-hunit (0.9)
f24eba89
RW
216 (native-inputs `(("ghc-base16-bytestring" ,ghc-base16-bytestring)
217 ("ghc-puremd5" ,ghc-puremd5)
218 ("ghc-tasty" ,ghc-tasty)
219 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
220 ("ghc-hunit" ,ghc-hunit)))
221 (home-page "https://github.com/hvr/cryptohash-md5")
222 (synopsis "MD5 implementation for Haskell")
223 (description "This Haskell package provides implementation of MD5.")
224 (license license:bsd-3)))
225
226(define-public ghc-cryptohash-sha1
227 (package
228 (name "ghc-cryptohash-sha1")
229 (version "0.11.100.1")
230 (source
231 (origin
232 (method url-fetch)
233 (uri (string-append "https://hackage.haskell.org/package/"
234 "cryptohash-sha1-" version "/"
235 "cryptohash-sha1-" version ".tar.gz"))
236 (sha256
237 (base32
238 "1aqdxdhxhl9jldh951djpwxx8z7gzaqspxl7iwpl84i5ahrsyy9w"))))
239 (build-system haskell-build-system)
240 (arguments
f89bf674
TS
241 `(#:cabal-revision
242 ("2" "0xas0nbq9bfdzlj6k565ibizv1cqvzfzsdj6q9pdiiwyxqblqc3m")
243 #:tests? #f)) ; tests require old version of ghc-hunit (0.9)
f24eba89
RW
244 (native-inputs `(("ghc-base16-bytestring" ,ghc-base16-bytestring)
245 ("ghc-sha" ,ghc-sha)
246 ("ghc-tasty" ,ghc-tasty)
247 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
248 ("ghc-hunit" ,ghc-hunit)))
249 (home-page "https://github.com/hvr/cryptohash-sha1")
250 (synopsis "SHA-1 implementation for Haskell")
251 (description "This Haskell package provides an incremental and one-pass,
252pure API to the @uref{https://en.wikipedia.org/wiki/SHA-1, SHA-1 hash algorithm},
253including @uref{https://en.wikipedia.org/wiki/HMAC, HMAC support}, with
254performance close to the fastest implementations available in other languages.
255
bf7e5884
TS
256The implementation is made in C with a haskell FFI wrapper that hides
257the C implementation.")
258 (license license:bsd-3)))
259
260(define-public ghc-cryptohash-sha256
261 (package
262 (name "ghc-cryptohash-sha256")
263 (version "0.11.101.0")
264 (source
265 (origin
266 (method url-fetch)
267 (uri (string-append "https://hackage.haskell.org/package/"
268 "cryptohash-sha256-" version "/"
269 "cryptohash-sha256-" version ".tar.gz"))
270 (sha256
271 (base32
272 "1p85vajcgw9hmq8zsz9krzx0vxh7aggwbg5w9ws8w97avcsn8xaj"))))
273 (build-system haskell-build-system)
274 (arguments
275 `(#:cabal-revision
276 ("1" "19birnmwga1yh82l4jqc3fygqkqcf5y8dlldnxfswngkzc3rvwp3")
277 #:tests? #f)) ; tests require old version of ghc-hunit (0.9)
278 (inputs
279 `(("ghc-base16-bytestring" ,ghc-base16-bytestring)))
280 (native-inputs
281 `(("ghc-sha" ,ghc-sha)
282 ("ghc-tasty" ,ghc-tasty)
283 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
284 ("ghc-hunit" ,ghc-hunit)))
285 (home-page "https://github.com/hvr/cryptohash-sha1")
286 (synopsis "SHA-256 implementation for Haskell")
287 (description "This Haskell package provides an incremental and
288one-pass, pure API to the @uref{https://en.wikipedia.org/wiki/SHA-2,
289SHA-256 cryptographic hash algorithm}, with performance close to the
290fastest implementations available in other languages.
291
f24eba89
RW
292The implementation is made in C with a haskell FFI wrapper that hides
293the C implementation.")
294 (license license:bsd-3)))
295
296(define-public ghc-cryptonite
297 (package
298 (name "ghc-cryptonite")
5b5dbece 299 (version "0.25")
f24eba89
RW
300 (source (origin
301 (method url-fetch)
302 (uri (string-append "https://hackage.haskell.org/package/"
303 "cryptonite/cryptonite-"
304 version ".tar.gz"))
305 (sha256
306 (base32
5b5dbece 307 "131wbbdr5yavs5k1ah9sz6fqx1ffyvaxf66pwjzsfc47mwc1mgl9"))))
f24eba89 308 (build-system haskell-build-system)
3d7ad1dc
RW
309 ;; FIXME: tests are broken.
310 ;; See https://github.com/haskell-crypto/cryptonite/issues/260
311 (arguments '(#:tests? #f))
f24eba89 312 (inputs
5b5dbece
RW
313 `(("ghc-basement" ,ghc-basement)
314 ("ghc-memory" ,ghc-memory)
f24eba89
RW
315 ("ghc-byteable" ,ghc-byteable)))
316 (native-inputs
317 `(("ghc-tasty" ,ghc-tasty)
318 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
319 ("ghc-tasty-hunit" ,ghc-tasty-hunit)
320 ("ghc-tasty-kat" ,ghc-tasty-kat)))
321 (home-page "https://github.com/haskell-crypto/cryptonite")
322 (synopsis "Cryptography primitives")
323 (description
324 "This package is a repository of cryptographic primitives for Haskell.
325It supports a wide range of symmetric ciphers, cryptographic hash functions,
326public key algorithms, key derivation numbers, cryptographic random number
327generators, and more.")
328 (license license:bsd-3)))
329
330(define-public ghc-digest
331 (package
332 (name "ghc-digest")
333 (version "0.0.1.2")
334 (source
335 (origin
336 (method url-fetch)
337 (uri (string-append
338 "https://hackage.haskell.org/package/digest/digest-"
339 version
340 ".tar.gz"))
341 (sha256
342 (base32
343 "04gy2zp8yzvv7j9bdfvmfzcz3sqyqa6rwslqcn4vyair2vmif5v4"))))
344 (build-system haskell-build-system)
345 (inputs
346 `(("zlib" ,zlib)))
347 (home-page
348 "https://hackage.haskell.org/package/digest")
349 (synopsis
350 "Various cryptographic hashes for bytestrings")
351 (description
352 "This package provides efficient cryptographic hash implementations for
353strict and lazy bytestrings. For now, CRC32 and Adler32 are supported; they
354are implemented as FFI bindings to efficient code from zlib.")
355 (license license:bsd-3)))
356
357(define-public ghc-entropy
358 (package
359 (name "ghc-entropy")
a8a60101 360 (version "0.4.1.4")
f24eba89
RW
361 (source
362 (origin
363 (method url-fetch)
364 (uri (string-append "https://hackage.haskell.org/package/"
365 "entropy-" version "/"
366 "entropy-" version ".tar.gz"))
367 (sha256
a8a60101 368 (base32 "1fgf47l9klwn1xssbcbq6by651vikd8hlfxhiwd5bqzxr1jnlgrf"))))
f24eba89
RW
369 (build-system haskell-build-system)
370 (home-page "https://github.com/TomMD/entropy")
371 (synopsis "Provides platform independent entropy source for Haskell")
372 (description "This Haskell package provides a platform independent method
373to obtain cryptographically strong entropy.")
374 (license license:bsd-3)))
375
376(define-public ghc-pem
377 (package
378 (name "ghc-pem")
9720cca2 379 (version "0.2.4")
f24eba89
RW
380 (source (origin
381 (method url-fetch)
382 (uri (string-append "https://hackage.haskell.org/package/"
383 "pem/pem-" version ".tar.gz"))
384 (sha256
385 (base32
9720cca2 386 "1m7qjsxrd8m88cvkqmr8kscril500j2a9y0iynvksjyjkhdlq33p"))))
f24eba89
RW
387 (build-system haskell-build-system)
388 (inputs
9720cca2
TS
389 `(("ghc-basement" ,ghc-basement)
390 ("ghc-memory" ,ghc-memory)))
f24eba89
RW
391 (native-inputs
392 `(("ghc-test-framework" ,ghc-test-framework)
393 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
394 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
395 ("ghc-hunit" ,ghc-hunit)
396 ("ghc-quickcheck" ,ghc-quickcheck)))
397 (home-page "https://github.com/vincenthz/hs-pem")
398 (synopsis "Privacy Enhanced Mail (PEM) format reader and writer")
399 (description
400 "This library provides readers and writers for the @dfn{Privacy Enhanced
401Mail} (PEM) format.")
402 (license license:bsd-3)))
403
404(define-public ghc-puremd5
405 (package
406 (name "ghc-puremd5")
407 (version "2.1.3")
408 (source
409 (origin
410 (method url-fetch)
411 (uri (string-append "https://hackage.haskell.org/package/"
412 "pureMD5-" version "/"
413 "pureMD5-" version ".tar.gz"))
414 (sha256
415 (base32
416 "0zdilz41cla2ck7mcw1a9702gyg2abq94mqahr4vci9sbs53bwxy"))))
417 (build-system haskell-build-system)
418 (inputs `(("ghc-cereal" ,ghc-cereal)
419 ("ghc-crypto-api" ,ghc-crypto-api)
420 ("ghc-tagged" ,ghc-tagged)))
421 (native-inputs `(("ghc-crypto-api-tests" ,ghc-crypto-api-tests)
422 ("ghc-quickcheck" ,ghc-quickcheck)
423 ("ghc-test-framework" ,ghc-test-framework)
424 ("ghc-test-framework-quickcheck2"
425 ,ghc-test-framework-quickcheck2)
426 ("ghc-pretty-hex" ,ghc-pretty-hex)))
427 (home-page "https://github.com/TomMD/pureMD5")
428 (synopsis "Haskell implementation of the MD5 hash algorithm")
429 (description "This package provides a Haskell-only implementation of
430the MD5 digest (hash) algorithm. This now supports the @code{crypto-api} class
431interface.")
432 (license license:bsd-3)))
433
434(define-public ghc-sha
435 (package
436 (name "ghc-sha")
c1c35c3b 437 (version "1.6.4.4")
f24eba89
RW
438 (source (origin
439 (method url-fetch)
440 (uri (string-append "https://hackage.haskell.org/package/"
441 "SHA/SHA-" version ".tar.gz"))
442 (sha256
443 (base32
c1c35c3b 444 "0i4b2wjisivdy72synal711ywhx05mfqfba5n65rk8qidggm1nbb"))))
f24eba89
RW
445 (build-system haskell-build-system)
446 (native-inputs
447 `(("ghc-quickcheck" ,ghc-quickcheck)
448 ("ghc-test-framework" ,ghc-test-framework)
449 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)))
450 (home-page "https://hackage.haskell.org/package/SHA")
451 (synopsis "SHA suite of message digest functions")
452 (description
453 "This library implements the SHA suite of message digest functions,
454according to NIST FIPS 180-2 (with the SHA-224 addendum), as well as the
455SHA-based HMAC routines. The functions have been tested against most of the
456NIST and RFC test vectors for the various functions. While some attention has
457been paid to performance, these do not presently reach the speed of well-tuned
458libraries, like OpenSSL.")
459 (license license:bsd-3)))
460
461(define-public ghc-x509
462 (package
463 (name "ghc-x509")
1f795ab0 464 (version "1.7.5")
f24eba89
RW
465 (source (origin
466 (method url-fetch)
467 (uri (string-append "https://hackage.haskell.org/package/"
468 "x509/x509-" version ".tar.gz"))
469 (sha256
470 (base32
1f795ab0 471 "1j67c35g8334jx7x32hh6awhr43dplp0qwal5gnlkmx09axzrc5i"))))
f24eba89
RW
472 (build-system haskell-build-system)
473 (inputs
474 `(("ghc-memory" ,ghc-memory)
f24eba89
RW
475 ("ghc-hourglass" ,ghc-hourglass)
476 ("ghc-pem" ,ghc-pem)
477 ("ghc-asn1-types" ,ghc-asn1-types)
478 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
479 ("ghc-asn1-parse" ,ghc-asn1-parse)
480 ("ghc-cryptonite" ,ghc-cryptonite)))
481 (native-inputs
482 `(("ghc-tasty" ,ghc-tasty)
483 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
484 (home-page "https://github.com/vincenthz/hs-certificate")
485 (synopsis "X509 reader and writer")
486 (description
487 "This library provides functions to read and write X509 certificates.")
488 (license license:bsd-3)))
489
490(define-public ghc-x509-store
491 (package
492 (name "ghc-x509-store")
25ed6005 493 (version "1.6.7")
f24eba89
RW
494 (source (origin
495 (method url-fetch)
496 (uri (string-append "https://hackage.haskell.org/package/"
497 "x509-store/x509-store-"
498 version ".tar.gz"))
499 (sha256
500 (base32
25ed6005 501 "1y8yyr1i95jkllg8k0z54k5v4vachp848clc07m33xpxidn3b1lp"))))
f24eba89
RW
502 (build-system haskell-build-system)
503 (inputs
f54f0475 504 `(("ghc-pem" ,ghc-pem)
f24eba89
RW
505 ("ghc-asn1-types" ,ghc-asn1-types)
506 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
507 ("ghc-cryptonite" ,ghc-cryptonite)
508 ("ghc-x509" ,ghc-x509)))
245a2555
TS
509 (native-inputs
510 `(("ghc-tasty" ,ghc-tasty)
511 ("ghc-tasty-hunit" ,ghc-tasty-hunit)))
f24eba89
RW
512 (home-page "https://github.com/vincenthz/hs-certificate")
513 (synopsis "X.509 collection accessing and storing methods")
514 (description
515 "This package provides functions for accessing and storing X.509
516collections, certificates, revocation lists, and exception lists.")
517 (license license:bsd-3)))
518
519(define-public ghc-x509-validation
520 (package
521 (name "ghc-x509-validation")
693bcfe2 522 (version "1.6.11")
f24eba89
RW
523 (source (origin
524 (method url-fetch)
525 (uri (string-append "https://hackage.haskell.org/package/"
526 "x509-validation/x509-validation-"
527 version ".tar.gz"))
528 (sha256
529 (base32
693bcfe2 530 "16yihzljql3z8w5rgdl95fv3hgk7yd86kbl9b3glllsark5j2hzr"))))
f24eba89
RW
531 (build-system haskell-build-system)
532 (inputs
533 `(("ghc-memory" ,ghc-memory)
534 ("ghc-byteable" ,ghc-byteable)
f24eba89
RW
535 ("ghc-hourglass" ,ghc-hourglass)
536 ("ghc-data-default-class" ,ghc-data-default-class)
537 ("ghc-pem" ,ghc-pem)
538 ("ghc-asn1-types" ,ghc-asn1-types)
539 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
540 ("ghc-x509" ,ghc-x509)
541 ("ghc-x509-store" ,ghc-x509-store)
542 ("ghc-cryptonite" ,ghc-cryptonite)))
bb84b01d
TS
543 (native-inputs
544 `(("ghc-tasty" ,ghc-tasty)
545 ("ghc-tasty-hunit" ,ghc-tasty-hunit)))
f24eba89
RW
546 (home-page "https://github.com/vincenthz/hs-certificate")
547 (synopsis "X.509 certificate and revocation list validation")
548 (description
549 "This package provides functions for X.509 certificate and revocation
550list validation.")
551 (license license:bsd-3)))
552
553(define-public ghc-x509-system
554 (package
555 (name "ghc-x509-system")
ddbe0207 556 (version "1.6.6")
f24eba89
RW
557 (source (origin
558 (method url-fetch)
559 (uri (string-append "https://hackage.haskell.org/package/"
560 "x509-system/x509-system-"
561 version ".tar.gz"))
562 (sha256
563 (base32
ddbe0207 564 "06a4m9c7vlr9nhp9gmqbb46arf0yj1dkdm4nip03hzy67spdmp20"))))
f24eba89
RW
565 (build-system haskell-build-system)
566 (inputs
f54f0475 567 `(("ghc-pem" ,ghc-pem)
f24eba89
RW
568 ("ghc-x509" ,ghc-x509)
569 ("ghc-x509-store" ,ghc-x509-store)))
570 (home-page "https://github.com/vincenthz/hs-certificate")
571 (synopsis "Handle system X.509 accessors and storage")
572 (description
573 "This package provides a library to handle system accessors and storage
574for X.509 certificates.")
575 (license license:bsd-3)))
aab6df5b 576
577(define-public ghc-crypto-cipher-types
578 (package
579 (name "ghc-crypto-cipher-types")
580 (version "0.0.9")
581 (source
582 (origin
583 (method url-fetch)
584 (uri (string-append "https://hackage.haskell.org/package/"
585 "crypto-cipher-types-" version "/"
586 "crypto-cipher-types-" version ".tar.gz"))
587 (sha256
588 (base32
589 "03qa1i1kj07pfrxsi7fiaqnnd0vi94jd4jfswbmnm4gp1nvzcwr0"))))
590 (build-system haskell-build-system)
591 (inputs `(("ghc-byteable" ,ghc-byteable)
592 ("ghc-securemem" ,ghc-securemem)))
593 (home-page "https://github.com/vincenthz/hs-crypto-cipher")
594 (synopsis "Generic cryptography cipher types for Haskell")
595 (description "This Haskell package provides basic typeclasses and types
596for symmetric ciphers.")
597 (license license:bsd-3)))
d91acee7 598
599(define-public ghc-cipher-aes
600 (package
601 (name "ghc-cipher-aes")
602 (version "0.2.11")
603 (source
604 (origin
605 (method url-fetch)
606 (uri (string-append "https://hackage.haskell.org/package/"
607 "cipher-aes-" version "/"
608 "cipher-aes-" version ".tar.gz"))
609 (sha256
610 (base32
611 "05ahz6kjq0fl1w66gpiqy0vndli5yx1pbsbw9ni3viwqas4p3cfk"))))
612 (build-system haskell-build-system)
613 (inputs `(("ghc-byteable" ,ghc-byteable)
614 ("ghc-securemem" ,ghc-securemem)
615 ("ghc-crypto-cipher-types" ,ghc-crypto-cipher-types)))
616 (native-inputs `(("ghc-quickcheck" ,ghc-quickcheck)
617 ("ghc-test-framework" ,ghc-test-framework)
618 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
619 ("ghc-crypto-cipher-tests" ,ghc-crypto-cipher-tests)))
620 (home-page "https://github.com/vincenthz/hs-cipher-aes")
621 (synopsis "AES cipher implementation with advanced mode of operations for
622Haskell")
623 (description "This Haskell package provides AES cipher implementation.
624
625The modes of operations available are ECB (Electronic code book), CBC (Cipher
626block chaining), CTR (Counter), XTS (XEX with ciphertext stealing),
627GCM (Galois Counter Mode).
628
629The AES implementation uses AES-NI when available (on x86 and x86-64
630architecture), but fallback gracefully to a software C implementation.
631
632The software implementation uses S-Boxes, which might suffer for cache timing
633issues. However do notes that most other known software implementations,
634including very popular one (openssl, gnutls) also uses similar
635implementation. If it matters for your case, you should make sure you have
636AES-NI available, or you'll need to use a different implementation.")
637 (license license:bsd-3)))
13c28167 638
639(define-public ghc-crypto-random
640 (package
641 (name "ghc-crypto-random")
642 (version "0.0.9")
643 (source
644 (origin
645 (method url-fetch)
646 (uri (string-append "https://hackage.haskell.org/package/"
647 "crypto-random-" version "/"
648 "crypto-random-" version ".tar.gz"))
649 (sha256
650 (base32
651 "0139kbbb2h7vshf68y3fvjda29lhj7jjwl4vq78w4y8k8hc7l2hp"))))
652 (build-system haskell-build-system)
653 (inputs `(("ghc-securemem" ,ghc-securemem)
654 ("ghc-vector" ,ghc-vector)))
655 (home-page "https://github.com/vincenthz/hs-crypto-random")
656 (synopsis "Simple cryptographic random related types for Haskell")
657 (description "Simple cryptographic random related types: a safe
658abstraction for CPRNGs.")
659 (license license:bsd-3)))
7565a308 660
661(define-public ghc-cprng-aes
662 (package
663 (name "ghc-cprng-aes")
664 (version "0.6.1")
665 (source
666 (origin
667 (method url-fetch)
668 (uri (string-append "https://hackage.haskell.org/package/"
669 "cprng-aes-" version "/"
670 "cprng-aes-" version ".tar.gz"))
671 (sha256
672 (base32
673 "1wr15kbmk1g3l8a75n0iwbzqg24ixv78slwzwb2q6rlcvq0jlnb4"))))
674 (build-system haskell-build-system)
675 (inputs `(("ghc-byteable" ,ghc-byteable)
676 ("ghc-crypto-random" ,ghc-crypto-random)
677 ("ghc-cipher-aes" ,ghc-cipher-aes)))
678 (home-page "https://github.com/vincenthz/hs-cprng-aes")
679 (synopsis "Crypto Pseudo Random Number Generator using AES in counter mode
680in Haskell")
681 (description "Simple crypto pseudo-random-number-generator with really
682good randomness property.
683
684Using ent, a randomness property maker on one 1Mb sample:
685
686@itemize
687@item Entropy = 7.999837 bits per byte.
688@item Optimum compression would reduce the size of this 1048576 byte file by 0
689percent.
690@item Chi square distribution for 1048576 samples is 237.02.
691@item Arithmbetic mean value of data bytes is 127.3422 (127.5 = random).
692@item Monte Carlo value for Pi is 3.143589568 (error 0.06 percent).
693@end itemize
694
695Compared to urandom with the same sampling:
696
697@itemize
698@item Entropy = 7.999831 bits per byte.
699@item Optimum compression would reduce the size of this 1048576 byte file by 0
700percent.
701@item Chi square distribution for 1048576 samples is 246.63.
702@item Arithmetic mean value of data bytes is 127.6347 (127.5 = random).
703@item Monte Carlo value for Pi is 3.132465868 (error 0.29 percent).
704@end itemize")
705 (license license:bsd-3)))
5a88cff2
TS
706
707(define-public ghc-ed25519
708 (package
709 (name "ghc-ed25519")
710 (version "0.0.5.0")
711 (source
712 (origin
713 (method url-fetch)
714 (uri (string-append
715 "https://hackage.haskell.org/package/ed25519/ed25519-"
716 version ".tar.gz"))
717 (sha256
718 (base32
719 "0v8msqvgzimhs7p5ri25hrb1ni2wvisl5rmdxy89fc59py79b9fq"))))
720 (build-system haskell-build-system)
721 (arguments
722 `(#:cabal-revision
723 ("2" "1cq6h3jqkb1kvd9fjfhsllg5gq78sdiyf2gy9862xhlbv6wil19f")
724 ;; We omit these test suites because they require old versions of
725 ;; packages and packages we do not have.
726 #:configure-flags
727 '("--flags=-test-hlint -test-doctests -test-properties")))
728 (home-page "http://thoughtpolice.github.com/hs-ed25519")
729 (synopsis "Ed25519 cryptographic signatures")
730 (description "This package provides a simple, fast, self-contained
731copy of the Ed25519 public-key signature system with a clean interface.
732It also includes support for detached signatures, and thorough
733documentation on the design and implementation, including usage
734guidelines.")
735 (license license:expat)))
c44667cc
LC
736
737(define-public ghc-tls
738 (package
739 (name "ghc-tls")
740 (version "1.4.1")
741 (source (origin
742 (method url-fetch)
743 (uri (string-append "https://hackage.haskell.org/package/"
744 "tls/tls-" version ".tar.gz"))
745 (sha256
746 (base32
747 "1y083724mym28n6xfaz7pcc7zqxdhjpaxpbvzxfbs25qq2px3smv"))))
748 (build-system haskell-build-system)
749 (inputs
750 `(("ghc-cereal" ,ghc-cereal)
751 ("ghc-data-default-class" ,ghc-data-default-class)
752 ("ghc-memory" ,ghc-memory)
753 ("ghc-cryptonite" ,ghc-cryptonite)
754 ("ghc-asn1-types" ,ghc-asn1-types)
755 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
756 ("ghc-x509" ,ghc-x509)
757 ("ghc-x509-store" ,ghc-x509-store)
758 ("ghc-x509-validation" ,ghc-x509-validation)
759 ("ghc-async" ,ghc-async)
760 ("ghc-network" ,ghc-network)
761 ("ghc-hourglass" ,ghc-hourglass)))
762 (native-inputs
763 `(("ghc-tasty" ,ghc-tasty)
764 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
765 ("ghc-quickcheck" ,ghc-quickcheck)))
766 (home-page "https://github.com/vincenthz/hs-tls")
767 (synopsis
768 "TLS/SSL protocol native implementation (Server and Client)")
769 (description
770 "Native Haskell TLS and SSL protocol implementation for server and client.
771This provides a high-level implementation of a sensitive security protocol,
772eliminating a common set of security issues through the use of the advanced
773type system, high level constructions and common Haskell features. Currently
774implement the SSL3.0, TLS1.0, TLS1.1 and TLS1.2 protocol, and support RSA and
775Ephemeral (Elliptic curve and regular) Diffie Hellman key exchanges, and many
776extensions.")
777 (license license:bsd-3)))
778
0925b804
RV
779(define-public ghc-hsopenssl
780 (package
781 (name "ghc-hsopenssl")
782 (version "0.11.4.15")
783 (source
784 (origin
785 (method url-fetch)
786 (uri (string-append "https://hackage.haskell.org/package/"
787 "HsOpenSSL/HsOpenSSL-" version ".tar.gz"))
788 (sha256
789 (base32
790 "0idmak6d8mpbxphyq9hkxkmby2wnzhc1phywlgm0zw6q47pwxgff"))))
791 (build-system haskell-build-system)
792 (inputs
793 `(("ghc-network" ,ghc-network)
794 ("openssl" ,openssl)))
795 (arguments
796 `(#:cabal-revision
797 ("1" "0bkcw2pjfgv1bhgkrpncvwq9czfr7cr4ak14n0v8c2y33i33wk5z")))
798 (home-page "https://github.com/vshabanov/HsOpenSSL")
799 (synopsis "Partial OpenSSL binding for Haskell")
800 (description "HsOpenSSL is an OpenSSL binding for Haskell. It can
801generate RSA and DSA keys, read and write PEM files, generate message
802digests, sign and verify messages, encrypt and decrypt messages. It has
803also some capabilities of creating SSL clients and servers. This
804package is in production use by a number of Haskell based systems and
805stable. You may also be interested in the tls package,
806@uref{http://hackage.haskell.org/package/tls}, which is a pure Haskell
807implementation of SSL.")
808 (license license:public-domain)))