package rfc7748

  1. Overview
  2. Docs
Edwards Curves X25519 and X448 from RFC 7748

Install

Dune Dependency

Authors

Maintainers

Sources

v1.0-rc2.tar.gz
sha256=3f63cb002d1ca83390a31ae4721dda926ca7045e424c7c0e038895aef836278c
md5=63d367245f45171feb8ee7027e0b2ace

Description

This library implements the ECDH functions 'X25519' and 'X448' as specified in RFC 7748, 'Elliptic curves for security'. In the spirit of the original publications, the public API is kept as simple as possible to make it easy to use and hard to misuse.

The current version is written in plain OCaml, leveraging Zarith for integer arithmetic. While this makes the implementation straightforward and easy to reason about, the performance is nowhere near that of DJB's implementation using floating point registers (https://cr.yp.to/ecdh.html).

Published: 06 Dec 2018

README

OCaml-RFC7748

Elliptic curves for cryptographic purposes, based on RFC 7748.

Usage

The API contains documentation. Example use:

open Rfc7748

let _ =
  let priv = X25519.private_key_of_string
      "a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4" in
  let pub = X25519.public_key_of_string
      "e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c" in
  X25519.scale priv pub
  |> X25519.string_of_public_key
  |> Printf.printf "c3da55379de9c6908e94ea4df28d084f32eccf03491c71f754b4075577a28552\n == \n%s"

License

BSD 2-clause, see license.

Dependencies (3)

  1. dune >= "1.2.1"
  2. zarith >= "1.5"
  3. ocaml >= "4.03" & < "5.0.0"

Dev Dependencies (1)

  1. ounit with-test & >= "2.0.5"

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.