Section IND_CPA_SecretKey_OI_impl_O.
Hypothesis KeyGen_wf :
well_formed_comp KeyGen.
Hypothesis A2_wf :
forall a,
well_formed_oc (A2 a).
Variable maxA : nat.
Hypothesis maxA_correct :
forall ls s_A,
In (ls, s_A) (getSupport A1) ->
length ls <= maxA.
Variable IND_CPA_Adv : Rat.
Hypothesis IND_CPA_Adv_correct :
(forall i,
IND_CPA_SecretKey_O_Advantage (A_c
(B1 defA _ _ A1 i)
A2
(B2
(fun x : A =>
key <-$ KeyGen;
z <-$
(A2 x) unit unit_EqDec (EncryptOracle Ciphertext_EqDec key) tt;
[b, _]<-2 z; ret b)
(fun x : A =>
key <-$ KeyGen;
z <-$
(A2 x) unit unit_EqDec
(EncryptNothingOracle Ciphertext_EqDec ptDefault key) tt;
[b, _]<-2 z; ret b) B_EqDec A3)
)
_
ptDefault
<= IND_CPA_Adv)%rat.

Theorem IND_CPA_SecretKey_OI_G0_Hybrid :
Pr[IND_CPA_SecretKey_OI_G0] == Pr[ListHybrid_G _ A1 A3
(fun x =>
key <-$ KeyGen;
[b, _] <-$2 (A2 x) _ _ (EncryptOracle _ key) tt;
ret b
)].