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_OPAD: forall
(key : list byte)
(ZLI : Zlength (HMAC_SHA256.mkArg (HMAC_SHA256.mkKey key) Ipad) = 64)
(ZLO : Zlength (HMAC_SHA256.mkArg (HMAC_SHA256.mkKey key) Opad) = 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) Opad)) ++
sublist i 64
(map Vubyte
(HMAC_SHA256.mkArg (HMAC_SHA256.mkKey key) Ipad)))
(Vubyte
(Byte.xor (Byte.repr 92)
(nth (Z.to_nat i) (HMAC_SHA256.mkKey key) Byte.zero))) =
sublist 0 (i + 1)
(map Vubyte (HMAC_SHA256.mkArg (HMAC_SHA256.mkKey key) Opad)) ++
sublist (i + 1) 64
(map Vubyte (HMAC_SHA256.mkArg (HMAC_SHA256.mkKey key) Ipad)).