gnu: emacs-helm: Update to 3.8.7.
[jackhill/guix/guix.git] / gnu / packages / openpgp.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2020 Justus Winter <justus@sequoia-pgp.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages openpgp)
20 #:use-module (guix packages)
21 #:use-module (guix download)
22 #:use-module (guix git-download)
23 #:use-module (guix build-system cmake)
24 #:use-module (guix build-system gnu)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages check)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages crypto)
30 #:use-module (gnu packages gnupg)
31 #:use-module (gnu packages multiprecision)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages python)
34 #:use-module (gnu packages web))
35
36 (define-public libtmcg
37 (package
38 (name "libtmcg")
39 (version "1.3.18")
40 (source (origin
41 (method url-fetch)
42 (uri (string-append "mirror://savannah/libtmcg/libTMCG-" version
43 ".tar.gz"))
44 (sha256
45 (base32
46 "179b5jx3mqs9hgsj8cfwk6x8qib60kw9szk9fkz6s1gl3v83mnyx"))))
47 (build-system gnu-build-system)
48 (arguments '(#:configure-flags '("--enable-silent-rules")))
49 (inputs (list gmp libgcrypt))
50 (synopsis
51 "C++ library for creating secure and fair online card games")
52 (description
53 "The library provides a sort of useful classes, algorithms, and
54 high-level protocols to support an application programmer in writing such
55 software. The most remarkable feature is the absence of a trusted third
56 party (TTP), i.e. neither a central game server nor trusted hardware
57 components are necessary.
58
59 The corresponding cryptographic problem, actually called Mental Poker, has
60 been studied since 1979 (Shamir, Rivest, and Adleman) by many authors.
61 LibTMCG provides the first practical implementation of such protocols.")
62 (home-page "https://www.nongnu.org/libtmcg/")
63 (license license:gpl2+)))
64
65 (define-public dkgpg
66 (package
67 (name "dkgpg")
68 (version "1.1.3")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "mirror://savannah/dkgpg/dkgpg-" version
72 ".tar.gz"))
73 (sha256
74 (base32
75 "1hpfg7akd5icj49i03z74hp9zj0xwl90bndn0hnw0hpb8lk7qcxg"))))
76 (build-system gnu-build-system)
77 (arguments '(#:configure-flags
78 '("--enable-silent-rules")
79 ;; https://savannah.nongnu.org/bugs/?58772
80 #:parallel-tests? #f))
81 (inputs (list bzip2 gmp libgcrypt libtmcg zlib))
82 (synopsis
83 "Distributed Key Generation and Threshold Cryptography for OpenPGP")
84 (description
85 "The Distributed Privacy Guard (DKGPG) implements Distributed Key
86 Generation (DKG) and Threshold Cryptography for OpenPGP. The generated public
87 keys are compatible with the standard and thus can be used by any
88 RFC4880-compliant application (e.g. GnuPG). The main purposes of this
89 software are distributing power among multiple parties, eliminating single
90 points of failure, and increasing the difficulty of side-channel attacks on
91 private key material.
92
93 DKGPG consists of a bunch of simple command-line programs. The current
94 implementation is in experimental state and should NOT be used in production
95 environments.")
96 (home-page "https://www.nongnu.org/dkgpg/")
97 (license license:gpl2+)))
98
99 (define-public rnp
100 ;; Packaging the currently released version requires a large number of
101 ;; patches. For now, we package a snapshot instead.
102 (let ((commit "203224f0b1505dba17837c03da603e5b98ab125a")
103 (revision "0")
104 (last-version "0.13.1")
105 (day-of-release "2020-07-21"))
106 (package
107 (name "rnp")
108 (version (git-version last-version revision commit))
109 (source (origin
110 (method git-fetch)
111 (uri (git-reference
112 (url "https://github.com/rnpgp/rnp")
113 (commit commit)))
114 (file-name
115 (string-append name "-" (string-take commit 7) "-checkout"))
116 (sha256
117 (base32
118 "1rnwhc9ys4v4mv584hmmrl0ycnqmsaigpffzm31qq337hz24zqya"))
119 (patches
120 (search-patches "rnp-unbundle-googletest.patch"
121 "rnp-disable-ruby-rnp-tests.patch"
122 "rnp-add-version.cmake.patch"))))
123 (build-system cmake-build-system)
124 (arguments `(#:configure-flags
125 '("-DBUILD_SHARED_LIBS=on"
126 "-DBUILD_TESTING=on")
127 #:phases
128 (modify-phases %standard-phases
129 (add-after 'unpack 'fixes
130 (lambda* (#:key inputs #:allow-other-keys)
131 (copy-recursively (assoc-ref inputs "googletest-source")
132 "src/tests/googletest-src")
133 (substitute* "src/tests/support.cpp"
134 (("\"cp\"") (string-append "\"" (which "cp") "\"")))
135 ;; Produce a version stamp in the format the upstream
136 ;; project uses for unreleased revisions.
137 (with-output-to-file "version.txt"
138 (lambda _
139 (display
140 (string-append ,last-version
141 "-" ,revision
142 "-g" ,(string-take commit 7)))))
143 #t))
144 (replace 'check
145 (lambda _
146 ;; Some OpenPGP certificates used by the tests expire.
147 ;; To work around that, set the time to roughly the
148 ;; release date.
149 (invoke "faketime" ,day-of-release "make" "test"))))))
150 (native-inputs
151 `(("gnupg" ,gnupg) ; for tests
152 ("googletest-source" ,(package-source googletest)) ; for tests
153 ("libfaketime" ,libfaketime) ; for tests
154 ("pkg-config" ,pkg-config)
155 ("python" ,python)
156 ("python2" ,python-2.7)))
157 (inputs (list botan bzip2 json-c zlib))
158 (synopsis
159 "RFC4880-compliant OpenPGP library written in C++")
160 (description
161 "Set of OpenPGP (RFC4880) tools that works on Linux, *BSD and macOS as a
162 replacement of GnuPG. It is maintained by Ribose after being forked from
163 NetPGP, itself originally written for NetBSD.
164
165 librnp is the library used by rnp for all OpenPGP functions, useful for
166 developers to build against. It is a “real” library, not a wrapper like GPGME
167 of GnuPG.")
168 (home-page "https://www.rnpgp.com/")
169 (license
170 ;; RNP contains code written by Ribose and code derived from netpgp.
171 (list
172 ;; Ribose's BSD 2-Clause License and NetBSD's BSD 2-Clause License
173 ;; (netpgp).
174 license:bsd-2
175 ;; Nominet UK's Apache 2.0 Licence (netpgp).
176 license:asl2.0
177 ;; Nominet UK's BSD 3-Clause License (netpgp).
178 license:bsd-3)))))