package mirage-crypto-rng

  1. Overview
  2. Docs
A cryptographically secure PRNG

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mirage-crypto-2.0.2.tbz
sha256=739a9d39f34027fbc93557f87c5cac4190a52bddadff72f212faa803d6215874
sha512=6b72c77026d91d3a8695012f229c54f8131c873955c1ac2177a5f4b26b38d6ff71627fdc264530556830d38e098fe8d9a8fc1504659b75a18c2bf565bb4d896f

Description

Mirage-crypto-rng provides a random number generator interface, and implementations: Fortuna, HMAC-DRBG, getrandom/getentropy based (in the unix sublibrary)

Published: 25 Aug 2025

README

mirage-crypto - Cryptographic primitives for MirageOS

v2.0.2

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.

Mirage-crypto-rng embeds the former mirage-entropy opam package, which implements various entropy sources:

  • non-deterministic execution time (used at initial seeding, see the whirlwind RNG paper)
  • a hook into the Lwt event loop that collects a timestamp of each event
  • rdseed and rdrand (x86/x86-64 only)

API documentation online

Build

dune build
dune runtest

FAQ

RNG seeding

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

let () = Mirage_crypto_rng_unix.use_default ()

Dependencies (7)

  1. digestif >= "1.1.4"
  2. mirage-crypto = version
  3. logs
  4. duration
  5. dune-configurator >= "2.0.0"
  6. dune >= "2.7"
  7. ocaml >= "4.14.0"

Dev Dependencies (3)

  1. ohex with-test & >= "0.2.0"
  2. randomconv with-test & >= "0.2.0"
  3. ounit2 with-test

Used by (53)

  1. albatross = "2.1.0"
  2. anthropic
  3. awa >= "0.4.0"
  4. builder-web >= "0.2.0"
  5. caldav >= "0.2.4"
  6. capnp-rpc-net >= "1.2.4"
  7. capnp-rpc-unix >= "2.1"
  8. caqti-eio >= "2.1.2"
  9. charrua-client >= "1.6.0"
  10. cohttp-eio >= "6.1.0"
  11. conduit-mirage >= "8.0.0"
  12. dkim >= "0.8.0"
  13. dkim-mirage >= "0.8.0"
  14. dns-certify >= "10.1.0"
  15. dns-cli >= "9.1.0"
  16. dns-client >= "9.1.0"
  17. dns-client-lwt >= "10.1.0"
  18. dns-client-mirage >= "10.1.0"
  19. dns-resolver >= "10.1.0"
  20. dns-server >= "9.1.0"
  21. dns-stub >= "10.1.0"
  22. dream >= "1.0.0~alpha7"
  23. git >= "3.17.0"
  24. git-unix >= "3.17.0"
  25. http-mirage-client
  26. irmin-cli >= "3.11.0"
  27. irmin-client >= "3.11.0"
  28. jose >= "0.10.0"
  29. letsencrypt >= "1.0.0"
  30. letsencrypt-app >= "1.0.0"
  31. MlFront_Cache
  32. MlFront_Signify
  33. miou
  34. mirage-crypto-ec >= "2.0.2"
  35. mirage-crypto-pk >= "2.0.2"
  36. mirage-crypto-rng-miou-unix >= "2.0.2"
  37. mirage-crypto-rng-mirage >= "2.0.2"
  38. mrmime >= "0.7.0"
  39. oidc
  40. otr >= "1.0.0"
  41. paf >= "0.7.0"
  42. paf-cohttp >= "0.8.0"
  43. snf_mcp
  44. tcpip >= "8.2.0"
  45. tls >= "1.0.4"
  46. tls-async >= "2.0.1"
  47. tls-eio >= "2.0.1"
  48. tls-liquidsoap
  49. tls-lwt >= "2.0.1"
  50. webauthn >= "0.2.0"
  51. websocket >= "2.17"
  52. x509 >= "1.0.6"
  53. yocaml_git >= "2.2.0"

Conflicts (1)

  1. mirage-runtime < "3.8.0"
OCaml

Innovation. Community. Security.