gnu: Add rust-scrypt-0.3.
[jackhill/guix/guix.git] / gnu / packages / crypto.scm
CommitLineData
80b77646
DT
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 David Thompson <davet@gnu.org>
8543ccf8 3;;; Copyright © 2015, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
cc6731e9 4;;; Copyright © 2016, 2017, 2018, 2019 Leo Famulari <leo@famulari.name>
893d963a 5;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox>
95f2071a 6;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
3c986a7d 7;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
c2ab3b84 8;;; Copyright © 2016, 2017, 2019 Eric Bavier <bavier@member.fsf.org>
de98f4ed 9;;; Copyright © 2017 Pierre Langlois <pierre.langlois@gmx.com>
fa58a0a6 10;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
a21eb019 11;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
84be0e9a 12;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
20b49f47 13;;; Copyright © 2018, 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
6a6e5d84
PN
14;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
15;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
bfaa0617 16;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
a51c9c90 17;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
bbeb710d 18;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
80b77646
DT
19;;;
20;;; This file is part of GNU Guix.
21;;;
22;;; GNU Guix is free software; you can redistribute it and/or modify it
23;;; under the terms of the GNU General Public License as published by
24;;; the Free Software Foundation; either version 3 of the License, or (at
25;;; your option) any later version.
26;;;
27;;; GNU Guix is distributed in the hope that it will be useful, but
28;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30;;; GNU General Public License for more details.
31;;;
32;;; You should have received a copy of the GNU General Public License
33;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35(define-module (gnu packages crypto)
36 #:use-module (gnu packages)
2e3f1851
EB
37 #:use-module (gnu packages admin)
38 #:use-module (gnu packages aidc)
b6f87ec0 39 #:use-module (gnu packages attr)
893d963a 40 #:use-module (gnu packages autotools)
fb8a5d63 41 #:use-module (gnu packages boost)
47de00af 42 #:use-module (gnu packages check)
de98f4ed 43 #:use-module (gnu packages compression)
2e3f1851 44 #:use-module (gnu packages cryptsetup)
fb8a5d63 45 #:use-module (gnu packages gettext)
2e3f1851
EB
46 #:use-module (gnu packages gnupg)
47 #:use-module (gnu packages image)
8a68b71d 48 #:use-module (gnu packages kerberos)
f1876bfc 49 #:use-module (gnu packages libbsd)
0751fddd 50 #:use-module (gnu packages libffi)
fb8a5d63 51 #:use-module (gnu packages linux)
417df5bb 52 #:use-module (gnu packages lsof)
893d963a
LG
53 #:use-module (gnu packages nettle)
54 #:use-module (gnu packages password-utils)
fb8a5d63 55 #:use-module (gnu packages perl)
5ccde207 56 #:use-module (gnu packages perl-check)
b6beda1d
LF
57 #:use-module (gnu packages pkg-config)
58 #:use-module (gnu packages python)
44d10b1f 59 #:use-module (gnu packages python-xyz)
893d963a 60 #:use-module (gnu packages readline)
2e3f1851 61 #:use-module (gnu packages search)
893d963a 62 #:use-module (gnu packages serialization)
19b2ea1b 63 #:use-module (gnu packages shells)
cd0322a3 64 #:use-module (gnu packages sqlite)
b6f87ec0 65 #:use-module (gnu packages tcl)
893d963a 66 #:use-module (gnu packages tls)
b6f87ec0 67 #:use-module (gnu packages xml)
7fb18f57 68 #:use-module ((guix licenses) #:prefix license:)
80b77646
DT
69 #:use-module (guix packages)
70 #:use-module (guix download)
6fabb196 71 #:use-module (guix git-download)
b6f87ec0 72 #:use-module (guix build-system cmake)
09c36743 73 #:use-module (guix build-system gnu)
fa58a0a6 74 #:use-module (guix build-system perl)
3ca6c1a7 75 #:use-module (guix utils)
fa58a0a6
EF
76 #:use-module (srfi srfi-1)
77 #:use-module (srfi srfi-26))
80b77646
DT
78
79(define-public libsodium
80 (package
81 (name "libsodium")
3c75c66c 82 (version "1.0.18")
80b77646
DT
83 (source (origin
84 (method url-fetch)
4150ac88 85 (uri (list (string-append
bee98a9f 86 "https://download.libsodium.org/libsodium/"
4150ac88
LF
87 "releases/libsodium-" version ".tar.gz")
88 (string-append
89 "https://download.libsodium.org/libsodium/"
90 "releases/old/libsodium-" version ".tar.gz")))
80b77646
DT
91 (sha256
92 (base32
3c75c66c 93 "1h9ncvj23qbbni958knzsli8dvybcswcjbx0qjjgi922nf848l3g"))))
80b77646
DT
94 (build-system gnu-build-system)
95 (synopsis "Portable NaCl-based crypto library")
96 (description
35b9e423 97 "Sodium is a new easy-to-use high-speed software library for network
80b77646 98communication, encryption, decryption, signatures, etc.")
7fb18f57 99 (license license:isc)
bee98a9f 100 (home-page "https://libsodium.org")))
f1876bfc 101
32977915
CB
102(define-public libmd
103 (package
104 (name "libmd")
3743e117 105 (version "1.0.1")
32977915
CB
106 (source (origin
107 (method url-fetch)
f1d7e14a
MB
108 (uri
109 (list
110 (string-append "https://archive.hadrons.org/software/libmd/libmd-"
111 version ".tar.xz")
112 (string-append "https://libbsd.freedesktop.org/releases/libmd-"
113 version ".tar.xz")))
32977915
CB
114 (sha256
115 (base32
3743e117 116 "0waclg2d5qin3r26gy5jvy4584ik60njc8pqbzwk0lzq3j9ynkp1"))))
32977915
CB
117 (build-system gnu-build-system)
118 (synopsis "Message Digest functions from BSD systems")
119 (description
120 "The currently provided message digest algorithms are:
121@itemize
122@item MD2
123@item MD4
124@item MD5
125@item RIPEMD-160
126@item SHA-1
127@item SHA-2 (SHA-256, SHA-384 and SHA-512)
128@end itemize")
129 (license (list license:bsd-3
130 license:bsd-2
131 license:isc
132 license:public-domain))
133 (home-page "https://www.hadrons.org/software/libmd/")))
134
f1876bfc
LF
135(define-public signify
136 (package
137 (name "signify")
519dc88c 138 (version "29")
a5006ede 139 (home-page "https://github.com/aperezdc/signify")
f1876bfc 140 (source (origin
b23579d0
MB
141 (method url-fetch)
142 (uri (string-append "https://github.com/aperezdc/signify/releases"
143 "/download/v" version "/signify-" version ".tar.xz"))
f1876bfc
LF
144 (sha256
145 (base32
519dc88c 146 "1bzcax5kb4lr0rmpmrdpq5q0iq6b2dxzpl56li8aanbkck1c7hd9"))))
f1876bfc
LF
147 (build-system gnu-build-system)
148 ;; TODO Build with libwaive (described in README.md), to implement something
149 ;; like OpenBSD's pledge().
150 (arguments
2296e630 151 `(#:make-flags
f1876bfc
LF
152 (list "CC=gcc"
153 (string-append "PREFIX=" (assoc-ref %outputs "out")))
154 #:phases
155 (modify-phases %standard-phases
156 (delete 'configure))))
157 (native-inputs
158 `(("pkg-config" ,pkg-config)))
159 (inputs
160 `(("libbsd" ,libbsd)))
161 (synopsis "Create and verify cryptographic signatures")
162 (description "The signify utility creates and verifies cryptographic
163signatures using the elliptic curve Ed25519. This is a Linux port of the
164OpenBSD tool of the same name.")
f1876bfc
LF
165 ;; This package includes third-party code that was originally released under
166 ;; various non-copyleft licenses. See the source files for clarification.
7fb18f57
TGR
167 (license (list license:bsd-3 license:bsd-4 license:expat license:isc
168 license:public-domain (license:non-copyleft
169 "file://base64.c"
170 "See base64.c in the distribution for
171 the license from IBM.")))))
893d963a 172
fb8a5d63
TGR
173(define-public encfs
174 (package
175 (name "encfs")
47de00af 176 (version "1.9.5")
fb8a5d63
TGR
177 (source
178 (origin
179 (method url-fetch)
180 (uri
181 (string-append "https://github.com/vgough/encfs/releases/download/v"
182 version "/encfs-" version ".tar.gz"))
183 (sha256
184 (base32
47de00af 185 "0qzxavvv20577bxvly8s7d3y7bqasqclc2mllp0ddfncjm9z02a7"))
b6f87ec0
TGR
186 (modules '((guix build utils)))
187 ;; Remove bundled dependencies in favour of proper inputs.
6cbee49d
MW
188 (snippet '(begin
189 (for-each delete-file-recursively
47de00af
PN
190 '("vendor/github.com/leethomason/tinyxml2"
191 "vendor/github.com/google/googletest"))
6cbee49d 192 #t))))
b6f87ec0 193 (build-system cmake-build-system)
fb8a5d63 194 (native-inputs
79355ae3 195 `(("gettext" ,gettext-minimal)
b6f87ec0
TGR
196
197 ;; Test dependencies.
198 ("expect" ,expect)
47de00af 199 ("googletest-source" ,(package-source googletest))
b6f87ec0 200 ("perl" ,perl)))
fb8a5d63 201 (inputs
b6f87ec0 202 `(("attr" ,attr)
fb8a5d63
TGR
203 ("fuse" ,fuse)
204 ("openssl" ,openssl)
b6f87ec0
TGR
205 ("tinyxml2" ,tinyxml2)))
206 (arguments
47de00af
PN
207 `(#:configure-flags (list "-DUSE_INTERNAL_TINYXML=OFF")
208 #:phases
209 (modify-phases %standard-phases
210 (add-after 'unpack 'unpack-googletest
211 (lambda* (#:key inputs #:allow-other-keys)
212 (mkdir-p "vendor/github.com/google/googletest")
d5640c58
EF
213 (copy-recursively (assoc-ref inputs "googletest-source")
214 "vendor/github.com/google/googletest")
215 #t))
1df92455
MB
216 (add-before 'configure 'patch-CMakeLists.txt
217 (lambda _
218 ;; Prevent CMake from adding libc on the system include path.
219 ;; Otherwise it will interfere with the libc used by GCC and
220 ;; ultimately cause #include_next errors.
221 (substitute* "CMakeLists.txt"
222 (("include_directories \\(SYSTEM \\$\\{Intl_INCLUDE_DIRS\\}\\)")
223 ""))
224 #t))
47de00af
PN
225 (add-before 'check 'make-unittests
226 (lambda _
227 (invoke "make" "unittests"))))))
fb8a5d63
TGR
228 (home-page "https://vgough.github.io/encfs")
229 (synopsis "Encrypted virtual file system")
230 (description
231 "EncFS creates a virtual encrypted file system in user-space. Each file
232created under an EncFS mount point is stored as a separate encrypted file on
233the underlying file system. Like most encrypted file systems, EncFS is meant
234to provide security against off-line attacks, such as a drive falling into
235the wrong hands.")
b6f87ec0
TGR
236 (license (list license:expat ; internal/easylogging++.h
237 license:lgpl3+ ; encfs library
238 license:gpl3+)))) ; command-line tools
279d902b
TGR
239
240(define-public keyutils
241 (package
242 (name "keyutils")
95f2071a 243 (version "1.6.1")
279d902b
TGR
244 (source
245 (origin
246 (method url-fetch)
247 (uri
248 (string-append "https://people.redhat.com/dhowells/keyutils/keyutils-"
249 version ".tar.bz2"))
250 (sha256
95f2071a 251 (base32 "1kk4pmyflgplkgxn2bzpc069ph9c9jdd9ikcsyd5pnaimqi5gcf8"))
279d902b 252 (modules '((guix build utils)))
8a68b71d 253 ;; Create relative symbolic links instead of absolute ones to /lib/*.
6cbee49d
MW
254 (snippet '(begin
255 (substitute* "Makefile" (("\\$\\(LNS\\) \\$\\(LIBDIR\\)/")
256 "$(LNS) "))
257 #t))))
279d902b
TGR
258 (build-system gnu-build-system)
259 (arguments
260 `(#:phases (modify-phases %standard-phases
261 (delete 'configure)) ; no configure script
262 #:make-flags (list "CC=gcc"
263 "RPATH=-Wl,-rpath,$(DESTDIR)$(LIBDIR)"
264 (string-append "DESTDIR="
265 (assoc-ref %outputs "out"))
266 "INCLUDEDIR=/include"
267 "LIBDIR=/lib"
268 "MANDIR=/share/man"
269 "SHAREDIR=/share/keyutils")
270 #:test-target "test"))
8a68b71d
TGR
271 (inputs
272 `(("mit-krb5" ,mit-krb5)))
279d902b 273 (home-page "https://people.redhat.com/dhowells/keyutils/")
5b63a856 274 (synopsis "Linux key management utilities")
279d902b
TGR
275 (description
276 "Keyutils is a set of utilities for managing the key retention facility in
277the Linux kernel, which can be used by file systems, block devices, and more to
278gain and retain the authorization and encryption keys required to perform
279secure operations. ")
280 (license (list license:lgpl2.1+ ; the files keyutils.*
281 license:gpl2+)))) ; the rest
6fabb196 282
283;; There is no release candidate but commits point out a version number,
284;; furthermore no tarball exists.
285(define-public eschalot
286 (let ((commit "0bf31d88a11898c19b1ed25ddd2aff7b35dbac44")
287 (revision "1"))
288 (package
289 (name "eschalot")
290 (version (string-append "1.2.0-" revision "." (string-take commit 7)))
291 (source
292 (origin
293 (method git-fetch)
294 (uri (git-reference
295 (url "https://github.com/schnabear/eschalot")
296 (commit commit)))
297 (file-name (string-append name "-" version))
298 (sha256
299 (base32
300 "0lj38ldh8vzi11wp4ghw4k0fkwp0s04zv8k8d473p1snmbh7mx98"))))
301 (inputs
302 `(("openssl" ,openssl))) ; It needs: openssl/{bn,pem,rsa,sha}.h
303 (build-system gnu-build-system)
304 (arguments
305 `(#:make-flags (list "CC=gcc"
306 (string-append "PREFIX=" (assoc-ref %outputs "out"))
307 (string-append "INSTALL=" "install"))
308 ;; XXX: make test would run a !VERY! long hashing of names with the use
309 ;; of a wordlist, the amount of computing time this would waste on build
310 ;; servers is in no relation to the size or importance of this small
311 ;; application, therefore we run our own tests on eschalot and worgen.
312 #:phases
313 (modify-phases %standard-phases
314 (delete 'configure)
315 (replace 'check
316 (lambda _
8543ccf8
RW
317 (invoke "./worgen" "8-12" "top1000.txt" "3-10" "top400nouns.txt"
318 "3-6" "top150adjectives.txt" "3-6")
319 (invoke "./eschalot" "-r" "^guix|^guixsd")
320 (invoke "./eschalot" "-r" "^gnu|^free")
321 (invoke "./eschalot" "-r" "^cyber|^hack")
322 (invoke "./eschalot" "-r" "^troll")))
6fabb196 323 ;; Make install can not create the bin dir, create it.
324 (add-before 'install 'create-bin-dir
325 (lambda* (#:key outputs #:allow-other-keys)
326 (let* ((out (assoc-ref outputs "out"))
327 (bin (string-append out "/bin")))
328 (mkdir-p bin)
329 #t))))))
330 (home-page "https://github.com/schnabear/eschalot")
331 (synopsis "Tor hidden service name generator")
332 (description
333 "Eschalot is a tor hidden service name generator, it allows one to
334produce customized vanity .onion addresses using a brute-force method. Searches
335for valid names can be run with regular expressions and wordlists. For the
336generation of wordlists the included tool @code{worgen} can be used. There is
337no man page, refer to the home page for usage details.")
338 (license (list license:isc license:expat)))))
2e3f1851
EB
339
340(define-public tomb
341 (package
342 (name "tomb")
4535eb91 343 (version "2.7")
2e3f1851
EB
344 (source (origin
345 (method url-fetch)
346 (uri (string-append "https://files.dyne.org/tomb/"
8ca2cb58 347 "Tomb-" version ".tar.gz"))
2e3f1851
EB
348 (sha256
349 (base32
4535eb91
EB
350 "0x3al02796vx1cvy6y6h685c367qx70dwv471g0hmks2gr10f0cn"))
351 (patches (search-patches "tomb-fix-errors-on-open.patch"))))
2e3f1851 352 (build-system gnu-build-system)
d56c55ff 353 (native-inputs `(("sudo" ,sudo))) ;presence needed for 'check' phase
2e3f1851
EB
354 (inputs
355 `(("zsh" ,zsh)
2e3f1851
EB
356 ("gnupg" ,gnupg)
357 ("cryptsetup" ,cryptsetup)
358 ("e2fsprogs" ,e2fsprogs) ;for mkfs.ext4
7c90d0f4 359 ("gettext" ,gettext-minimal) ;used at runtime
417df5bb 360 ("lsof" ,lsof)
2e3f1851
EB
361 ("mlocate" ,mlocate)
362 ("pinentry" ,pinentry)
363 ("qrencode" ,qrencode)
1a16b925
TGR
364 ("steghide" ,steghide)
365 ("util-linux" ,util-linux)))
2e3f1851
EB
366 (arguments
367 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
257e6304
EB
368 ;; The "sudo" input is needed only to satisfy dependency checks in the
369 ;; 'check' phase. The "sudo" used at runtime should come from the
370 ;; system's setuid-programs, so ensure no reference is kept.
371 #:disallowed-references (,sudo)
2e3f1851
EB
372 ;; TODO: Build and install gtk and qt trays
373 #:phases
374 (modify-phases %standard-phases
1b7395b1 375 (delete 'configure) ;no configuration to be done
2e3f1851
EB
376 (add-after 'install 'i18n
377 (lambda* (#:key make-flags #:allow-other-keys)
635dd0cc
TGR
378 (apply invoke "make" "-C" "extras/translations"
379 "install" make-flags)
380 #t))
2e3f1851
EB
381 (add-after 'install 'wrap
382 (lambda* (#:key inputs outputs #:allow-other-keys)
383 (let ((out (assoc-ref outputs "out")))
384 (wrap-program (string-append out "/bin/tomb")
385 `("PATH" ":" prefix
386 (,(string-append (assoc-ref inputs "mlocate") "/bin")
387 ,@(map (lambda (program)
388 (or (and=> (which program) dirname)
389 (error "program not found:" program)))
257e6304 390 '("seq" "mkfs.ext4" "pinentry"
417df5bb 391 "gpg" "cryptsetup" "gettext" "lsof"
1a16b925 392 "qrencode" "steghide" "findmnt")))))
2e3f1851
EB
393 #t)))
394 (delete 'check)
395 (add-after 'wrap 'check
396 (lambda* (#:key outputs #:allow-other-keys)
397 ;; Running the full tests requires sudo/root access for
398 ;; cryptsetup, which is not available in the build environment.
399 ;; But we can run `tomb dig` without root, so make sure that
400 ;; works. TODO: It Would Be Nice to check the expected "index",
401 ;; "search", "bury", and "exhume" features are available by
402 ;; querying `tomb -h`.
403 (let ((tomb (string-append (assoc-ref outputs "out")
404 "/bin/tomb")))
635dd0cc
TGR
405 (invoke tomb "dig" "-s" "10" "secrets.tomb")
406 #t))))))
9539016e 407 (home-page "https://www.dyne.org/software/tomb")
2e3f1851
EB
408 (synopsis "File encryption for secret data")
409 (description
410 "Tomb is an application to manage the creation and access of encrypted
411storage files: it can be operated from commandline and it can integrate with a
412user's graphical desktop.")
413 (license license:gpl3+)))
9381a02a
LF
414
415(define-public scrypt
416 (package
417 (name "scrypt")
6c067a3f 418 (version "1.2.1")
9381a02a
LF
419 (source
420 (origin
421 (method url-fetch)
422 (uri (string-append "https://www.tarsnap.com/scrypt/scrypt-"
423 version ".tgz"))
424 (sha256
425 (base32
6c067a3f 426 "0xy5yhrwwv13skv9im9vm76rybh9f29j2dh4hlh2x01gvbkza8a6"))))
9381a02a
LF
427 (build-system gnu-build-system)
428 (arguments
429 `(#:phases (modify-phases %standard-phases
430 (add-after 'unpack 'patch-command-invocations
431 (lambda _
432 (substitute* "Makefile.in"
433 (("command -p") ""))
434 #t))
435 (add-after 'install 'install-docs
436 (lambda* (#:key outputs #:allow-other-keys)
437 (let* ((out (assoc-ref %outputs "out"))
438 (misc (string-append out "/share/doc/scrypt")))
439 (install-file "FORMAT" misc)
440 #t))))))
441 (inputs
442 `(("openssl" ,openssl)))
443 (home-page "https://www.tarsnap.com/scrypt.html")
444 (synopsis "Memory-hard encryption tool based on scrypt")
f5304488 445 (description "This package provides a simple password-based encryption
9381a02a
LF
446utility as a demonstration of the @code{scrypt} key derivation function.
447@code{Scrypt} is designed to be far more resistant against hardware brute-force
448attacks than alternative functions such as @code{PBKDF2} or @code{bcrypt}.")
449 (license license:bsd-2)))
09c36743 450
84be0e9a
NG
451(define-public libscrypt
452 (package
453 (name "libscrypt")
454 (version "1.21")
455 (source
456 (origin
457 (method git-fetch)
458 (uri (git-reference
459 (url "https://github.com/technion/libscrypt.git")
460 (commit (string-append "v" version))))
461 (file-name (git-file-name name version))
462 (sha256
463 (base32
464 "1d76ys6cp7fi4ng1w3mz2l0p9dbr7ljbk33dcywyimzjz8bahdng"))))
465 (build-system gnu-build-system)
466 (arguments
467 `(#:make-flags (list (string-append "PREFIX=" %output)
468 "CC=gcc")
469 #:phases
470 (modify-phases %standard-phases
471 (delete 'configure))))
472 (home-page "https://lolware.net/libscrypt.html")
473 (synopsis "Password hashing library")
474 (description "@code{libscrypt} implements @code{scrypt} key derivation
475function. It is designed to be far more secure against hardware brute-force
476attacks than alternative functions such as @code{PBKDF2} or @code{bcrypt}.")
477 (license license:bsd-3)))
478
d96e162a
RW
479(define-public perl-math-random-isaac-xs
480 (package
481 (name "perl-math-random-isaac-xs")
482 (version "1.004")
483 (source
484 (origin
485 (method url-fetch)
486 (uri (string-append "mirror://cpan/authors/id/J/JA/JAWNSY/"
487 "Math-Random-ISAAC-XS-" version ".tar.gz"))
488 (sha256
489 (base32
490 "0yxqqcqvj51fn7b7j5xqhz65v74arzgainn66c6k7inijbmr1xws"))))
491 (build-system perl-build-system)
492 (native-inputs
493 `(("perl-module-build" ,perl-module-build)
494 ("perl-test-nowarnings" ,perl-test-nowarnings)))
9aba9b12 495 (home-page "https://metacpan.org/release/Math-Random-ISAAC-XS")
d96e162a
RW
496 (synopsis "C implementation of the ISAAC PRNG algorithm")
497 (description "ISAAC (Indirection, Shift, Accumulate, Add, and Count) is a
498fast pseudo-random number generator. It is suitable for applications where a
499significant amount of random data needs to be produced quickly, such as
500solving using the Monte Carlo method or for games. The results are uniformly
501distributed, unbiased, and unpredictable unless you know the seed.
502
503This package implements the same interface as @code{Math::Random::ISAAC}.")
504 (license license:public-domain)))
649238cb
RW
505
506(define-public perl-math-random-isaac
507 (package
508 (name "perl-math-random-isaac")
509 (version "1.004")
510 (source
511 (origin
512 (method url-fetch)
513 (uri (string-append "mirror://cpan/authors/id/J/JA/JAWNSY/"
514 "Math-Random-ISAAC-" version ".tar.gz"))
515 (sha256
516 (base32
517 "0z1b3xbb3xz71h25fg6jgsccra7migq7s0vawx2rfzi0pwpz0wr7"))))
518 (build-system perl-build-system)
519 (native-inputs
520 `(("perl-test-nowarnings" ,perl-test-nowarnings)))
521 (propagated-inputs
522 `(("perl-math-random-isaac-xs" ,perl-math-random-isaac-xs)))
9aba9b12 523 (home-page "https://metacpan.org/release/Math-Random-ISAAC")
649238cb
RW
524 (synopsis "Perl interface to the ISAAC PRNG algorithm")
525 (description "ISAAC (Indirection, Shift, Accumulate, Add, and Count) is a
526fast pseudo-random number generator. It is suitable for applications where a
527significant amount of random data needs to be produced quickly, such as
528solving using the Monte Carlo method or for games. The results are uniformly
529distributed, unbiased, and unpredictable unless you know the seed.
530
531This package provides a Perl interface to the ISAAC pseudo random number
532generator.")
533 (license license:public-domain)))
2023b79f
RW
534
535(define-public perl-crypt-random-source
536 (package
537 (name "perl-crypt-random-source")
9a40a621 538 (version "0.14")
2023b79f
RW
539 (source
540 (origin
541 (method url-fetch)
542 (uri (string-append "mirror://cpan/authors/id/E/ET/ETHER/"
543 "Crypt-Random-Source-" version ".tar.gz"))
544 (sha256
9a40a621 545 (base32 "1rpdds3sy5l1fhngnkrsgwsmwd54wpicx3i9ds69blcskwkcwkpc"))))
2023b79f
RW
546 (build-system perl-build-system)
547 (native-inputs
548 `(("perl-module-build-tiny" ,perl-module-build-tiny)
9a40a621 549 ("perl-test-fatal" ,perl-test-fatal)))
2023b79f
RW
550 (propagated-inputs
551 `(("perl-capture-tiny" ,perl-capture-tiny)
552 ("perl-module-find" ,perl-module-find)
553 ("perl-module-runtime" ,perl-module-runtime)
554 ("perl-moo" ,perl-moo)
555 ("perl-namespace-clean" ,perl-namespace-clean)
556 ("perl-sub-exporter" ,perl-sub-exporter)
557 ("perl-type-tiny" ,perl-type-tiny)))
9aba9b12 558 (home-page "https://metacpan.org/release/Crypt-Random-Source")
2023b79f
RW
559 (synopsis "Get weak or strong random data from pluggable sources")
560 (description "This module provides implementations for a number of
561byte-oriented sources of random data.")
8cb537ac 562 (license license:perl-license)))
233f4f43
RW
563
564(define-public perl-math-random-secure
565 (package
566 (name "perl-math-random-secure")
567 (version "0.080001")
568 (source
569 (origin
570 (method url-fetch)
571 (uri (string-append "mirror://cpan/authors/id/F/FR/FREW/"
572 "Math-Random-Secure-" version ".tar.gz"))
573 (sha256
574 (base32
575 "0dgbf4ncll4kmgkyb9fsaxn0vf2smc9dmwqzgh3259zc2zla995z"))))
576 (build-system perl-build-system)
577 (native-inputs
578 `(("perl-list-moreutils" ,perl-list-moreutils)
579 ("perl-test-leaktrace" ,perl-test-leaktrace)
580 ("perl-test-sharedfork" ,perl-test-sharedfork)
581 ("perl-test-warn" ,perl-test-warn)))
582 (inputs
583 `(("perl-crypt-random-source" ,perl-crypt-random-source)
584 ("perl-math-random-isaac" ,perl-math-random-isaac)
585 ("perl-math-random-isaac-xs" ,perl-math-random-isaac-xs)
586 ("perl-moo" ,perl-moo)))
9aba9b12 587 (home-page "https://metacpan.org/release/Math-Random-Secure")
233f4f43
RW
588 (synopsis "Cryptographically secure replacement for rand()")
589 (description "This module is intended to provide a
590cryptographically-secure replacement for Perl's built-in @code{rand} function.
591\"Crytographically secure\", in this case, means:
592
593@enumerate
594@item No matter how many numbers you see generated by the random number
595generator, you cannot guess the future numbers, and you cannot guess the seed.
596@item There are so many possible seeds that it would take decades, centuries,
8d0d1447 597or millennia for an attacker to try them all.
233f4f43
RW
598@item The seed comes from a source that generates relatively strong random
599data on your platform, so the seed itself will be as random as possible.
600@end enumerate\n")
601 (license license:artistic2.0)))
f0f6f9f6 602
de98f4ed
PL
603(define-public crypto++
604 (package
605 (name "crypto++")
7039b199 606 (version "8.2.0")
de98f4ed
PL
607 (source (origin
608 (method url-fetch/zipbomb)
609 (uri (string-append "https://cryptopp.com/cryptopp"
610 (string-join (string-split version #\.) "")
611 ".zip"))
612 (sha256
613 (base32
7039b199 614 "0n40hlz5jkvlcp9vxrj0fsrcfp7dm0zmmv6h52dx3f8i5qjf5w03"))))
de98f4ed
PL
615 (build-system gnu-build-system)
616 (arguments
617 `(#:make-flags
35ac66ee
PN
618 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
619 ;; Override "/sbin/ldconfig" with simply "echo" since
620 ;; we don't need ldconfig(8).
621 "LDCONF=echo")
de98f4ed
PL
622 #:phases
623 (modify-phases %standard-phases
c300cae6
TGR
624 (add-after 'unpack 'disable-native-optimisation
625 ;; This package installs more than just headers. Ensure that the
626 ;; cryptest.exe binary & static library aren't CPU model specific.
627 (lambda _
628 (substitute* "GNUmakefile"
629 ((" -march=native") ""))
630 #t))
35ac66ee 631 (delete 'configure)
bfa3caa2
TGR
632 (replace 'build
633 ;; By default, only the static library is built.
634 (lambda* (#:key (make-flags '()) #:allow-other-keys)
635 (apply invoke "make" "shared"
636 "-j" (number->string (parallel-job-count))
637 make-flags)))
f92ebd57
TGR
638 (add-after 'install 'install-shared-library-links
639 ;; By default, only .so and .so.x.y.z are installed.
640 ;; Create all the ‘intermediates’ expected by dependent packages.
641 (lambda* (#:key outputs #:allow-other-keys)
642 (let* ((out (assoc-ref outputs "out"))
3ca6c1a7
TGR
643 (lib (string-append out "/lib"))
644 (prefix "libcryptopp.so.")
645 (target (string-append prefix ,version)))
f92ebd57 646 (with-directory-excursion lib
3ca6c1a7
TGR
647 (symlink target
648 (string-append prefix ,(version-major+minor version)))
649 (symlink target
650 (string-append prefix ,(version-major version)))
f92ebd57 651 #t))))
35ac66ee
PN
652 (add-after 'install 'install-pkg-config
653 (lambda* (#:key outputs #:allow-other-keys)
654 (let* ((out (assoc-ref outputs "out"))
655 (pkg-dir (string-append out "/lib/pkgconfig")))
656 (mkdir-p pkg-dir)
657 (with-output-to-file (string-append pkg-dir "/libcrypto++.pc")
658 (lambda _
659 (display
660 (string-append
661 "prefix=" out "\n"
662 "libdir=" out "/lib\n"
663 "includedir=" out "/include\n\n"
664 "Name: libcrypto++-" ,version "\n"
665 "Description: Class library of cryptographic schemes"
666 "Version: " ,version "\n"
667 "Libs: -L${libdir} -lcryptopp\n"
e54b381d
TGR
668 "Cflags: -I${includedir}\n"))
669 #t))))))))
de98f4ed
PL
670 (native-inputs
671 `(("unzip" ,unzip)))
672 (home-page "https://cryptopp.com/")
673 (synopsis "C++ class library of cryptographic schemes")
674 (description "Crypto++ is a C++ class library of cryptographic schemes.")
675 ;; The compilation is distributed under the Boost license; the individual
676 ;; files in the compilation are in the public domain.
677 (license (list license:boost1.0 license:public-domain))))
60e95297 678
c6220b13 679(define-public libb2
e9997e47
MB
680 (package
681 (name "libb2")
f2096f4a 682 (version "0.98.1")
e9997e47
MB
683 (source (origin
684 (method url-fetch)
685 (uri (string-append
686 "https://github.com/BLAKE2/libb2/releases/download/v"
687 version "/libb2-" version ".tar.gz"))
688 (sha256
689 (base32
f2096f4a 690 "0bn7yrzdixdvzm46shbhpkqbr6zyqyxiqn7a7x54ag3mrvfnyqjk"))))
e9997e47
MB
691 (build-system gnu-build-system)
692 (arguments
693 `(#:configure-flags
694 (list
695 ,@(if (any (cute string-prefix? <> (or (%current-system)
696 (%current-target-system)))
697 '("x86_64" "i686"))
698 ;; fat only checks for Intel optimisations
699 '("--enable-fat")
700 '())
701 "--disable-native"))) ;don't optimise at build time
702 (home-page "https://blake2.net/")
703 (synopsis "Library implementing the BLAKE2 family of hash functions")
704 (description
705 "libb2 is a portable implementation of the BLAKE2 family of cryptographic
c6220b13
TGR
706hash functions. It includes optimised implementations for IA-32 and AMD64
707processors, and an interface layer that automatically selects the best
708implementation for the processor it is run on.
709
710@dfn{BLAKE2} (RFC 7693) is a family of high-speed cryptographic hash functions
711that are faster than MD5, SHA-1, SHA-2, and SHA-3, yet are at least as secure
712as the latest standard, SHA-3. It is an improved version of the SHA-3 finalist
713BLAKE.")
e9997e47 714 (license license:public-domain)))
a21eb019
AI
715
716(define-public rhash
717 (package
718 (name "rhash")
23c883ef 719 (version "1.3.9")
a21eb019
AI
720 (source
721 (origin
26edcd9b
MB
722 (method url-fetch)
723 (uri (string-append "mirror://sourceforge/rhash/rhash/" version
724 "/rhash-" version "-src.tar.gz"))
725 (file-name (string-append "rhash-" version ".tar.gz"))
a21eb019
AI
726 (sha256
727 (base32
26edcd9b 728 "1xn9fqa6rlnhsbgami45g82dlw9i1skg2sri3ydiinwak5ph1ca2"))))
a21eb019
AI
729 (build-system gnu-build-system)
730 (arguments
d2a4020a
MB
731 `(#:configure-flags
732 (list (string-append "--prefix=" (assoc-ref %outputs "out"))
733 ,@(let ((target (%current-target-system)))
734 (if target
735 `((string-append "--target=" ,target)
736 (string-append "--cc="
737 (assoc-ref %build-inputs "cross-gcc")
738 "/bin/" ,target "-gcc"))
739 '())))
740 #:make-flags
53bed209
TGR
741 ;; The binaries in /bin need some help finding librhash.so.0.
742 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
743 #:test-target "test" ; ‘make check’ just checks the sources
a21eb019
AI
744 #:phases
745 (modify-phases %standard-phases
746 (replace 'configure
53bed209
TGR
747 ;; ./configure is not GNU autotools' and doesn't gracefully handle
748 ;; unrecognized options, so we must call it manually.
d2a4020a
MB
749 (lambda* (#:key configure-flags #:allow-other-keys)
750 (apply invoke "./configure" configure-flags)))
23c883ef
MB
751 (add-before 'check 'patch-/bin/sh
752 (lambda _
753 (substitute* "Makefile"
754 (("/bin/sh") (which "sh")))
755 #t))
53bed209 756 (add-after 'install 'install-library-extras
952a20d2 757 (lambda* (#:key make-flags #:allow-other-keys)
a21eb019 758 (apply invoke
53bed209 759 "make" "-C" "librhash"
2bdf9cb3 760 "install-lib-headers" "install-so-link"
53bed209 761 make-flags))))))
a21eb019
AI
762 (home-page "https://sourceforge.net/projects/rhash/")
763 (synopsis "Utility for computing hash sums")
764 (description "RHash is a console utility for calculation and verification
765of magnet links and a wide range of hash sums like CRC32, MD4, MD5, SHA1,
766SHA256, SHA512, SHA3, AICH, ED2K, Tiger, DC++ TTH, BitTorrent BTIH, GOST R
76734.11-94, RIPEMD-160, HAS-160, EDON-R, Whirlpool and Snefru.")
768 (license (license:non-copyleft "file://COPYING"))))
b6beda1d
LF
769
770(define-public botan
771 (package
772 (name "botan")
64bef450 773 (version "2.12.1")
b6beda1d
LF
774 (source (origin
775 (method url-fetch)
776 (uri (string-append "https://botan.randombit.net/releases/"
64bef450 777 "Botan-" version ".tar.xz"))
b6beda1d
LF
778 (sha256
779 (base32
64bef450 780 "1ada3ga7b0z4m0vjmxlvfi4nsic2l8kjcy85jwss3z2i58a5y0vy"))))
b6beda1d
LF
781 (build-system gnu-build-system)
782 (arguments
783 '(#:phases
784 (modify-phases %standard-phases
b6beda1d
LF
785 (replace 'configure
786 (lambda* (#:key inputs outputs #:allow-other-keys)
787 (let* ((out (assoc-ref %outputs "out"))
788 (lib (string-append out "/lib")))
69ad8d92
TGR
789 ;; Upstream tests and benchmarks with -O3.
790 (setenv "CXXFLAGS" "-O3")
b6beda1d
LF
791 (invoke "python" "./configure.py"
792 (string-append "--prefix=" out)
793 ;; Otherwise, the `botan` executable cannot find
794 ;; libbotan.
795 (string-append "--ldflags=-Wl,-rpath=" lib)
be4f2d94
TGR
796
797 "--with-os-feature=getentropy"
b6beda1d 798 "--with-rst2man"
be4f2d94 799
b6beda1d
LF
800 ;; Recommended by upstream
801 "--with-zlib" "--with-bzip2" "--with-sqlite3"))))
802 (replace 'check
803 (lambda _ (invoke "./botan-test"))))))
804 (native-inputs
61506fe5 805 `(("python" ,python-wrapper)
b6beda1d
LF
806 ("python-docutils" ,python-docutils)))
807 (inputs
808 `(("sqlite" ,sqlite)
809 ("bzip2" ,bzip2)
810 ("zlib" ,zlib)))
811 (synopsis "Cryptographic library in C++11")
812 (description "Botan is a cryptography library, written in C++11, offering
813the tools necessary to implement a range of practical systems, such as TLS/DTLS,
814PKIX certificate handling, PKCS#11 and TPM hardware support, password hashing,
815and post-quantum crypto schemes. In addition to the C++, botan has a C89 API
816specifically designed to be easy to call from other languages. A Python binding
817using ctypes is included, and several other language bindings are available.")
818 (home-page "https://botan.randombit.net")
819 (license license:bsd-2)))
0cfc168b
PN
820
821(define-public ccrypt
822 (package
823 (name "ccrypt")
fc79867d 824 (version "1.11")
0cfc168b
PN
825 (source (origin
826 (method url-fetch)
fc79867d 827 (uri (string-append "mirror://sourceforge/ccrypt/"
0cfc168b
PN
828 version "/ccrypt-" version ".tar.gz"))
829 (sha256
830 (base32
fc79867d 831 "0kx4a5mhmp73ljknl2lcccmw9z3f5y8lqw0ghaymzvln1984g75i"))))
0cfc168b
PN
832 (build-system gnu-build-system)
833 (home-page "http://ccrypt.sourceforge.net")
834 (synopsis "Command-line utility for encrypting and decrypting files and streams")
835 (description "@command{ccrypt} is a utility for encrypting and decrypting
836files and streams. It was designed as a replacement for the standard unix
837@command{crypt} utility, which is notorious for using a very weak encryption
838algorithm. @command{ccrypt} is based on the Rijndael block cipher, a version of
839which is also used in the Advanced Encryption Standard (AES, see
840@url{http://www.nist.gov/aes}). This cipher is believed to provide very strong
841security.")
842 (license license:gpl2)))
de15ff1a
LF
843
844(define-public asignify
845 (let ((commit "f58e7977a599f040797975d649ed318e25cbd2d5")
846 (revision "0"))
847 (package
848 (name "asignify")
849 (version (git-version "1.1" revision commit))
850 (source (origin
851 (method git-fetch)
852 (uri (git-reference
853 (url "https://github.com/vstakhov/asignify.git")
854 (commit commit)))
855 (file-name (git-file-name name version))
856 (sha256
857 (base32
858 "1zl68qq6js6fdahxzyhvhrpyrwlv8c2zhdplycnfxyr1ckkhq8dw"))))
859 (build-system gnu-build-system)
860 (arguments
861 `(#:configure-flags
862 (list "--enable-openssl"
863 (string-append "--with-openssl="
864 (assoc-ref %build-inputs "openssl")))))
865 (native-inputs
866 `(("autoconf" ,autoconf)
867 ("automake" ,automake)
868 ("libtool" ,libtool)))
869 (inputs
e74f153a 870 `(("openssl" ,openssl)))
de15ff1a
LF
871 (home-page "https://github.com/vstakhov/asignify")
872 (synopsis "Cryptographic authentication and encryption tool and library")
873 (description "Asignify offers public cryptographic signatures and
874encryption with a library or a command-line tool. The tool is heavily inspired
875by signify as used in OpenBSD. The main goal of this project is to define a
876high level API for signing files, validating signatures and encrypting using
877public-key cryptography. Asignify is designed to be portable and self-contained
878with zero external dependencies. Asignify can verify OpenBSD signatures, but it
879cannot sign messages in OpenBSD format yet.")
880 (license license:bsd-2))))
b5a927b3 881
882(define-public enchive
883 (package
884 (name "enchive")
bc587eb1 885 (version "3.5")
b5a927b3 886 (source (origin
bc587eb1 887 (method git-fetch)
888 (uri (git-reference
889 (url "https://github.com/skeeto/enchive")
890 (commit version)))
891 (sha256
892 (base32
893 "0fdrfc5l42lj2bvmv9dmkmhmm7qiszwk7cmdvnqad3fs7652g0qa"))
894 (file-name (git-file-name name version))))
b5a927b3 895 (build-system gnu-build-system)
896 (arguments
897 '(#:tests? #f ; no check target '
898 #:make-flags (list "CC=gcc" "PREFIX=$(out)")
899 #:phases (modify-phases %standard-phases
900 (delete 'configure)
901 (add-after 'install 'post-install
902 (lambda _
903 (let* ((out (assoc-ref %outputs "out"))
904 (lisp (string-append out "/share/emacs/site-lisp")))
905 (install-file "enchive-mode.el" lisp)
906 #t))))))
907 (synopsis "Encrypted personal archives")
908 (description
909 "Enchive is a tool to encrypt files to yourself for long-term
910archival. It's a focused, simple alternative to more complex solutions such as
911GnuPG or encrypted filesystems. Enchive has no external dependencies and is
912trivial to build for local use. Portability is emphasized over performance.")
913 (home-page "https://github.com/skeeto/enchive")
914 (license license:unlicense)))
6fe6840d
PN
915
916(define-public libsecp256k1
b9676a4b 917 (let ((commit "d644dda5c9dbdecee52d1aa259235510fdc2d4ee"))
6fe6840d
PN
918 (package
919 (name "libsecp256k1")
b9676a4b 920 (version (git-version "20191213" "1" commit))
6fe6840d
PN
921 (source (origin
922 (method git-fetch)
923 (uri (git-reference
924 (url "https://github.com/bitcoin-core/secp256k1")
925 (commit commit)))
926 (sha256
927 (base32
b9676a4b 928 "0zmx32746khsm2cx0p3pdy3j2vkwmafvf7axiixijhgcg0xjv93i"))
6fe6840d
PN
929 (file-name (git-file-name name version))))
930 (build-system gnu-build-system)
931 (native-inputs
932 `(("autoconf" ,autoconf)
933 ("automake" ,automake)
934 ("libtool" ,libtool)))
935 ;; WARNING: This package might need additional configure flags to run properly.
936 ;; See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/libsecp256k1.
937 (synopsis "C library for EC operations on curve secp256k1")
938 (description
939 "Optimized C library for EC operations on curve secp256k1.
940
941This library is a work in progress and is being used to research best
942practices. Use at your own risk.
943
944Features:
945
946@itemize
947@item secp256k1 ECDSA signing/verification and key generation.
948@item Adding/multiplying private/public keys.
949@item Serialization/parsing of private keys, public keys, signatures.
950@item Constant time, constant memory access signing and pubkey generation.
951@item Derandomized DSA (via RFC6979 or with a caller provided function.)
952@item Very efficient implementation.
953@end itemize\n")
954 (home-page "https://github.com/bitcoin-core/secp256k1")
955 (license license:unlicense))))
c2ab3b84
EB
956
957(define-public stoken
958 (package
959 (name "stoken")
960 (version "0.92")
961 (source (origin
962 (method url-fetch)
963 (uri (string-append "mirror://sourceforge/stoken/"
964 "stoken-" version ".tar.gz"))
965 (sha256
966 (base32
967 "0npgr6y85gzwksy8jkwa4yzvqwjprwnplx3yiw3ayk4f0ldlhaxa"))))
968 (build-system gnu-build-system)
969 (native-inputs
970 `(("pkg-config" ,pkg-config)))
971 (inputs
972 `(("nettle" ,nettle)
973 ("libxml2" ,libxml2)))
974 (home-page "http://stoken.sf.net")
975 (synopsis "Software Token for cryptographic authentication")
976 (description
977 "@code{stoken} is a token code generator compatible with RSA SecurID
978128-bit (AES) tokens. This package contains a standalone command-line program
979that allows for importing token seeds, generating token codes, and various
980utility/testing functions.")
981 (license license:lgpl2.1+)))
cc6731e9
LF
982
983(define-public hpenc
984 (package
985 (name "hpenc")
986 (version "3.0")
987 (source (origin
988 (method git-fetch)
989 (uri (git-reference
990 (url "https://github.com/vstakhov/hpenc")
991 (commit version)))
f1d4d79f 992 (file-name (git-file-name name version))
cc6731e9
LF
993 (sha256
994 (base32
995 "1fb5yi3d2k8kd4zm7liiqagpz610y168xrr1cvn7cbq314jm2my1"))))
996 (build-system gnu-build-system)
997 (arguments
998 `(#:tests? #f ; No test suite
999 #:make-flags
1000 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1001 ;; Build the program and the docs.
1002 "SUBDIRS=src doc")
1003 #:phases
1004 (modify-phases %standard-phases
1005 (delete 'configure) ; No ./configure script
1006 (add-after 'unpack 'patch-path
1007 (lambda _
1008 (substitute* '("src/Makefile" "doc/Makefile")
1009 (("/usr/bin/install")
1010 "install"))))
1011 (add-before 'install 'make-output-directories
1012 (lambda* (#:key outputs #:allow-other-keys)
1013 (let* ((out (assoc-ref outputs "out"))
1014 (bin (string-append out "/bin"))
1015 (man1 (string-append out "/share/man/man1")))
1016 (mkdir-p bin)
1017 (mkdir-p man1)
1018 #t))))))
1019 (inputs
1020 `(("libsodium" ,libsodium)
1021 ("openssl" ,openssl)))
1022 (synopsis "High-performance command-line tool for stream encryption")
1023 (description "Hpenc is a command-line tool for performing authenticated
1024encryption (AES-GCM and ChaCha20-Poly1305) of streaming data. It does not
1025perform an asymmetric key exchange, instead requiring the user to distribute
1026pre-shared keys out of band. It is designed to handle large amounts of data
1027quickly by using all your CPU cores and hardware acceleration.")
1028 (home-page "https://github.com/vstakhov/hpenc")
1029 (license license:bsd-3)))
bfaa0617
TLC
1030
1031(define-public minisign
1032 (package
1033 (name "minisign")
840857bf 1034 (version "0.9")
bfaa0617
TLC
1035 (source
1036 (origin
1037 (method url-fetch)
1038 (uri
1039 (string-append "https://github.com/jedisct1/minisign/releases/download/"
1040 version "/minisign-" version ".tar.gz"))
1041 (sha256
840857bf 1042 (base32 "1h9cfvvm6lqq33b2wdar1x3w4k7zyrscavllyb0l5dmcdabq60r2"))))
bfaa0617
TLC
1043 (build-system cmake-build-system)
1044 (arguments
1045 ; No test suite
1046 `(#:tests? #f))
1047 (native-inputs
1048 `(("pkg-config" ,pkg-config)))
1049 (inputs
1050 `(("libsodium" ,libsodium)))
1051 (home-page "https://jedisct1.github.io/minisign")
1052 (synopsis "Tool to sign files and verify signatures")
1053 (description
1054 "Minisign is a dead simple tool to sign files and verify signatures. It is
1055portable, lightweight, and uses the highly secure Ed25519 public-key signature
1056system. Signature written by minisign can be verified using OpenBSD's
1057signify tool: public key files and signature files are compatible. However,
1058minisign uses a slightly different format to store secret keys. Minisign
1059signatures include trusted comments in addition to untrusted comments.
1060Trusted comments are signed, thus verified, before being displayed.")
1061 (license license:isc)))
20b49f47 1062
1063(define-public libolm
1064 (package
1065 (name "libolm")
fbbaf04d 1066 (version "3.1.5")
20b49f47 1067 (source (origin
1068 (method git-fetch)
1069 (uri (git-reference
1070 (url "https://git.matrix.org/git/olm")
1071 (commit version)))
1072 (sha256
1073 (base32
fbbaf04d 1074 "030g0jmmvhx2dh32k708sz6cdd5q1wz48i4gigh6dclqk10w28lm"))
20b49f47 1075 (file-name (git-file-name name version))))
1076 (arguments
1077 `(#:phases
1078 (modify-phases %standard-phases
1079 (replace 'check
1080 (lambda _
1081 (invoke "ctest" "build/tests"))))))
1082 (build-system cmake-build-system)
1083 (synopsis "Implementation of the olm and megolm cryptographic ratchets")
1084 (description "The libolm library implements the Double Ratchet
1085cryptographic ratchet. It is written in C and C++11, and exposed as a C
1086API.")
1087 (home-page "https://matrix.org/docs/projects/other/olm/")
1088 (license license:asl2.0)))
bbeb710d
JK
1089
1090(define-public hash-extender
57c3b71c
JK
1091 (let ((commit "cb8aaee49f93e9c0d2f03eb3cafb429c9eed723d")
1092 (revision "2"))
bbeb710d
JK
1093 (package
1094 (name "hash-extender")
1095 (version (git-version "0.0" revision commit))
1096 (source (origin
1097 (method git-fetch)
1098 (uri (git-reference
1099 (url "https://github.com/iagox86/hash_extender")
1100 (commit commit)))
1101 (sha256
1102 (base32
57c3b71c
JK
1103 "1fj118566hr1wv03az2w0iqknazsqqkak0mvlcvwpgr6midjqi9b"))
1104 (file-name (git-file-name name version))))
bbeb710d
JK
1105 (build-system gnu-build-system)
1106 (arguments
1107 `(#:phases
1108 (modify-phases %standard-phases
1109 (delete 'configure)
1110 (replace 'check
1111 (lambda _
1112 (invoke "./hash_extender_test")))
1113 (replace 'install
1114 (lambda* (#:key outputs #:allow-other-keys)
1115 (let* ((outdir (assoc-ref outputs "out"))
1116 (bindir (string-append outdir "/bin"))
1117 (docdir (string-append outdir
1118 "/share/doc/hash-extender-"
1119 ,version)))
1120 (install-file "hash_extender" bindir)
1121 (install-file "README.md" docdir)
1122 #t))))))
1123 (inputs
1124 `(("openssl" ,openssl)))
1125 (synopsis "Tool for hash length extension attacks")
1126 (description "@command{hash_extender} is a utility for performing hash
1127length extension attacks supporting MD4, MD5, RIPEMD-160, SHA-0, SHA-1,
1128SHA-256, SHA-512, and WHIRLPOOL hashes.")
1129 (home-page "https://github.com/iagox86/hash_extender")
1130 (license license:bsd-3))))