Local Open Scope logic.
Opaque HMAC256.
Opaque hmac256drbgabs_generate.
Opaque HMAC256_DRBG_generate_function.
Opaque mbedtls_HMAC256_DRBG_generate_function.

(* Specifications: *)
Lemma while_loop_post_incremental_snd:
forall key0 V0 n out_len,
0 <= (n * 32)%Z <= out_len ->
(n * 32)%Z <> out_len ->
snd (HMAC_DRBG_generate_helper_Z HMAC256 key0 V0 (n * 32)%Z) ++
fst
(HMAC_DRBG_generate_helper_Z HMAC256 key0 V0
((n * 32)%Z + Z.min 32 (out_len - (n * 32)%Z))) =
snd
(HMAC_DRBG_generate_helper_Z HMAC256 key0 V0
((n * 32)%Z + Z.min 32 (out_len - (n * 32)%Z))).
Lemma while_loop_post_incremental_fst:
forall key0 V0 n out_len,
0 <= (n * 32)%Z <= out_len ->
(n * 32)%Z <> out_len ->
fst (HMAC_DRBG_generate_helper_Z HMAC256 key0 V0
((n * 32)%Z + Z.min 32 (out_len - (n * 32)%Z))) =
HMAC256 (fst (HMAC_DRBG_generate_helper_Z HMAC256 key0 V0 (n * 32)%Z)) key0.
Lemma while_loop_post_sublist_app:
forall key0 V0 n out_len,
0 <= (n * 32)%Z <= out_len ->
Zlength V0 = 32 ->
sublist 0 (n * 32)
(snd (HMAC_DRBG_generate_helper_Z HMAC256 key0 V0 (n * 32))) ++
sublist 0 (Z.min 32 (out_len - n * 32))
(fst
(HMAC_DRBG_generate_helper_Z HMAC256 key0 V0
(n * 32 + Z.min 32 (out_len - n * 32)))) =
sublist 0 (n * 32 + Z.min 32 (out_len - n * 32))
(snd (HMAC_DRBG_generate_helper_Z HMAC256 key0 V0 (n * 32)) ++
fst
(HMAC_DRBG_generate_helper_Z HMAC256 key0 V0
(n * 32 + Z.min 32 (out_len - n * 32)))).