diff --git a/.test-mirage.sh b/.test-mirage.sh index 50ec33cc..9c5a20dc 100755 --- a/.test-mirage.sh +++ b/.test-mirage.sh @@ -5,12 +5,11 @@ set -ex opam install --confirm-level=unsafe-yes "mirage>4" # to satisfy hardcoded version constraints in mirage, we need to be < 0.12.0 # and "dune subst" doesn't work on these PR checkouts -version='version: "0.11.99~dev"' +version='version: "1.99.0~dev"' echo $version >> mirage-crypto-rng-mirage.opam echo $version >> mirage-crypto-rng.opam echo $version >> mirage-crypto.opam echo $version >> mirage-crypto-pk.opam -opam pin add -yn mirage-random.3.99 --dev (mirage configure -t unix -f mirage/config.ml && gmake depend && dune build --root . mirage/dist/ && mirage/dist/crypto-test) || exit 1 (mirage configure -t hvt -f mirage/config.ml && gmake depend && dune build --root . mirage/dist/) || exit 1 if [ $(uname -m) = "amd64" ] || [ $(uname -m) = "x86_64" ]; then 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