(* Definition Vubyte (c: Byte.int) : val := Vint (Int.repr (Byte.unsigned c)).  Lemma Znth_map_Vubyte: forall (i : Z) (l : list byte), 0 <= i < Zlength l -> Znth i (map Vubyte l)  = Vubyte (Znth i l). Locate Znth_map_Vubyte. Hint Rewrite Znth_map_Vubyte using list_solve : norm entailer_rewrite. *)
Local Open Scope nat.
Fixpoint map2 {A B C: Type} (f: A -> B -> C) (al: list A) (bl: list B) : list C :=
match al, bl with
| a::al', b::bl' => f a b :: map2 f al' bl'
| _, _ => nil
end.
Local Open Scope Z.
Definition roundup (a b : Z) := (a + (b-1))/b*b.

Lemma roundup_minus:
forall a b,  b > 0 -> roundup a b - a = (- a) mod b.