package mirage-crypto-rng

  1. Overview
  2. Docs
A cryptographically secure PRNG

Install

Dune Dependency

Authors

Maintainers

Sources

mirage-crypto-2.0.1.tbz
sha256=5430ce3c3e40627d2d67a8decf565a1f612d39bdb33f9b767c3bdb601ff5a196
sha512=de029e01cbb8d49f9b8fbcd02ef4777435927118c9ce7a859a8193fdbec30d1a7b3a2964ee8ec722f5fa74fec1bfdc054dcdc97ad1db6e2ced359d6c010c043a

Description

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

Published: 15 May 2025

README

mirage-crypto - Cryptographic primitives for MirageOS

v2.0.1

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 (52)

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

Conflicts (1)

  1. mirage-runtime < "3.8.0"
OCaml

Innovation. Community. Security.