Definition sha_splitandpad_blocks (msg : Blist) : list Blist :=
  toBlocks (sha_splitandpad_inc msg).

(* Specifications: *)
Lemma InBlocks_Forall_512 b: (InBlocks 512 b) -> Forall (fun x : list bool => length x = 512%nat) (toBlocks b).
Lemma sha_splitandpad_blocks_512 m: Forall (fun x => length x = 512%nat) (sha_splitandpad_blocks m).
Lemma concat_toBlocks_id l: InBlocks 512 l -> concat (toBlocks l) = l.
Theorem HMAC_list_concat_sap_instantiated h (HH: forall x y, length x = c -> length y = b -> length (h x y) = c) iv (IV: length iv = c) (op ip : Blist) (IL: length ip = b) (OL: length op = b) (FOLD_hash_blocks_eq : forall (l : Blist) (ls : list Blist), length l = b -> Forall (fun x : list bool => length x = b) ls -> fold_left h (l :: ls) iv = hash_blocks_bits _ B h iv (l ++ concat ls)) : forall (k m : Blist), length k = b -> HMAC_List.HMAC c p h iv sha_splitandpad_blocks fpad op ip k m = (* Note use of sha_splitandpad_blocks and sha_splitandpad_inc' (= concat the blocks) *) HMAC_Concat.HMAC c p B h iv sha_splitandpad_inc fpad op ip k m.
Lemma len_min : forall {A : Type} (l : list A), (length l >= 0)%nat.
Theorem fold_hash_blocks_eq_ind : forall (l : list Blist) (iv : Blist), Forall (fun x => length x = 512%nat) l -> fold_left sha_h l iv = hash_blocks_bits _ B sha_h iv (concat l).
Theorem fold_hash_blocks_eq : forall (l : Blist) (ls : list Blist), length l = 512%nat -> Forall (fun x => length x = 512%nat) ls -> fold_left sha_h (l :: ls) sha_iv = hash_blocks_bits _ B sha_h sha_iv (l ++ concat ls).
Theorem HMAC_list_concat_explicit : forall (k m : Blist) (op ip : Blist), length k = b -> length op = b -> length ip = b -> HMAC_List.HMAC c p sha_h sha_iv sha_splitandpad_blocks fpad op ip k m = (* Note use of sha_splitandpad_blocks and sha_splitandpad_inc' (= concat the blocks) *) HMAC_Concat.HMAC c p B sha_h sha_iv sha_splitandpad_inc fpad op ip k m.
Lemma toBlocks_app_split l1 l2: length l1 = 512%nat -> toBlocks (l1 ++ l2) = toBlocks l1 ++ toBlocks l2.