Definition concat {A : Type} (l : list (list A)) : list A :=
flat_map id l.
induction l; simpl; intros. constructor.
econstructor. 2: reflexivity.
apply Forall_inv in F; trivial.
apply IHl. apply Forall_tl in F; trivial.
Qed.
(* Replacing splitVector *)
Definition splitList {A : Type} (n : nat) (l : list A) : (list A * list A) :=
(firstn n l, skipn n l).
(* Replacing BVxor *)
Definition BLxor (xs : Blist) (ys : Blist) :=
map (fun p => xorb (fst p) (snd p)) (combine xs ys).
Function hash_blocks_bits (b:nat) (B:(0<b)%nat) (hash_block_bit : Blist -> Blist -> Blist) (r: Blist)
(msg: Blist) {measure length msg} : Blist :=
match msg with
| nil => r
| _ => hash_blocks_bits b B hash_block_bit (hash_block_bit r (firstn b msg)) (skipn b msg)
end.

Lemma hash_blocks_bits_len c b (B:(0<b)%nat) h
(HH: forall x y, length x = c -> length y = b -> length (h x y)  = c)
r l: length r = c ->
InBlocks b l ->
length (hash_blocks_bits b B h r l) = c.