(** Internal utilities for crypto-pk. *) val until : ('a -> bool) -> (unit -> 'a) -> 'a (** [until p f] repeatedly calls [f ()] until [p] holds on the result. *) val guard : bool -> 'a -> (unit, 'a) result (** [guard p err] is [Ok ()] if [p] is true, [Error err] otherwise. *)