haskell-crypto.scm 34 KB

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