Require sha.sha.
Local Open Scope logic.
(*TODO: eliminate*)
Ltac canon_load_result ::= idtac.
(* Lemma eval_cast_tuchar_of_isbyteZ q: isbyteZ q -> eval_cast tuchar tuchar (Vint (Int.repr q)) = Vint (Int.repr q).  Lemma Znth_map_Vint_is_int_I8: forall l (i : Z) (F: Forall isbyteZ l), 0 <= i < Zlength l -> is_int I8 Unsigned (Znth i (map Vint (map Int.repr l))).  Lemma Znth_map_Vint_is_int_I8': forall l (i : Z) , 0 <= i < Zlength l -> is_int I8 Unsigned (Znth i (map Vint (map Int.repr (map Byte.unsigned l)))). *)

Lemma UPD_IPAD: forall
(key : list byte)
(ZLI : Zlength
(HMAC_SHA256.mkArg (HMAC_SHA256.mkKey key) Ipad) =
64)
(i : Z)
(I : 0 <= i < 64)
(X : Znth i (map Vubyte (HMAC_SHA256.mkKey key)) =
Vubyte (nth (Z.to_nat i) (HMAC_SHA256.mkKey key) Byte.zero)),
upd_Znth i
(sublist 0 i
(map Vubyte
(HMAC_SHA256.mkArg (HMAC_SHA256.mkKey key) Ipad)) ++
sublist i 64 (default_val (Tarray tuchar 64 noattr)))
(Vubyte
(Byte.xor (nth (Z.to_nat i) (HMAC_SHA256.mkKey key) Byte.zero) (Byte.repr 54))) =
sublist 0 (i + 1)
(map Vubyte
(HMAC_SHA256.mkArg (HMAC_SHA256.mkKey key) Ipad)) ++
sublist (i + 1) 64 (default_val (Tarray tuchar 64 noattr)).