upstream: https://github.com/mirage/mirage-crypto
C 91.4%
OCaml 8.4%
Makefile 0.1%
Shell 0.1%
Standard ML 0.1%
Dune 0.1%
Other 0.2%
1537 1 0

Clone this repository

https://tangled.org/anil.recoil.org/ocaml-crypto https://tangled.org/did:plc:nhyitepp3u4u6fcfboegzcjw/ocaml-crypto
git@git.recoil.org:anil.recoil.org/ocaml-crypto git@git.recoil.org:did:plc:nhyitepp3u4u6fcfboegzcjw/ocaml-crypto

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

crypto - Cryptographic primitives for OCaml#

Warning: This is an experimental fork of mirage-crypto. Do not use in production. Use mirage-crypto instead.

This fork renames the packages and removes Lwt/Miou dependencies, keeping only Eio-compatible code. It is intended for experimentation only.

Original mirage-crypto#

mirage-crypto is a small cryptographic library that puts emphasis on the applicative style and ease of use. It includes basic ciphers (AES, 3DES, RC4, ChaCha20/Poly1305), AEAD primitives (AES-GCM, AES-CCM, ChaCha20/Poly1305), public-key primitives (RSA, DSA, DH), elliptic curves (NIST P-256, P-384, P-521, and curve 25519), and a strong RNG (Fortuna).

RSA timing attacks are countered by blinding. AES timing attacks are avoided by delegating to AES-NI.

Mirage-crypto is a fork of the ocaml-nocrypto written by David Kaloper. It was forked with the permission of the original author in order to facilitate changes (e.g. build system) required by Mirage that the upstream didn't have time to keep up with.

Build#

dune build
dune runtest

FAQ#

RNG seeding#

If RNG fails with Fatal error: exception Unseeded_generator, you need to seed it.

let () = Crypto_rng_unix.use_default ()