This library provides the two Diffie-Hellman-like functions defined in the eponymous RFC,
X25519 and X448 are instances of a special subset of elliptic curves, the so-called Edwards curves, for which point addition has a closed form. This eliminates a whole class of problems that arise in other elliptic curve implementations, where addition formulas depend on the arguments (e.g. whether a point is added to itself). In addition, these curves are also designed to be safe to implement and use: the addition formula is by construction resistant to timing attacks, neither public keys nor private keys need to be validated and the string-based interface is very portable.
Below is the public API for this library. It is divided into
Rfc7748.DH for scalar multiplication on Edwards curves (the elliptic curve analogon of discrete exponentiation, as used in the classical Diffie-Hellman key exchange)
Rfc7748.x448 described in RFC 7748.
module type DH = sig ... end
Signature of the modules implementing the Diffie-Hellman functions for RFC 7748.
This is a shortcut for using
X25519.scale without converting keys.