forked from
gazagnaire.org/ocaml-crypto
upstream: https://github.com/mirage/mirage-crypto
1# crypto - Cryptographic primitives for OCaml
2
3> **Warning**: This is an experimental fork of [mirage-crypto](https://github.com/mirage/mirage-crypto).
4> Do not use in production. Use [mirage-crypto](https://github.com/mirage/mirage-crypto) instead.
5
6This fork renames the packages and removes Lwt/Miou dependencies, keeping only
7Eio-compatible code. It is intended for experimentation only.
8
9## Original mirage-crypto
10
11mirage-crypto is a small cryptographic library that puts emphasis on the
12applicative style and ease of use. It includes basic ciphers (AES, 3DES, RC4,
13ChaCha20/Poly1305), AEAD primitives (AES-GCM, AES-CCM, ChaCha20/Poly1305),
14public-key primitives (RSA, DSA, DH), elliptic curves (NIST P-256, P-384, P-521,
15and curve 25519), and a strong RNG (Fortuna).
16
17RSA timing attacks are countered by blinding. AES timing attacks are avoided by
18delegating to AES-NI.
19
20Mirage-crypto is a fork of the
21[ocaml-nocrypto](https://github.com/mirleft/ocaml-nocrypto) written by David
22Kaloper. It was forked with the permission of the original author in order to
23facilitate changes (e.g. build system) required by Mirage that the upstream
24didn't have time to keep up with.
25
26## Build
27
28```bash
29dune build
30dune runtest
31```
32
33## FAQ
34
35#### RNG seeding
36
37If RNG fails with `Fatal error: exception Unseeded_generator`, you need to
38seed it.
39
40```OCaml
41let () = Crypto_rng_unix.use_default ()
42```