···33%%VERSION%%
4455mirage-crypto is a small cryptographic library that puts emphasis on the
66-applicative style and ease of use. It includes basic ciphers (AES, 3DES, RC4),
77-hashes (MD5, SHA1, SHA2 family), AEAD primitives (AES-GCM, AES-CCM), public-key
88-primitives (RSA, DSA, DH) and a strong RNG (Fortuna).
66+applicative style and ease of use. It includes basic ciphers (AES, 3DES, RC4,
77+ChaCha20/Poly1305), hashes (MD5, SHA1, SHA2 family), AEAD primitives (AES-GCM,
88+AES-CCM), public-key primitives (RSA, DSA, DH) and a strong RNG (Fortuna).
991010RSA timing attacks are countered by blinding. AES timing attacks are avoided by
1111delegating to AES-NI.
···1616facilitate changes (e.g. build system) required by Mirage that the upstream
1717didn't have time to keep up with.
18181919-Mirage-crypto-entropy embeds the former mirage-entropy opam package, which
2020-implements various entropy sources for MirageOS unikernels:
2121-- timer based ones (see [whirlwind RNG paper](https://www.ieee-security.org/TC/SP2014/papers/Not-So-RandomNumbersinVirtualizedLinuxandtheWhirlwindRNG.pdf))
1919+Mirage-crypto-rng embeds the former mirage-entropy opam package, which
2020+implements various entropy sources:
2121+- non-deterministic execution time (used at initial seeding, see the [whirlwind RNG paper](https://www.ieee-security.org/TC/SP2014/papers/Not-So-RandomNumbersinVirtualizedLinuxandtheWhirlwindRNG.pdf))
2222+- a hook into the Lwt event loop that collects a timestamp of each event
2223- rdseed and rdrand (x86/x86-64 only)
23242425[API documentation online](https://mirage.github.io/mirage-crypto/doc)
···34353536#### RNG seeding
36373737-If RNG fails with `Fatal error: exception Uncommon.Boot.Unseeded_generator`, you
3838-need to [seed][doc-entropy] it.
3838+If RNG fails with `Fatal error: exception Unseeded_generator`, you need to
3939+seed it.
4040+4141+Lwt:
4242+```OCaml
4343+let () = Mirage_crypto_rng_lwt.initialize ()
4444+```
39454046Unix:
4147```OCaml