package fiat-p256

All checked builds pass
  1. Overview
  2. Docs
Primitives for Elliptic Curve Cryptography taken from Fiat

Install

dune-project
 Dependency

Authors

Maintainers

Sources

fiat-p256-v0.2.3.tbz
sha256=c20d1b1395f59b111ca6a75c55b4edfb864215daf7484910bc89c2953474b0e0
sha512=9d679c865820294e87f479a2e46aa6278b5e9e1106776067ce0e71e4263850d4d07b38b7da65c49c4a5f4cedd74af92fcb3f3188065b12b58041a4729b296652

Description

This is an implementation of the ECDH over P-256 key exchange algorithm, using code from Fiat (https://github.com/mit-plv/fiat-crypto).

Cryptographic primitives should not be used in end applications, they are better used as part of a cryptographic library.

Tags

org:mirage

Added to opam-repository:

README

Fiat-p256

fiat-p256 contains primitives for ECDH key exchange algorithm over NIST curve P-256.

It internally uses bindings to C code generated using the correct-by-construction implementations from fiat-crypto.

Please be aware that cryptographic primitives should not be used in end applications, they are better used as part of a higher level cryptographic library.

Build Status docs

Installation

fiat-p256 is available on opam and can be install as follows:

opam install fiat-p256

Usage

The entry point to this library is the Fiat_p256 module and the main function is dh which let you perform a key exchange given your private key scalar and the other party's public key point:

let secret = Fiat_p256.dh ~scalar ~point

Note that the point values built or parsed using Fiat_p256's interface are checked according to NIST's Recommendation for Pair-Wise Key Establishment Schemes Using Discrete Logarithm Cryptography section 5.6.2.3.2 so that you shouldn't be able to provide an invalid point or the point at infinity to the functions exposed in this module.

You can also compute the public P-256 key corresponding to your private key scalar using the public function:

let public_key = Fiat_p256.public ~scalar

Note that the scalar values parsed using Fiat_p256's interface must be within P-256's generator subgroup order range so that your public key can't be the point at infinity. Any scalar not in the range [1 - (n-1)], n being the group order, will be rejected.

Dependencies (7)

  1. conf-pkg-config build
  2. hex >= "1.4.0"
  3. eqaf >= "0.7" & < "0.10"
  4. dune-configurator
  5. cstruct >= "3.5.0" & < "6.1.0"
  6. bigarray-compat
  7. dune >= "2.6"

Dev Dependencies (7)

  1. yojson with-test & >= "1.6.0"
  2. stdlib-shims with-test
  3. rresult with-test
  4. ppx_deriving_yojson with-test
  5. benchmark with-test
  6. asn1-combinators with-test & < "0.3.0"
  7. alcotest with-test & < "1.4.0"

Optional Dependencies (1)

  1. ocaml-freestanding

Used by (1)

  1. tls = "0.12.8"

Conflicts (2)

  1. ocaml-freestanding < "0.4.1"
  2. mirage-xen < "6.0.0"

Build status

Results of building fiat-p256 with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.2.3 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure