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