package curve448
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=324dde8adda6e07adee445041319fe81
sha512=bb664f36f14c6a6947ec3b54d5c5f0f9b97ddb8520fdcd1d8ea093e19a1737f024e8766ad47f9b6abb20949dee19309768f7c1f17cac7372c7a775f891d08fd0
Description
X448 Diffie-Hellman and Ed448/Ed448ph signatures over Curve448, with an API that mirrors mirage-crypto-ec's X25519 and Ed25519 modules so that HPKE, TLS and X.509 code written against those can adopt X448 and Ed448 directly. The default implementation is pure OCaml; an optional C implementation (curve448.c) uses fiat-crypto's verified field arithmetic and is two to three times faster. Both are written to avoid secret-dependent branches and memory access.
README
curve448
X448 key agreement and Ed448 / Ed448ph signatures for OCaml, following RFC 7748 and RFC 8032. The API follows mirage-crypto-ec, with a pure OCaml backend by default and an optional C backend.
Install
Requires OCaml 4.14+, Dune 3.6+, opam 2.0+ and a 64-bit platform. The package is not yet published to opam. Install from a checkout:
git clone https://github.com/thevilledev/ocaml-curve448.git
cd ocaml-curve448
opam pin add curve448 .The package builds the pure OCaml backend and, with GCC or Clang, the C backend. See compatibility for version coverage and limitations.
Quick start
Add (libraries curve448 mirage-crypto-rng.unix) to your executable's Dune stanza, initialise the RNG once, then sign and verify:
let () =
Mirage_crypto_rng_unix.use_default ();
let priv, pub = Curve448.Ed448.generate () in
let msg = "hello" in
let signature = Curve448.Ed448.sign ~key:priv msg in
assert (Curve448.Ed448.verify ~key:pub signature ~msg)Module | Purpose | Sizes |
|---|---|---|
| Diffie–Hellman key agreement | 56-byte private key, public value and shared secret |
| Deterministic signatures, optional context | 57-byte keys, 114-byte signatures |
| Prehashed signatures, optional context | Same keys and signatures; 64-byte SHAKE256 prehash |
Usage and examples cover key agreement, contexts, prehashes and error handling. Choosing a backend explains how to select curve448.c at link time. Small-order Ed448 keys are accepted under RFC 8032; protocols that need to reject them should read the interoperability notes.
Documentation
- Documentation index — all guides and the API reference.
- Contributing — build, test and format the project.
- Testing — vectors, property tests, fuzzing and security checks.
- Design and performance.
- Changelog and release guide.
License and credits
Project code is ISC licensed. The C backend includes code from fiat-crypto, BoringSSL and tiny_sha3 under MIT and ISC; test fixtures have their own terms. See LICENSE.md and vector provenance. The API follows mirage-crypto.
Dependencies (3)
-
mirage-crypto-rng
>= "2.0.1" -
ocaml
>= "4.14.0" -
dune
>= "3.6"
Dev Dependencies (10)
-
odoc
with-doc & >= "2.1.1" -
crowbar
with-test & >= "0.2.1" -
kdf
with-test & >= "1.1.0" -
digestif
with-test & >= "1.3.1" -
mirage-crypto-ec
with-test & >= "2.0.1" -
zarith
with-test & >= "1.12" -
yojson
with-test & >= "2.0.0" -
qcheck-alcotest
with-test & >= "0.90" -
qcheck-core
with-test & >= "0.90" -
alcotest
with-test & >= "1.7.0"
Used by
None
Conflicts
None