EasyCrypt's fel over a procedure the oracles call #
fel cntr step q bad [M : pre] inv?
EC's fel names, between brackets, the procedures whose calls may set the failure event bad.
They need not be the adversary's oracles: Gcol.eca's Pr_col names Gcol.sample_c, which the
oracles S.f, S.fi, M.f call. EC then checks the rest of the oracles' code syntactically:
it must not touch the counter and bad other than through the named procedures.
Here (phoareStmt_fel_inner): the named procedure has EC's premises (FelProc, as FelOracle
with pre a condition on all the globals — it may read what the oracles write), from which its
calls do not increase fel's potential (FelProc.ewp_le); every oracle satisfies the syntactic
check StmtWithHoles.ExpDecr for that potential (its writes keep the view of the counter, bad
and inv; its calls are to the named procedure or check again), which exp_decr discharges.
EC's premises of fel for a procedure p named in [p : pre], over the view L.get of the
globals; pre a condition on the globals themselves (FelOracle with pre read through L).
a call that may set
badis one of theqthe bound pays for- step : phoareProc (fun (x : sig.ParamType) (g : VariableAssignment) => inv (L.get g) ∧ ¬bad (L.get g) ∧ pre g) p (fun (x : sig.ret) (g' : VariableAssignment) => indicatorE (bad (L.get g'))) (fun (x1 x2 : ENNReal) => x1 ≤ x2) fun (x : sig.ParamType) (g : VariableAssignment) => step (cntr (L.get g))
… and sets it with probability at most
step cntr - incr (c : ℤ) : hoareProc (fun (x : sig.ParamType) (g : VariableAssignment) => inv (L.get g) ∧ ¬bad (L.get g) ∧ pre g ∧ cntr (L.get g) = c) p fun (x : sig.ret) (g' : VariableAssignment) => inv (L.get g') ∧ (bad (L.get g') ∨ c < cntr (L.get g'))
… and increases the counter (unless it set
bad) - same (c : ℤ) : hoareProc (fun (x : sig.ParamType) (g : VariableAssignment) => inv (L.get g) ∧ ¬bad (L.get g) ∧ ¬pre g ∧ cntr (L.get g) = c) p fun (x : sig.ret) (g' : VariableAssignment) => inv (L.get g') ∧ ¬bad (L.get g') ∧ c ≤ cntr (L.get g')
the other calls do not set
badnor decrease the counter - keep : hoareProc (fun (x : sig.ParamType) (g : VariableAssignment) => inv (L.get g) ∧ bad (L.get g)) p fun (x : sig.ret) (g' : VariableAssignment) => inv (L.get g') ∧ bad (L.get g')
badpersists
Instances For
The step of the potential for a procedure named in fel's brackets: its calls do not
increase felPotential in expectation (as FelOracle.ewp_le).
EC's fel with the bad event set in procedures the oracles call: D applied to oracles
whose bodies pass the syntactic check ExpDecr for fel's potential, started where inv holds
and bad does not, ends in bad with probability at most ∑_{i ∈ [cntr, q)} step i.
EC's fel … [M : pre] on a statement, M a procedure the oracles call: as
phoareStmt_fel, the oracles checked syntactically (ExpDecr, with M's step FelProc.ewp_le
for its calls), the event E at most bad.
EC's fel … [M : pre] on a statement with code after the adversary: as
phoareStmt_fel_inner, the code s₁ after the call checked like the oracles (ExpDecr: EC's
Gext.distinguish resamples after D, through ReSample.f).
indicatorE is monotone.
A write ∀ v σ, L.get (x.set v σ).globals = L.get σ.globals to a global X outside the view
L (x its lift to the program state), the disjointness by fp_disjoint (exp_decr_write
takes it from a hypothesis).
Equations
- GaudisCrypt.FelInner.tacticExp_decr_write_fp = Lean.ParserDescr.node `GaudisCrypt.FelInner.tacticExp_decr_write_fp 1024 (Lean.ParserDescr.nonReservedSymbol "exp_decr_write_fp" false)
Instances For
expDecrSplit (Logic/ExpectationFrame.lean) for fel: a call's step lemma is also looked for
at default transparency when none matches reducibly (a named procedure reached through an
oracle record, Iter(ReSample)'s Orcl.f (Orcl.mk {f := ReSample.f})).
For each statement on the right spine of s (through the lets of the locals): whether it
calls an applied module (Module.app), the adversary's call.
EC's fel cntr step q bad [M : pre, …] inv with procedures M that the oracles call (see
the module docstring); inv may be left out (EC's true).
Equations
- One or more equations did not get rendered due to their size.