Require sha.sha.
Local Open Scope logic.

(* Specifications: *)
Lemma body_hmac_simple: semax_body HmacVarSpecs HmacFunSpecs
f_HMAC HMAC_spec.
Lemma key_vector l:
length (bytesToBits (HMAC_SHA256.mkKey l)) = b.
Lemma change_compspecs_t_struct_SHA256state_st':
@data_at_ spec_sha.CompSpecs Ews t_struct_SHA256state_st =
@data_at_ CompSpecs Ews t_struct_SHA256state_st.
Lemma body_hmac_cleanup: semax_body HmacVarSpecs HmacFunSpecs
f_HMAC_cleanup HMAC_Cleanup_spec.
(*Here's the proof for the alternative specification:*)
Lemma cleanupbodyproof1 Espec wsh c h
(Hwsh: writable_share wsh):
@semax CompSpecs Espec (func_tycontext f_HMAC_cleanup HmacVarSpecs HmacFunSpecs nil)
(PROP  ()
LOCAL  (temp _ctx c)
SEP  (EX  key : list byte, hmacstate_PreInitNull wsh key h c))
(Ssequence (fn_body f_HMAC_cleanup) (Sreturn None))
(frame_ret_assert
(function_body_ret_assert tvoid
(PROP  ()
LOCAL ()
SEP
(data_block wsh
(list_repeat (Z.to_nat (sizeof t_struct_hmac_ctx_st)) Byte.zero)
c))) emp).
Lemma body_hmac_cleanup1: semax_body HmacVarSpecs HmacFunSpecs
f_HMAC_cleanup HMAC_Cleanup_spec1.