(* modified version of sha_padding_lemmas.pad *)
Definition pad_inc (msg : list byte) : list byte :=
let n := BlockSize + Zlength msg in
msg ++ [Byte.repr 128%Z]
++ list_repeat (Z.to_nat (-(n + 9) mod 64)) Byte.zero
++ intlist_to_bytelist ([Int.repr (n * 8 / Int.modulus); Int.repr (n * 8)]).
Definition sha_splitandpad_inc (msg : Blist) : Blist :=
bytesToBits (pad_inc (bitsToBytes msg)).

(* Specifications: *)
Lemma sha_splitandpad_inc_nil: length (sha_splitandpad_inc nil) = 512%nat.
Lemma sha_splitandpad_inc_length: forall m, exists k,
(0<k /\ length (sha_splitandpad_inc m) = k * 512)%nat.
Lemma sha_splitandpad_inc_InBlocks m : InBlocks 512 (sha_splitandpad_inc m).
Lemma sha_iv_length: length sha_iv = 256%nat.
Lemma B: (0<b)%nat. unfold b; simpl. omega. Qed.
Lemma hash_blocks_bits_len': forall r l, length r = 256%nat ->
InBlocks 512 l ->
length (hash_blocks_bits _ B sha_h r l) = 256%nat.
Lemma sha_h_length iv blk: length iv = c -> length blk = b ->
length (sha_h iv blk) = c.