diff --git a/bench/speed.ml b/bench/speed.ml index dcb25267..2447d6d6 100644 --- a/bench/speed.ml +++ b/bench/speed.ml @@ -480,10 +480,12 @@ let benchmarks = [ throughput_into name (fun dst cs -> DES.ECB.unsafe_encrypt_into ~key cs ~src_off:0 dst ~dst_off:0 (String.length cs))) ; bm "fortuna" (fun name -> - Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna); - throughput name (fun buf -> - let buf = Bytes.unsafe_of_string buf in - Mirage_crypto_rng.generate_into buf ~off:0 (Bytes.length buf))) ; + begin[@alert "-deprecated"] + Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna); + throughput name (fun buf -> + let buf = Bytes.unsafe_of_string buf in + Mirage_crypto_rng.generate_into buf ~off:0 (Bytes.length buf)) + end); bm "getentropy" (fun name -> Mirage_crypto_rng_unix.use_getentropy (); diff --git a/rng/async/mirage_crypto_rng_async.mli b/rng/async/mirage_crypto_rng_async.mli index 67982af8..78d35266 100644 --- a/rng/async/mirage_crypto_rng_async.mli +++ b/rng/async/mirage_crypto_rng_async.mli @@ -16,3 +16,4 @@ val initialize -> ?sleep:Time_ns.Span.t -> 'a Mirage_crypto_rng.generator -> unit +[@@deprecated "Use 'Mirage_crypto_rng_unix.use_default ()' instead."] diff --git a/rng/eio/mirage_crypto_rng_eio.mli b/rng/eio/mirage_crypto_rng_eio.mli index e20d179a..e14c0f3d 100644 --- a/rng/eio/mirage_crypto_rng_eio.mli +++ b/rng/eio/mirage_crypto_rng_eio.mli @@ -39,3 +39,4 @@ val run -> 'a Mirage_crypto_rng.generator -> _ env -> (unit -> 'b) -> 'b +[@@deprecated "Use 'Mirage_crypto_rng_unix.use_default ()' instead."] diff --git a/rng/lwt/mirage_crypto_rng_lwt.mli b/rng/lwt/mirage_crypto_rng_lwt.mli index fb9db2e6..af251d3c 100644 --- a/rng/lwt/mirage_crypto_rng_lwt.mli +++ b/rng/lwt/mirage_crypto_rng_lwt.mli @@ -9,3 +9,4 @@ is used to collect entropy. *) val initialize : ?g:'a -> ?sleep:int64 -> 'a Mirage_crypto_rng.generator -> unit +[@@deprecated "Use 'Mirage_crypto_rng_unix.use_default ()' instead."] diff --git a/rng/miou/mirage_crypto_rng_miou_unix.mli b/rng/miou/mirage_crypto_rng_miou_unix.mli index 057afbc8..2a025d5c 100644 --- a/rng/miou/mirage_crypto_rng_miou_unix.mli +++ b/rng/miou/mirage_crypto_rng_miou_unix.mli @@ -14,6 +14,7 @@ type rng (** Type of tasks seeding the RNG. *) val initialize : ?g:'a -> ?sleep:int64 -> 'a Mirage_crypto_rng.generator -> rng +[@@deprecated "Use 'Mirage_crypto_rng_unix.use_default ()' instead."] (** [initialize ?g ?sleep (module Generator)] will allow the RNG to operate in a returned task. This task periodically launches sub-tasks that seed the engine (using [getrandom()], [getentropy()] or [BCryptGenRandom()] depending diff --git a/rng/unix/mirage_crypto_rng_unix.mli b/rng/unix/mirage_crypto_rng_unix.mli index 46cb64c7..2df769b3 100644 --- a/rng/unix/mirage_crypto_rng_unix.mli +++ b/rng/unix/mirage_crypto_rng_unix.mli @@ -8,6 +8,7 @@ (** [initialize ~g rng] will bring the RNG into a working state. *) val initialize : ?g:'a -> 'a Mirage_crypto_rng.generator -> unit +[@@deprecated "Use 'Mirage_crypto_rng_unix.use_default ()' instead."] (** [getrandom size] returns a buffer of [size] filled with random bytes. *) val getrandom : int -> string