Library
Module
Module type
Parameter
Class
Class type
This library provides the two Diffie-Hellman-like functions defined in the eponymous RFC, x25519
and x448
.
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.
You can use Rfc7748.x25519
and Rfc7748.x448
as described in the example program in the source tree.
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.X25519
and Rfc7748.X448
andRfc7748.x25519
and 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.