(** Decoding after encoding *)

(* Specifications: *)
Lemma int_of_bytes_of_int:
forall n x,
int_of_bytes (bytes_of_int n x) = x mod (two_p (Z.of_nat n * 8)).
Lemma rev_if_be_involutive:
forall l, rev_if_be (rev_if_be l) = l.
Lemma decode_encode_int:
forall n x, decode_int (encode_int n x) = x mod (two_p (Z.of_nat n * 8)).
Lemma decode_encode_int_1:
forall x, Int.repr (decode_int (encode_int 1 (Int.unsigned x))) = Int.zero_ext 8 x.
Lemma decode_encode_int_2:
forall x, Int.repr (decode_int (encode_int 2 (Int.unsigned x))) = Int.zero_ext 16 x.
Lemma decode_encode_int_4:
forall x, Int.repr (decode_int (encode_int 4 (Int.unsigned x))) = x.
Lemma decode_encode_int_8:
forall x, Int64.repr (decode_int (encode_int 8 (Int64.unsigned x))) = x.
Lemma int_of_bytes_of_int:
forall n x,
int_of_bytes (bytes_of_int n x) = x mod (two_p (Z.of_nat n * 8)).
Lemma rev_if_be_involutive:
forall l, rev_if_be (rev_if_be l) = l.
Lemma decode_encode_int:
forall n x, decode_int (encode_int n x) = x mod (two_p (Z.of_nat n * 8)).
Lemma decode_encode_int_1:
forall x, Int.repr (decode_int (encode_int 1 (Int.unsigned x))) = Int.zero_ext 8 x.
Lemma decode_encode_int_2:
forall x, Int.repr (decode_int (encode_int 2 (Int.unsigned x))) = Int.zero_ext 16 x.
Lemma decode_encode_int_4:
forall x, Int.repr (decode_int (encode_int 4 (Int.unsigned x))) = x.
Lemma decode_encode_int_8:
forall x, Int64.repr (decode_int (encode_int 8 (Int64.unsigned x))) = x.