Skip to content

Commit 14029b6

Browse files
dinosaurehannesm
authored andcommitted
Add a comment about the goal of Pfortuna
1 parent 3723068 commit 14029b6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

rng/miou/pfortuna.ml

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
(* Pfortuna is a re-implementation of Fortuna with a mutex. The goal of this
2+
module is to provide a global and domain-safe RNG. The implementation use
3+
[Miou.Mutex] instead of [Mutex] - [Pfortuna] is only available as part of
4+
the [mirage-crypto-rng-miou-unix] package. Thus, in the context of Miou,
5+
[Pfortuna] can be used and recommended in place of [Fortuna], so that the
6+
user can generate random numbers in parallel in several domains.
7+
8+
{[
9+
let () = Miou_unix.run @@ fun () ->
10+
let rng = Mirage_crypto_rng_miou_unix.(initialize (module Pfortuna)) in
11+
...
12+
Mirage_crypto_rng_miou_unix.kill rng
13+
]} *)
14+
115
open Mirage_crypto
216
open Mirage_crypto.Uncommon
317

0 commit comments

Comments
 (0)