package curve448

  1. Overview
  2. Docs

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

Curve448.X448

Diffie–Hellman key agreement

56-byte private key, public value and shared secret

Curve448.Ed448

Deterministic signatures, optional context

57-byte keys, 114-byte signatures

Curve448.Ed448ph

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

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.