Subject: [PATCH 19/29] gnu: Add ocaml-mirage-crypto-ec.

From: pukkamustard <[email-masked]>
Date: Wed, 4 Aug 2021 07:15:35 +0000

* gnu/packages/ocaml.scm (ocaml-mirage-crypto-ec): New variable.
---
 gnu/packages/ocaml.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 2cc91ea2c0..8463682e79 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -7624,6 +7624,40 @@ representations can be used for parsing, serialization, or random testing.
 The only ASN.1 encodings currently supported are BER and DER.")
     (license license:isc)))
 
+(define-public ocaml-mirage-crypto-ec
+  ;; FIXME: This package contains generated code (see
+  ;; https://github.com/mirage/mirage-crypto/blob/main/ec/native/README.md). These
+  ;; should be re-generated during the build process.
+  (package
+    (inherit ocaml-mirage-crypto)
+    (name "ocaml-mirage-crypto-ec")
+    (arguments `(#:package "mirage-crypto-ec"
+                 #:test-target "."))
+    (propagated-inputs
+     `(("ocaml-cstruct" ,ocaml-cstruct)
+       ("ocaml-eqaf" ,ocaml-eqaf)
+       ("ocaml-mirage-crypto" ,ocaml-mirage-crypto)
+       ("ocaml-mirage-crypto-rng" ,ocaml-mirage-crypto-rng)
+       ("gmp" ,gmp)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("ocaml-randomconv" ,ocaml-randomconv)
+       ("ocaml-ounit" ,ocaml-ounit)
+       ("ocaml-mirage-crypto-pk" ,ocaml-mirage-crypto-pk)
+       ("ocaml-hex" ,ocaml-hex)
+       ("ocaml-alcotest" ,ocaml-alcotest)
+       ("ocaml-asn1-combinators" ,ocaml-asn1-combinators)
+       ("ocaml-ppx-deriving-yojson" ,ocaml-ppx-deriving-yojson)
+       ("ocaml-ppx-deriving" ,ocaml-ppx-deriving)
+       ("ocaml-yojson" ,ocaml-yojson)))
+    (synopsis "OCaml library providing Elliptic Curve Cryptography")
+    (description "This OCaml library provides an implementation of key exchange
+(ECDH) and digital signature (ECDSA/EdDSA) algorithms.  The curves P224
+(SECP224R1), P256 (SECP256R1), P384 (SECP384R1),P521 (SECP521R1), and 25519
+(X25519, Ed25519) are implemented by this package.")
+    ;; See https://github.com/mirage/mirage-crypto/blob/main/ec/LICENSE.md
+    (license license:expat)))
+
 (define-public js-of-ocaml
   (package
     (name "js-of-ocaml")
-- 
2.32.0