summary refs log tree commit diff
path: root/gnu/packages/crates-crypto.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/crates-crypto.scm')
-rw-r--r--gnu/packages/crates-crypto.scm93
1 files changed, 93 insertions, 0 deletions
diff --git a/gnu/packages/crates-crypto.scm b/gnu/packages/crates-crypto.scm
index 7dda3de5e1..4637ba3ba8 100644
--- a/gnu/packages/crates-crypto.scm
+++ b/gnu/packages/crates-crypto.scm
@@ -956,6 +956,99 @@ ciphers.")
      "The ChaCha family of stream ciphers.")
     (license (list license:asl2.0 license:expat))))
 
+(define-public rust-chacha20-0.9
+  (package
+    (name "rust-chacha20")
+    (version "0.9.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "chacha20" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "0678wipx6kghp71hpzhl2qvx80q7caz3vm8vsvd07b1fpms3yqf3"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-cfg-if" ,rust-cfg-if-1)
+                       ("rust-cipher" ,rust-cipher-0.4)
+                       ("rust-cpufeatures" ,rust-cpufeatures-0.2))
+       #:cargo-development-inputs (("rust-cipher" ,rust-cipher-0.4)
+                                   ("rust-hex-literal" ,rust-hex-literal-0.3))))
+    (home-page "https://github.com/RustCrypto/stream-ciphers")
+    (synopsis "ChaCha20 stream cipher implemented in pure Rust")
+    (description
+     "The ChaCha20 stream cipher (RFC 8439) implemented in pure Rust using traits
+from the RustCrypto @code{cipher} crate, with optional architecture-specific
+hardware acceleration (AVX2, SSE2).  Additionally provides the ChaCha8, ChaCha12,
+XChaCha20, XChaCha12 and XChaCha8 stream ciphers, and also optional
+@code{rand_core-compatible} RNGs based on those ciphers.")
+    (license (list license:asl2.0 license:expat))))
+
+(define-public rust-chacha20-0.8
+  (package
+    (inherit rust-chacha20-0.9)
+    (name "rust-chacha20")
+    (version "0.8.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "chacha20" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "14cgpnnpqsn5hmqkgrj4yaqdsvy56hkgcw5s2gqsxwhc7m1jmdq1"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (substitute* "Cargo.toml"
+             (("version = \">=1, <1.5\"") "version = \"^1\""))))))
+    (arguments
+     `(#:cargo-inputs
+       (("rust-cfg-if" ,rust-cfg-if-1)
+        ("rust-cipher" ,rust-cipher-0.3)
+        ("rust-cpufeatures" ,rust-cpufeatures-0.2)
+        ("rust-rand-core" ,rust-rand-core-0.6)
+        ("rust-zeroize" ,rust-zeroize-1))
+       #:cargo-development-inputs
+       (("rust-cipher" ,rust-cipher-0.3)
+        ("rust-hex-literal" ,rust-hex-literal-0.2))))))
+
+(define-public rust-chacha20poly1305-0.9
+  (package
+    (name "rust-chacha20poly1305")
+    (version "0.9.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "chacha20poly1305" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1xfgn306nfch4a4wwddha8lz6qpnhng50iy4prxlagg6kfq4d151"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (substitute* "Cargo.toml"
+             (("version = \">=1, <1.5\"") "version = \"^1\""))))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-aead" ,rust-aead-0.4)
+        ("rust-chacha20" ,rust-chacha20-0.8)
+        ("rust-cipher" ,rust-cipher-0.3)
+        ("rust-poly1305" ,rust-poly1305-0.7)
+        ("rust-zeroize" ,rust-zeroize-1))
+       #:cargo-development-inputs
+       (("rust-aead" ,rust-aead-0.4))))
+    (home-page "https://github.com/RustCrypto/AEADs/tree/master/chacha20poly1305")
+    (synopsis
+     "Pure Rust implementation of ChaCha20Poly1305 Authenticated Encryption")
+    (description
+     "Pure Rust implementation of the ChaCha20Poly1305 Authenticated
+Encryption with Additional Data Cipher (RFC 8439) with optional
+architecture-specific hardware acceleration.  Also contains implementations of
+the XChaCha20Poly1305 extended nonce variant of ChaCha20Poly1305, and the
+reduced-round ChaCha8Poly1305 and ChaCha12Poly1305 lightweight variants.")
+    (license (list license:asl2.0 license:expat))))
+
 (define-public rust-cipher-0.4
   (package
     (name "rust-cipher")