From 469e658748abdb74b0aab0a764e3301d191f940e Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Fri, 7 Jun 2024 11:16:06 +0200 Subject: [PATCH] Uncommon: remove unused failwith --- rng/entropy.ml | 2 +- src/mirage_crypto.mli | 1 - src/uncommon.ml | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/rng/entropy.ml b/rng/entropy.ml index 0404acb8..8fe710be 100644 --- a/rng/entropy.ml +++ b/rng/entropy.ml @@ -120,7 +120,7 @@ let cpu_rng_bootstrap = | Some insn -> let cpu_rng_bootstrap id = let r = cpu_rng insn () in - if r = 0 then failwith "bad CPU RNG value"; + if r = 0 then failwith "Mirage_crypto_rng.Entropy: 0 is a bad CPU RNG value"; let buf = Bytes.create 10 in Bytes.set_int64_le buf 2 (Int64.of_int r); write_header id buf; diff --git a/src/mirage_crypto.mli b/src/mirage_crypto.mli index d5776ed8..9605d63c 100644 --- a/src/mirage_crypto.mli +++ b/src/mirage_crypto.mli @@ -38,7 +38,6 @@ module Uncommon : sig val xor_into : string -> src_off:int -> bytes -> dst_off:int -> int -> unit val invalid_arg : ('a, Format.formatter, unit, unit, unit, 'b) format6 -> 'a - val failwith : ('a, Format.formatter, unit, unit, unit, 'b) format6 -> 'a end (**/**) diff --git a/src/uncommon.ml b/src/uncommon.ml index d3264d8a..217ee2b6 100644 --- a/src/uncommon.ml +++ b/src/uncommon.ml @@ -4,7 +4,6 @@ let kasprintf k fmt = Format.(kfprintf (fun _ -> k (flush_str_formatter ())) str_formatter fmt) let invalid_arg fmt = kasprintf invalid_arg ("Mirage_crypto: " ^^ fmt) -let failwith fmt = kasprintf failwith ("Mirage_crypto: " ^^ fmt) let (//) x y = if y < 1 then raise Division_by_zero else