@@ -0,0 +1,43 @@
1+{ lib
2+, buildDunePackage
3+, fetchFromGitHub
4+, ocaml
5+
6+, ounit
7+, zarith
8+}:
9+
10+buildDunePackage rec {
11+ pname = "rfc7748";
12+ version = "1.0";
13+
14+ src = fetchFromGitHub {
15+ owner = "burgerdev";
16+ repo = "ocaml-rfc7748";
17+ rev = "v${version}";
18+ sha256 = "sha256-mgZooyfxrKBVQFn01B8PULmFUW9Zq5HJfgHCSJSkJo4=";
19+ };
20+
21+ useDune2 = true;
22+
23+ minimumOCamlVersion = "4.05";
24+
25+ propagatedBuildInputs = [ zarith ];
26+
27+ # the tests fail for 4.05
28+ doCheck = lib.versionAtLeast ocaml.version "4.06";
29+ checkInputs = [ ounit ];
30+
31+ meta = {
32+ homepage = "https://github.com/burgerdev/ocaml-rfc7748";
33+ description = "Elliptic Curve Diffie-Hellman on Edwards Curves (X25519, X448)";
34+ longDescription = ''
35+ This library implements the ECDH functions 'X25519' and 'X448' as specified
36+ in RFC 7748, 'Elliptic curves for security'. In the spirit of the original
37+ publications, the public API is kept as simple as possible to make it easy
38+ to use and hard to misuse.
39+ '';
40+ license = lib.licenses.bsd2;
41+ maintainers = with lib.maintainers; [ fufexan ];
42+ };
43+}