diff --git a/mirage-crypto-rng.opam b/mirage-crypto-rng.opam index 47204de0..701c88cc 100644 --- a/mirage-crypto-rng.opam +++ b/mirage-crypto-rng.opam @@ -22,7 +22,7 @@ depends: [ "digestif" {>= "1.1.4"} "ounit2" {with-test} "randomconv" {with-test & >= "0.2.0"} - "ohex" {with-test} + "ohex" {with-test & >= "0.2.0"} ] conflicts: [ "mirage-runtime" {< "3.8.0"} ] description: """ diff --git a/mirage-crypto.opam b/mirage-crypto.opam index 6bcbc78b..484cda49 100644 --- a/mirage-crypto.opam +++ b/mirage-crypto.opam @@ -17,7 +17,7 @@ depends: [ "dune" {>= "2.7"} "dune-configurator" {>= "2.0.0"} "ounit2" {with-test} - "ohex" {with-test} + "ohex" {with-test & >= "0.2.0"} "eqaf" {>= "0.8"} ] conflicts: [ diff --git a/tests/test_common.ml b/tests/test_common.ml index 2767aaca..10c19c51 100644 --- a/tests/test_common.ml +++ b/tests/test_common.ml @@ -48,7 +48,7 @@ let eq_opt eq a b = match (a, b) with | (Some x, Some y) -> eq x y | _ -> false -let pp_octets pp = pp (Ohex.pp ()) +let pp_octets pp = pp (Ohex.pp_hexdump ()) let assert_oct_equal ?msg = assert_equal ~cmp:String.equal ?msg ~pp_diff:(pp_octets pp_diff) diff --git a/tests/test_dh.ml b/tests/test_dh.ml index d4bfee42..20465d16 100644 --- a/tests/test_dh.ml +++ b/tests/test_dh.ml @@ -15,7 +15,7 @@ let dh_selftest ~bits n = ~cmp:(eq_opt String.equal) ~pp_diff:(pp_diff (fun ppf -> function | None -> Format.fprintf ppf "None" - | Some a -> Format.fprintf ppf "Some(%a)" (Ohex.pp ()) a)) + | Some a -> Format.fprintf ppf "Some(%a)" (Ohex.pp_hexdump ()) a)) ~msg:"shared secret" let dh_shared_0 = diff --git a/tests/test_eio_entropy_collection.ml b/tests/test_eio_entropy_collection.ml index 71969725..b2764517 100644 --- a/tests/test_eio_entropy_collection.ml +++ b/tests/test_eio_entropy_collection.ml @@ -8,12 +8,12 @@ module Printing_rng = struct let pools = 1 let reseed ~g:_ data = - Format.printf "reseeding: %a@.%!" (Ohex.pp ()) data + Format.printf "reseeding:@.%a@.%!" (Ohex.pp_hexdump ()) data let accumulate ~g:_ source = let print data = Format.printf "accumulate: (src: %a) %a@.%!" - Mirage_crypto_rng.Entropy.pp_source source (Ohex.pp ()) data + Mirage_crypto_rng.Entropy.pp_source source Ohex.pp data in `Acc print end diff --git a/tests/test_entropy.ml b/tests/test_entropy.ml index 59d46c3e..f0984d38 100644 --- a/tests/test_entropy.ml +++ b/tests/test_entropy.ml @@ -13,7 +13,7 @@ let cpu_bootstrap_check () = try let data' = cpu_rng_bootstrap 1 in if String.equal !data data' then begin - Ohex.pp () Format.std_formatter data'; + Ohex.pp Format.std_formatter data'; failwith ("same data from CPU bootstrap at " ^ string_of_int i); end; data := data' @@ -24,7 +24,7 @@ let whirlwind_bootstrap_check () = for i = 0 to 10 do let data' = Mirage_crypto_rng.Entropy.whirlwind_bootstrap 1 in if String.equal !data data' then begin - Ohex.pp () Format.std_formatter data'; + Ohex.pp Format.std_formatter data'; failwith ("same data from whirlwind bootstrap at " ^ string_of_int i); end; data := data' @@ -34,7 +34,7 @@ let timer_check () = for i = 0 to 10 do let data' = Mirage_crypto_rng.Entropy.interrupt_hook () () in if String.equal !data data' then begin - Ohex.pp () Format.std_formatter data'; + Ohex.pp Format.std_formatter data'; failwith ("same data from timer at " ^ string_of_int i); end; data := data' diff --git a/tests/test_entropy_collection.ml b/tests/test_entropy_collection.ml index ac588e0b..bed653b2 100644 --- a/tests/test_entropy_collection.ml +++ b/tests/test_entropy_collection.ml @@ -10,12 +10,12 @@ module Printing_rng = struct let generate_into ~g:_ _buf ~off:_ _len = assert false let reseed ~g:_ data = - Format.printf "reseeding: %a@.%!" (Ohex.pp ()) data + Format.printf "reseeding:@.%a@.%!" (Ohex.pp_hexdump ()) data let accumulate ~g:_ source = let print data = Format.printf "accumulate: (src: %a) %a@.%!" - Mirage_crypto_rng.Entropy.pp_source source (Ohex.pp ()) data + Mirage_crypto_rng.Entropy.pp_source source Ohex.pp data in `Acc print diff --git a/tests/test_entropy_collection_async.ml b/tests/test_entropy_collection_async.ml index 29e434b8..d2331249 100644 --- a/tests/test_entropy_collection_async.ml +++ b/tests/test_entropy_collection_async.ml @@ -11,12 +11,12 @@ module Printing_rng = struct let generate_into ~g:_ _buf ~off:_ _len = assert false let reseed ~g:_ data = - Format.printf "reseeding: %a@.%!" (Ohex.pp ()) data + Format.printf "reseeding:@.%a@.%!" (Ohex.pp_hexdump ()) data let accumulate ~g:_ source = let print data = Format.printf "accumulate: (src: %a) %a@.%!" - Mirage_crypto_rng.Entropy.pp_source source (Ohex.pp ()) data + Mirage_crypto_rng.Entropy.pp_source source Ohex.pp data in `Acc print