Definition swap (i: int) : int :=
 Int.or (Int.shl (Int.and i (Int.repr 255)) (Int.repr 24))
   (Int.or (Int.shl (Int.and (Shr 8 i) (Int.repr 255)) (Int.repr 16))
      (Int.or (Int.shl (Int.and (Shr 16 i) (Int.repr 255)) (Int.repr 8))
         (Shr 24 i))).

(* Specifications: *)
Lemma swap_swap: forall w, swap (swap w) = w.
Lemma map_swap_involutive: forall l, map swap (map swap l) = l.
Lemma length_intlist_to_bytelist: forall l, length (intlist_to_bytelist l) = (4 * length l)%nat.
Lemma intlist_to_bytelist_bytes_to_int_cons: forall a b c d l, intlist_to_bytelist (bytes_to_Int a b c d :: l) = a::b::c::d:: intlist_to_bytelist l.
Lemma intlist_to_bytelist_to_intlist: forall il: list int, bytelist_to_intlist (intlist_to_bytelist il) = il.
Lemma intlist_to_bytelist_app: forall al bl, intlist_to_bytelist (al++bl) = intlist_to_bytelist al ++ intlist_to_bytelist bl.
Lemma int_unsigned_inj: forall a b, Int.unsigned a = Int.unsigned b -> a=b.
Lemma intlist_to_bytelist_inj: forall al bl, intlist_to_bytelist al = intlist_to_bytelist bl -> al=bl.
Lemma Zlength_intlist_to_bytelist_app: forall al bl, Zlength (intlist_to_bytelist (al++bl)) = (Zlength (intlist_to_bytelist al) + Zlength (intlist_to_bytelist bl))%Z.
Lemma nth_list_repeat: forall A i n (x :A), nth i (list_repeat n x) x = x.
Lemma map_list_repeat: forall A B (f: A -> B) n x, map f (list_repeat n x) = list_repeat n (f x).