Local Open Scope logic.
(* mocked_md *)
Require Export hmacdrbg.hmac_drbg_compspecs.
Ltac fix_hmacdrbg_compspecs :=
rewrite (@data_at__change_composite spec_hmac.CompSpecs hmac_drbg_compspecs.CompSpecs
hmac_drbg_compspecs.CompSpecs_Preserve) by reflexivity.
Declare Module UNDER_SPEC : HMAC_ABSTRACT_SPEC.
Definition mdstate: Type := (val * (val * val))%type.
Definition md_info_state: Type := val%type.
Definition t_struct_md_ctx_st := Tstruct _mbedtls_md_context_t noattr.
Definition md_relate (key data : list byte) (r:mdstate) :=
malloc_token Ews (Tstruct _hmac_ctx_st noattr) (snd (snd r)) *
UNDER_SPEC.REP Ews (UNDER_SPEC.hABS key data) (snd (snd r)).
Definition md_full (key: list byte) (r:mdstate) :=
malloc_token Ews (Tstruct _hmac_ctx_st noattr) (snd (snd r)) *
UNDER_SPEC.FULL Ews key (snd (snd r)).
Definition md_empty (r:mdstate) :=
malloc_token Ews (Tstruct _hmac_ctx_st noattr) (snd (snd r)) *
UNDER_SPEC.EMPTY Ews (snd (snd r)).

Lemma md_relate_full: forall key data r, md_relate key data r |-- md_full key r.