Skip to content

Commit

Permalink
use ohex 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Mar 18, 2024
1 parent dd2bb86 commit 4db0804
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion mirage-crypto-rng.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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: """
Expand Down
2 changes: 1 addition & 1 deletion mirage-crypto.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dh.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 2 additions & 2 deletions tests/test_eio_entropy_collection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/test_entropy.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions tests/test_entropy_collection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/test_entropy_collection_async.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4db0804

Please sign in to comment.