diff --git a/mirage-crypto-rng-eio.opam b/mirage-crypto-rng-eio.opam index 6348bb0e..522e0eff 100644 --- a/mirage-crypto-rng-eio.opam +++ b/mirage-crypto-rng-eio.opam @@ -20,6 +20,7 @@ depends: [ "mirage-crypto-rng" {=version} "duration" "mtime" + "cstruct" {>= "6.1.0"} "eio_main" {with-test} "ohex" {with-test & >= "0.2.0"} ] diff --git a/rng/eio/dune b/rng/eio/dune index d268ef83..44df0317 100644 --- a/rng/eio/dune +++ b/rng/eio/dune @@ -1,4 +1,4 @@ (library (name mirage_crypto_rng_eio) (public_name mirage-crypto-rng-eio) - (libraries eio logs mirage-crypto-rng duration mtime)) + (libraries eio logs mirage-crypto-rng duration mtime cstruct)) diff --git a/tests/test_rng.ml b/tests/test_rng.ml deleted file mode 100644 index 87615c8f..00000000 --- a/tests/test_rng.ml +++ /dev/null @@ -1,26 +0,0 @@ - -let all0 cs = - let c = ref 0 in - let l = Cstruct.length cs in - for i = 0 to pred l do - if Cstruct.get_uint8 cs i = 0 then incr c - done; - l = !c - -let () = - Printf.printf "foo\n%!"; - Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna); - let rec one z n = function - | 0 -> z - | c -> - let data = Mirage_crypto_rng.generate n in - Cstruct.hexdump data; - let z' = if all0 data then succ z else z in - one z' n (pred c) - in - let iterations = 1_000 in - let all0 = one 0 260 iterations in - if all0 = iterations then - Printf.printf "all 0\n" - else - Printf.printf "%d iterations\n" iterations