gnu: ghc-crypto-api: Update to 0.13.3.
[jackhill/guix/guix.git] / gnu / packages / haskell-crypto.scm
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>
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)
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))
33
34 (define-public ghc-asn1-types
35 (package
36 (name "ghc-asn1-types")
37 (version "0.3.2")
38 (source (origin
39 (method url-fetch)
40 (uri (string-append "https://hackage.haskell.org/package/"
41 "asn1-types/asn1-types-"
42 version ".tar.gz"))
43 (sha256
44 (base32
45 "05vjchyqiy9n275cygffhn0ma7fz7jx52j0dcdm9qm8h9bziymqc"))))
46 (build-system haskell-build-system)
47 (inputs
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")
52 (description
53 "The package provides the standard types for dealing with the ASN.1
54 format.")
55 (license license:bsd-3)))
56
57 (define-public ghc-asn1-encoding
58 (package
59 (name "ghc-asn1-encoding")
60 (version "0.9.5")
61 (source (origin
62 (method url-fetch)
63 (uri (string-append "https://hackage.haskell.org/package/"
64 "asn1-encoding/asn1-encoding-"
65 version ".tar.gz"))
66 (sha256
67 (base32
68 "0adgbamyq0mj1l1hdq4zyyllay714bac1wl0rih3fv1z6vykp1hy"))))
69 (build-system haskell-build-system)
70 (inputs
71 `(("ghc-hourglass" ,ghc-hourglass)
72 ("ghc-asn1-types" ,ghc-asn1-types)
73 ("ghc-text" ,ghc-text)))
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
81 supports 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,
104 when 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")
110 (version "0.13.3")
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
119 "19bsmkqkpnvh01b77pmyarx00fic15j4hvg4pzscrj4prskrx2i9"))))
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
126 for Haskell")
127 (description "This Haskell package provides a generic interface for
128 cryptographic operations (hashes, ciphers, randomness).
129
130 Maintainers of hash and cipher implementations are encouraged to add instances
131 for the classes defined in @code{Crypto.Classes}. @code{Crypto} users are
132 similarly encouraged to use the interfaces defined in the @code{Classes} module.
133
134 Any concepts or functions of general use to more than one cryptographic
135 algorithm (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
162 cipher operations using the crypto-api interface. Known answer tests (KATs)
163 for 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,
193 pure APIs, with performance close to the fastest implementations available in
194 other languages. The implementations are made in C with a haskell FFI wrapper
195 that 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
213 `(#:tests? #f)) ; tests require old version of ghc-hunit (0.9)
214 (native-inputs `(("ghc-base16-bytestring" ,ghc-base16-bytestring)
215 ("ghc-puremd5" ,ghc-puremd5)
216 ("ghc-tasty" ,ghc-tasty)
217 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
218 ("ghc-hunit" ,ghc-hunit)))
219 (home-page "https://github.com/hvr/cryptohash-md5")
220 (synopsis "MD5 implementation for Haskell")
221 (description "This Haskell package provides implementation of MD5.")
222 (license license:bsd-3)))
223
224 (define-public ghc-cryptohash-sha1
225 (package
226 (name "ghc-cryptohash-sha1")
227 (version "0.11.100.1")
228 (source
229 (origin
230 (method url-fetch)
231 (uri (string-append "https://hackage.haskell.org/package/"
232 "cryptohash-sha1-" version "/"
233 "cryptohash-sha1-" version ".tar.gz"))
234 (sha256
235 (base32
236 "1aqdxdhxhl9jldh951djpwxx8z7gzaqspxl7iwpl84i5ahrsyy9w"))))
237 (build-system haskell-build-system)
238 (arguments
239 `(#:tests? #f)) ; tests require old version of ghc-hunit (0.9)
240 (native-inputs `(("ghc-base16-bytestring" ,ghc-base16-bytestring)
241 ("ghc-sha" ,ghc-sha)
242 ("ghc-tasty" ,ghc-tasty)
243 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
244 ("ghc-hunit" ,ghc-hunit)))
245 (home-page "https://github.com/hvr/cryptohash-sha1")
246 (synopsis "SHA-1 implementation for Haskell")
247 (description "This Haskell package provides an incremental and one-pass,
248 pure API to the @uref{https://en.wikipedia.org/wiki/SHA-1, SHA-1 hash algorithm},
249 including @uref{https://en.wikipedia.org/wiki/HMAC, HMAC support}, with
250 performance close to the fastest implementations available in other languages.
251
252 The implementation is made in C with a haskell FFI wrapper that hides
253 the C implementation.")
254 (license license:bsd-3)))
255
256 (define-public ghc-cryptonite
257 (package
258 (name "ghc-cryptonite")
259 (version "0.25")
260 (source (origin
261 (method url-fetch)
262 (uri (string-append "https://hackage.haskell.org/package/"
263 "cryptonite/cryptonite-"
264 version ".tar.gz"))
265 (sha256
266 (base32
267 "131wbbdr5yavs5k1ah9sz6fqx1ffyvaxf66pwjzsfc47mwc1mgl9"))))
268 (build-system haskell-build-system)
269 (inputs
270 `(("ghc-basement" ,ghc-basement)
271 ("ghc-memory" ,ghc-memory)
272 ("ghc-byteable" ,ghc-byteable)))
273 (native-inputs
274 `(("ghc-tasty" ,ghc-tasty)
275 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
276 ("ghc-tasty-hunit" ,ghc-tasty-hunit)
277 ("ghc-tasty-kat" ,ghc-tasty-kat)))
278 (home-page "https://github.com/haskell-crypto/cryptonite")
279 (synopsis "Cryptography primitives")
280 (description
281 "This package is a repository of cryptographic primitives for Haskell.
282 It supports a wide range of symmetric ciphers, cryptographic hash functions,
283 public key algorithms, key derivation numbers, cryptographic random number
284 generators, and more.")
285 (license license:bsd-3)))
286
287 (define-public ghc-digest
288 (package
289 (name "ghc-digest")
290 (version "0.0.1.2")
291 (source
292 (origin
293 (method url-fetch)
294 (uri (string-append
295 "https://hackage.haskell.org/package/digest/digest-"
296 version
297 ".tar.gz"))
298 (sha256
299 (base32
300 "04gy2zp8yzvv7j9bdfvmfzcz3sqyqa6rwslqcn4vyair2vmif5v4"))))
301 (build-system haskell-build-system)
302 (inputs
303 `(("zlib" ,zlib)))
304 (home-page
305 "https://hackage.haskell.org/package/digest")
306 (synopsis
307 "Various cryptographic hashes for bytestrings")
308 (description
309 "This package provides efficient cryptographic hash implementations for
310 strict and lazy bytestrings. For now, CRC32 and Adler32 are supported; they
311 are implemented as FFI bindings to efficient code from zlib.")
312 (license license:bsd-3)))
313
314 (define-public ghc-entropy
315 (package
316 (name "ghc-entropy")
317 (version "0.4.1.1")
318 (source
319 (origin
320 (method url-fetch)
321 (uri (string-append "https://hackage.haskell.org/package/"
322 "entropy-" version "/"
323 "entropy-" version ".tar.gz"))
324 (sha256
325 (base32
326 "1ahz5g148l6sax3dy505na2513i99c7bxix68jja5kbx4f271zcf"))))
327 (build-system haskell-build-system)
328 (home-page "https://github.com/TomMD/entropy")
329 (synopsis "Provides platform independent entropy source for Haskell")
330 (description "This Haskell package provides a platform independent method
331 to obtain cryptographically strong entropy.")
332 (license license:bsd-3)))
333
334 (define-public ghc-pem
335 (package
336 (name "ghc-pem")
337 (version "0.2.2")
338 (source (origin
339 (method url-fetch)
340 (uri (string-append "https://hackage.haskell.org/package/"
341 "pem/pem-" version ".tar.gz"))
342 (sha256
343 (base32
344 "162sk5sg22w21wqz5qv8kx6ibxp99v5p20g3nknhm1kddk3hha1p"))))
345 (build-system haskell-build-system)
346 (inputs
347 `(("ghc-base64-bytestring" ,ghc-base64-bytestring)))
348 (native-inputs
349 `(("ghc-test-framework" ,ghc-test-framework)
350 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
351 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
352 ("ghc-hunit" ,ghc-hunit)
353 ("ghc-quickcheck" ,ghc-quickcheck)))
354 (home-page "https://github.com/vincenthz/hs-pem")
355 (synopsis "Privacy Enhanced Mail (PEM) format reader and writer")
356 (description
357 "This library provides readers and writers for the @dfn{Privacy Enhanced
358 Mail} (PEM) format.")
359 (license license:bsd-3)))
360
361 (define-public ghc-puremd5
362 (package
363 (name "ghc-puremd5")
364 (version "2.1.3")
365 (source
366 (origin
367 (method url-fetch)
368 (uri (string-append "https://hackage.haskell.org/package/"
369 "pureMD5-" version "/"
370 "pureMD5-" version ".tar.gz"))
371 (sha256
372 (base32
373 "0zdilz41cla2ck7mcw1a9702gyg2abq94mqahr4vci9sbs53bwxy"))))
374 (build-system haskell-build-system)
375 (inputs `(("ghc-cereal" ,ghc-cereal)
376 ("ghc-crypto-api" ,ghc-crypto-api)
377 ("ghc-tagged" ,ghc-tagged)))
378 (native-inputs `(("ghc-crypto-api-tests" ,ghc-crypto-api-tests)
379 ("ghc-quickcheck" ,ghc-quickcheck)
380 ("ghc-test-framework" ,ghc-test-framework)
381 ("ghc-test-framework-quickcheck2"
382 ,ghc-test-framework-quickcheck2)
383 ("ghc-pretty-hex" ,ghc-pretty-hex)))
384 (home-page "https://github.com/TomMD/pureMD5")
385 (synopsis "Haskell implementation of the MD5 hash algorithm")
386 (description "This package provides a Haskell-only implementation of
387 the MD5 digest (hash) algorithm. This now supports the @code{crypto-api} class
388 interface.")
389 (license license:bsd-3)))
390
391 (define-public ghc-sha
392 (package
393 (name "ghc-sha")
394 (version "1.6.4.4")
395 (source (origin
396 (method url-fetch)
397 (uri (string-append "https://hackage.haskell.org/package/"
398 "SHA/SHA-" version ".tar.gz"))
399 (sha256
400 (base32
401 "0i4b2wjisivdy72synal711ywhx05mfqfba5n65rk8qidggm1nbb"))))
402 (build-system haskell-build-system)
403 (native-inputs
404 `(("ghc-quickcheck" ,ghc-quickcheck)
405 ("ghc-test-framework" ,ghc-test-framework)
406 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)))
407 (home-page "https://hackage.haskell.org/package/SHA")
408 (synopsis "SHA suite of message digest functions")
409 (description
410 "This library implements the SHA suite of message digest functions,
411 according to NIST FIPS 180-2 (with the SHA-224 addendum), as well as the
412 SHA-based HMAC routines. The functions have been tested against most of the
413 NIST and RFC test vectors for the various functions. While some attention has
414 been paid to performance, these do not presently reach the speed of well-tuned
415 libraries, like OpenSSL.")
416 (license license:bsd-3)))
417
418 (define-public ghc-x509
419 (package
420 (name "ghc-x509")
421 (version "1.6.4")
422 (source (origin
423 (method url-fetch)
424 (uri (string-append "https://hackage.haskell.org/package/"
425 "x509/x509-" version ".tar.gz"))
426 (sha256
427 (base32
428 "0hixx76wpb4qxida017ka5zr6lrsycahrqyw8z90q9mxvndpy3my"))))
429 (build-system haskell-build-system)
430 (inputs
431 `(("ghc-memory" ,ghc-memory)
432 ("ghc-hourglass" ,ghc-hourglass)
433 ("ghc-pem" ,ghc-pem)
434 ("ghc-asn1-types" ,ghc-asn1-types)
435 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
436 ("ghc-asn1-parse" ,ghc-asn1-parse)
437 ("ghc-cryptonite" ,ghc-cryptonite)))
438 (native-inputs
439 `(("ghc-tasty" ,ghc-tasty)
440 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
441 (home-page "https://github.com/vincenthz/hs-certificate")
442 (synopsis "X509 reader and writer")
443 (description
444 "This library provides functions to read and write X509 certificates.")
445 (license license:bsd-3)))
446
447 (define-public ghc-x509-store
448 (package
449 (name "ghc-x509-store")
450 (version "1.6.2")
451 (source (origin
452 (method url-fetch)
453 (uri (string-append "https://hackage.haskell.org/package/"
454 "x509-store/x509-store-"
455 version ".tar.gz"))
456 (sha256
457 (base32
458 "0yw09nwkvr324qz4sc27c0p28bz2h6gns6lkaz9mz92mgqf2dza9"))))
459 (build-system haskell-build-system)
460 (inputs
461 `(("ghc-pem" ,ghc-pem)
462 ("ghc-asn1-types" ,ghc-asn1-types)
463 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
464 ("ghc-cryptonite" ,ghc-cryptonite)
465 ("ghc-x509" ,ghc-x509)))
466 (home-page "https://github.com/vincenthz/hs-certificate")
467 (synopsis "X.509 collection accessing and storing methods")
468 (description
469 "This package provides functions for accessing and storing X.509
470 collections, certificates, revocation lists, and exception lists.")
471 (license license:bsd-3)))
472
473 (define-public ghc-x509-validation
474 (package
475 (name "ghc-x509-validation")
476 (version "1.6.5")
477 (source (origin
478 (method url-fetch)
479 (uri (string-append "https://hackage.haskell.org/package/"
480 "x509-validation/x509-validation-"
481 version ".tar.gz"))
482 (sha256
483 (base32
484 "190w1sr3w6w49v3yvqz4grb0v09ym4gll3n8bxwijvbvcybk3xyi"))))
485 (build-system haskell-build-system)
486 (inputs
487 `(("ghc-memory" ,ghc-memory)
488 ("ghc-byteable" ,ghc-byteable)
489 ("ghc-hourglass" ,ghc-hourglass)
490 ("ghc-data-default-class" ,ghc-data-default-class)
491 ("ghc-pem" ,ghc-pem)
492 ("ghc-asn1-types" ,ghc-asn1-types)
493 ("ghc-asn1-encoding" ,ghc-asn1-encoding)
494 ("ghc-x509" ,ghc-x509)
495 ("ghc-x509-store" ,ghc-x509-store)
496 ("ghc-cryptonite" ,ghc-cryptonite)))
497 (home-page "https://github.com/vincenthz/hs-certificate")
498 (synopsis "X.509 certificate and revocation list validation")
499 (description
500 "This package provides functions for X.509 certificate and revocation
501 list validation.")
502 (license license:bsd-3)))
503
504 (define-public ghc-x509-system
505 (package
506 (name "ghc-x509-system")
507 (version "1.6.4")
508 (source (origin
509 (method url-fetch)
510 (uri (string-append "https://hackage.haskell.org/package/"
511 "x509-system/x509-system-"
512 version ".tar.gz"))
513 (sha256
514 (base32
515 "0k7zc0xp7r6kqmi39rpiicvq78xb0pr2cq6q5s3kmmsshllg13nr"))))
516 (build-system haskell-build-system)
517 (inputs
518 `(("ghc-pem" ,ghc-pem)
519 ("ghc-x509" ,ghc-x509)
520 ("ghc-x509-store" ,ghc-x509-store)))
521 (home-page "https://github.com/vincenthz/hs-certificate")
522 (synopsis "Handle system X.509 accessors and storage")
523 (description
524 "This package provides a library to handle system accessors and storage
525 for X.509 certificates.")
526 (license license:bsd-3)))
527
528 (define-public ghc-crypto-cipher-types
529 (package
530 (name "ghc-crypto-cipher-types")
531 (version "0.0.9")
532 (source
533 (origin
534 (method url-fetch)
535 (uri (string-append "https://hackage.haskell.org/package/"
536 "crypto-cipher-types-" version "/"
537 "crypto-cipher-types-" version ".tar.gz"))
538 (sha256
539 (base32
540 "03qa1i1kj07pfrxsi7fiaqnnd0vi94jd4jfswbmnm4gp1nvzcwr0"))))
541 (build-system haskell-build-system)
542 (inputs `(("ghc-byteable" ,ghc-byteable)
543 ("ghc-securemem" ,ghc-securemem)))
544 (home-page "https://github.com/vincenthz/hs-crypto-cipher")
545 (synopsis "Generic cryptography cipher types for Haskell")
546 (description "This Haskell package provides basic typeclasses and types
547 for symmetric ciphers.")
548 (license license:bsd-3)))
549
550 (define-public ghc-cipher-aes
551 (package
552 (name "ghc-cipher-aes")
553 (version "0.2.11")
554 (source
555 (origin
556 (method url-fetch)
557 (uri (string-append "https://hackage.haskell.org/package/"
558 "cipher-aes-" version "/"
559 "cipher-aes-" version ".tar.gz"))
560 (sha256
561 (base32
562 "05ahz6kjq0fl1w66gpiqy0vndli5yx1pbsbw9ni3viwqas4p3cfk"))))
563 (build-system haskell-build-system)
564 (inputs `(("ghc-byteable" ,ghc-byteable)
565 ("ghc-securemem" ,ghc-securemem)
566 ("ghc-crypto-cipher-types" ,ghc-crypto-cipher-types)))
567 (native-inputs `(("ghc-quickcheck" ,ghc-quickcheck)
568 ("ghc-test-framework" ,ghc-test-framework)
569 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
570 ("ghc-crypto-cipher-tests" ,ghc-crypto-cipher-tests)))
571 (home-page "https://github.com/vincenthz/hs-cipher-aes")
572 (synopsis "AES cipher implementation with advanced mode of operations for
573 Haskell")
574 (description "This Haskell package provides AES cipher implementation.
575
576 The modes of operations available are ECB (Electronic code book), CBC (Cipher
577 block chaining), CTR (Counter), XTS (XEX with ciphertext stealing),
578 GCM (Galois Counter Mode).
579
580 The AES implementation uses AES-NI when available (on x86 and x86-64
581 architecture), but fallback gracefully to a software C implementation.
582
583 The software implementation uses S-Boxes, which might suffer for cache timing
584 issues. However do notes that most other known software implementations,
585 including very popular one (openssl, gnutls) also uses similar
586 implementation. If it matters for your case, you should make sure you have
587 AES-NI available, or you'll need to use a different implementation.")
588 (license license:bsd-3)))
589
590 (define-public ghc-crypto-random
591 (package
592 (name "ghc-crypto-random")
593 (version "0.0.9")
594 (source
595 (origin
596 (method url-fetch)
597 (uri (string-append "https://hackage.haskell.org/package/"
598 "crypto-random-" version "/"
599 "crypto-random-" version ".tar.gz"))
600 (sha256
601 (base32
602 "0139kbbb2h7vshf68y3fvjda29lhj7jjwl4vq78w4y8k8hc7l2hp"))))
603 (build-system haskell-build-system)
604 (inputs `(("ghc-securemem" ,ghc-securemem)
605 ("ghc-vector" ,ghc-vector)))
606 (home-page "https://github.com/vincenthz/hs-crypto-random")
607 (synopsis "Simple cryptographic random related types for Haskell")
608 (description "Simple cryptographic random related types: a safe
609 abstraction for CPRNGs.")
610 (license license:bsd-3)))
611
612 (define-public ghc-cprng-aes
613 (package
614 (name "ghc-cprng-aes")
615 (version "0.6.1")
616 (source
617 (origin
618 (method url-fetch)
619 (uri (string-append "https://hackage.haskell.org/package/"
620 "cprng-aes-" version "/"
621 "cprng-aes-" version ".tar.gz"))
622 (sha256
623 (base32
624 "1wr15kbmk1g3l8a75n0iwbzqg24ixv78slwzwb2q6rlcvq0jlnb4"))))
625 (build-system haskell-build-system)
626 (inputs `(("ghc-byteable" ,ghc-byteable)
627 ("ghc-crypto-random" ,ghc-crypto-random)
628 ("ghc-cipher-aes" ,ghc-cipher-aes)))
629 (home-page "https://github.com/vincenthz/hs-cprng-aes")
630 (synopsis "Crypto Pseudo Random Number Generator using AES in counter mode
631 in Haskell")
632 (description "Simple crypto pseudo-random-number-generator with really
633 good randomness property.
634
635 Using ent, a randomness property maker on one 1Mb sample:
636
637 @itemize
638 @item Entropy = 7.999837 bits per byte.
639 @item Optimum compression would reduce the size of this 1048576 byte file by 0
640 percent.
641 @item Chi square distribution for 1048576 samples is 237.02.
642 @item Arithmbetic mean value of data bytes is 127.3422 (127.5 = random).
643 @item Monte Carlo value for Pi is 3.143589568 (error 0.06 percent).
644 @end itemize
645
646 Compared to urandom with the same sampling:
647
648 @itemize
649 @item Entropy = 7.999831 bits per byte.
650 @item Optimum compression would reduce the size of this 1048576 byte file by 0
651 percent.
652 @item Chi square distribution for 1048576 samples is 246.63.
653 @item Arithmetic mean value of data bytes is 127.6347 (127.5 = random).
654 @item Monte Carlo value for Pi is 3.132465868 (error 0.29 percent).
655 @end itemize")
656 (license license:bsd-3)))