Definition Equiv n:= forall k v blocks u
(G: Gen_loop_Zlist k v n = (blocks, u)) m
(M: 32*(Z.of_nat n-1) < m <=32*(Z.of_nat n)),
HMAC_DRBG_generate_helper_Z HMAC256 k v m = (u,flatten (rev blocks)).

(* Specifications: *)
Lemma E1: Equiv 1.
Lemma E2: Equiv 2.
Lemma E3: Equiv 3.
Lemma E4: Equiv 4.
Lemma E10: Equiv 10.
*)
(*Hence, by induction the following equivalence property holds*)
Lemma E_aux k: forall n v blocks u,
Gen_loop_Zlist k (HMAC256 v k) n = (blocks, u) ->
flatten (rev blocks) ++ HMAC256 u k =
HMAC256 (HMAC256 v k) k ++ flatten (rev (map (fun z : list byte => HMAC256 z k) blocks)).
Lemma E: forall n, Equiv (S n).
Lemma EE n (N:(0<n)%nat): Equiv n.
Definition GenUpdate_original_Blist (state : Blist * Blist) (n : nat) :
(list Blist * (Blist * Blist)) :=
match state with (k, v) =>
match Gen_loop_Blist k v n with (bits, v') =>
let k' := HMAC_Blist k (v' ++ zeroes) in
let v'' := HMAC_Blist k' v' in (bits, (k', v''))
end
end.
Lemma GenUpdate_original_Blist_Bvec k v n:
match GenUpdate_original_Bvec (k,v) n with (blocks,(kk,u)) =>
GenUpdate_original_Blist (@Vector.to_list _ 256 k, @Vector.to_list _ 256 v) n =
(map (@Vector.to_list _ 256) blocks, (@Vector.to_list _ 256 kk, @Vector.to_list _ 256 u))
end.