summary refs log tree commit diff
path: root/gnu/packages/crypto.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/crypto.scm')
-rw-r--r--gnu/packages/crypto.scm172
1 files changed, 109 insertions, 63 deletions
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index e8062f0e1f..ffef4ff8e4 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -1,16 +1,18 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
-;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016, 2017, 2018 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox>
 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
-;;; Copyright © 2016, 2017 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2016, 2017, 2019 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2017 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018 Nicolò Balzarotti <nicolo@nixo.xyz>
+;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
+;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -37,7 +39,6 @@
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cryptsetup)
-  #:use-module (gnu packages databases)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages image)
@@ -51,10 +52,12 @@
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages search)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages shells)
+  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages xml)
@@ -71,7 +74,7 @@
 (define-public libsodium
   (package
     (name "libsodium")
-    (version "1.0.16")
+    (version "1.0.17")
     (source (origin
             (method url-fetch)
             (uri (list (string-append
@@ -82,7 +85,7 @@
                         "releases/old/libsodium-" version ".tar.gz")))
             (sha256
              (base32
-              "0cq5pn7qcib7q70mm1lgjwj75xdxix27v0xl1xl0kvxww7hwgbgf"))))
+              "1cf2d9v1gylz1qcy2zappbf526qfmph6gd6fnn3w2b347vixmhqc"))))
     (build-system gnu-build-system)
     (synopsis "Portable NaCl-based crypto library")
     (description
@@ -164,53 +167,6 @@ OpenBSD tool of the same name.")
                                           "See base64.c in the distribution for
                                            the license from IBM.")))))
 
-(define-public opendht
-  (package
-    (name "opendht")
-    (version "0.6.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/savoirfairelinux/opendht.git")
-                    (commit version)))
-              (file-name (git-file-name name version))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  (delete-file-recursively "src/argon2")
-                  (substitute* "src/Makefile.am"
-                    (("./argon2/libargon2.la") "")
-                    (("SUBDIRS = argon2") ""))
-                  (substitute* "src/crypto.cpp"
-                    (("argon2/argon2.h") "argon2.h"))
-                  (substitute* "configure.ac"
-                    (("src/argon2/Makefile") ""))
-                  #t))
-              (sha256
-               (base32
-                "1akk613f18rc8kqs0cxdm34iq7wwc9kffhgp5rng09arwlw8gw3w"))))
-    (build-system gnu-build-system)
-    (inputs
-     `(("gnutls" ,gnutls)
-       ("nettle" ,nettle)
-       ("readline" ,readline)
-       ("argon2" ,argon2)))
-    (propagated-inputs
-     `(("msgpack" ,msgpack)))           ;included in several installed headers
-    (native-inputs
-     `(("autoconf" ,autoconf)
-       ("pkg-config" ,pkg-config)
-       ("automake" ,automake)
-       ("libtool" ,libtool)))
-    (arguments
-     `(#:configure-flags '("--disable-tools" "--disable-python")))
-    (home-page "https://github.com/savoirfairelinux/opendht/")
-    (synopsis "Distributed Hash Table (DHT) library")
-    (description "OpenDHT is a Distributed Hash Table (DHT) library.  It may
-be used to manage peer-to-peer network connections as needed for real time
-communication.")
-    (license license:gpl3)))
-
 (define-public encfs
   (package
     (name "encfs")
@@ -347,13 +303,12 @@ secure operations. ")
            (delete 'configure)
            (replace 'check
              (lambda _
-               (and
-                 (zero? (system* "./worgen" "8-12" "top1000.txt" "3-10" "top400nouns.txt"
-                                 "3-6" "top150adjectives.txt" "3-6"))
-                 (zero? (system* "./eschalot" "-r" "^guix|^guixsd"))
-                 (zero? (system* "./eschalot" "-r" "^gnu|^free"))
-                 (zero? (system* "./eschalot" "-r" "^cyber|^hack"))
-                 (zero? (system* "./eschalot" "-r" "^troll")))))
+               (invoke "./worgen" "8-12" "top1000.txt" "3-10" "top400nouns.txt"
+                       "3-6" "top150adjectives.txt" "3-6")
+               (invoke "./eschalot" "-r" "^guix|^guixsd")
+               (invoke "./eschalot" "-r" "^gnu|^free")
+               (invoke "./eschalot" "-r" "^cyber|^hack")
+               (invoke "./eschalot" "-r" "^troll")))
            ;; Make install can not create the bin dir, create it.
            (add-before 'install 'create-bin-dir
              (lambda* (#:key outputs #:allow-other-keys)
@@ -632,7 +587,7 @@ data on your platform, so the seed itself will be as random as possible.
 (define-public crypto++
   (package
     (name "crypto++")
-    (version "6.0.0")
+    (version "8.0.0")
     (source (origin
               (method url-fetch/zipbomb)
               (uri (string-append "https://cryptopp.com/cryptopp"
@@ -640,11 +595,14 @@ data on your platform, so the seed itself will be as random as possible.
                                   ".zip"))
               (sha256
                (base32
-                "1nidm6xbdza5cbgf5md2zznmaq692rfyjasycwipl6rzdfwjvb34"))))
+                "0b5qrsm4jhy4nzxgrm13nixhvbswr242plx1jw6r4sw492rqkzdv"))))
     (build-system gnu-build-system)
     (arguments
      `(#:make-flags
-       (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+       (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+             ;; Override "/sbin/ldconfig" with simply "echo" since
+             ;; we don't need ldconfig(8).
+             "LDCONF=echo")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'disable-native-optimisation
@@ -654,7 +612,28 @@ data on your platform, so the seed itself will be as random as possible.
              (substitute* "GNUmakefile"
                ((" -march=native") ""))
              #t))
-         (delete 'configure))))
+         (delete 'configure)
+         (add-after 'build 'build-shared
+           (lambda _
+             ;; By default, only the static library is built.
+             (invoke "make" "shared")))
+         (add-after 'install 'install-pkg-config
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (pkg-dir (string-append out "/lib/pkgconfig")))
+               (mkdir-p pkg-dir)
+               (with-output-to-file (string-append pkg-dir "/libcrypto++.pc")
+                 (lambda _
+                   (display
+                    (string-append
+                     "prefix=" out "\n"
+                     "libdir=" out "/lib\n"
+                     "includedir=" out "/include\n\n"
+                     "Name: libcrypto++-" ,version "\n"
+                     "Description: Class library of cryptographic schemes"
+                     "Version: " ,version "\n"
+                     "Libs: -L${libdir} -lcryptopp\n"
+                     "Cflags: -I${includedir}\n"))))))))))
     (native-inputs
      `(("unzip" ,unzip)))
     (home-page "https://cryptopp.com/")
@@ -881,3 +860,70 @@ GnuPG or encrypted filesystems.  Enchive has no external dependencies and is
 trivial to build for local use.  Portability is emphasized over performance.")
     (home-page "https://github.com/skeeto/enchive")
     (license license:unlicense)))
+
+(define-public libsecp256k1
+  (let ((commit "e34ceb333b1c0e6f4115ecbb80c632ac1042fa49"))
+    (package
+      (name "libsecp256k1")
+      (version (git-version "20181126" "1" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/bitcoin-core/secp256k1")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "0as78s179hcr3ysk3fw98k5wzabgnwri7vkkc17wg31lyz6ids6c"))
+                (file-name (git-file-name name version))))
+      (build-system gnu-build-system)
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)))
+      ;; WARNING: This package might need additional configure flags to run properly.
+      ;; See https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/libsecp256k1.
+      (synopsis "C library for EC operations on curve secp256k1")
+      (description
+       "Optimized C library for EC operations on curve secp256k1.
+
+This library is a work in progress and is being used to research best
+practices.  Use at your own risk.
+
+Features:
+
+@itemize
+@item secp256k1 ECDSA signing/verification and key generation.
+@item Adding/multiplying private/public keys.
+@item Serialization/parsing of private keys, public keys, signatures.
+@item Constant time, constant memory access signing and pubkey generation.
+@item Derandomized DSA (via RFC6979 or with a caller provided function.)
+@item Very efficient implementation.
+@end itemize\n")
+      (home-page "https://github.com/bitcoin-core/secp256k1")
+      (license license:unlicense))))
+
+(define-public stoken
+  (package
+    (name "stoken")
+    (version "0.92")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/stoken/"
+                                  "stoken-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0npgr6y85gzwksy8jkwa4yzvqwjprwnplx3yiw3ayk4f0ldlhaxa"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("nettle" ,nettle)
+       ("libxml2" ,libxml2)))
+    (home-page "http://stoken.sf.net")
+    (synopsis "Software Token for cryptographic authentication")
+    (description
+     "@code{stoken} is a token code generator compatible with RSA SecurID
+128-bit (AES) tokens.  This package contains a standalone command-line program
+that allows for importing token seeds, generating token codes, and various
+utility/testing functions.")
+    (license license:lgpl2.1+)))