Section HMAC_AbstractEQ.
Variable c:nat.
Variable p:nat.
Definition b := (c+p)%nat.
Variable h_v : Bvector c -> Bvector b -> Bvector c.
Variable iv_v : Bvector c.
Variable P : Blist -> Prop. (*example: P m := NPeano.divide 8 (length m)*)
Definition Message : Set := {m: Blist | P m}.
Definition Message2Blist(msg:Message):Blist := let (m,_) := msg in m.
Variable splitAndPad_v : Blist -> list (Bvector b).
Definition wrappedSAP (msg:Message): list (Bvector b) :=
splitAndPad_v (Message2Blist msg).
Variable splitAndPad_inj: forall b1 b2, splitAndPad_v b1 = splitAndPad_v b2 ->
P b1 -> P b2 -> b1=b2.
Definition wrappedSAP_1_1: forall msg1 msg2, wrappedSAP msg1=wrappedSAP msg2 -> msg1=msg2.
Variable fpad_v : Bvector c -> Bvector p.
Variable opad_v ipad_v : Bvector b.
(*End HMAC_AbstractEQ.  Section HMAC_Abstract_List. Variable c:nat. Variable p:nat. Variable h_v : Bvector c -> Bvector (b c p) -> Bvector c. Variable iv_v : Bvector c. Variable P : Blist -> Prop. (*example: P m := NPeano.divide 8 (length m)*)
Variable splitAndPad_v : Blist -> list (Bvector (b c p)).
Variable splitAndPad_inj: forall b1 b2, splitAndPad_v b1 = splitAndPad_v b2 ->
P b1 -> P b2 -> b1=b2.
Variable fpad_v : Bvector c -> Bvector p.
Variable opad_v ipad_v : Bvector (b c p).
*)
(* h *)
Variable h: Blist -> Blist -> Blist.
Hypothesis h_eq : forall block_v block_l
(HVL: block_l = Vector.to_list block_v)
ivA ivB (IV: ivA = Vector.to_list ivB),
h ivA block_l = Vector.to_list (h_v ivB block_v).
Variable iv: Blist.
Hypothesis iv_eq: iv=Vector.to_list iv_v.
Variable fpad : Blist -> Blist.
Hypothesis fpad_eq: forall v l, l = Vector.to_list v ->
fpad l = Vector.to_list (fpad_v v).

Lemma app_fpad_eq v l (L:l = Vector.to_list v):
HMAC_List.app_fpad fpad l = Vector.to_list (app_fpad fpad_v v).