EasyCrypt's up-to-bad abstract call call (_: bad, I, J) — the rule #
equiv_call (_ : §G1.bcol ∨ §G1.bext, ={C.c, C.queries} ∧ INV …, FMap.dom §C.queries{2} [])
EC's call (_: bad, I, J) on D(O₁).f ~ D(O₂).f (D declared, O₁, O₂ concrete): before
the bad event (on the right) the two runs agree on glob D, the results and I; after it, only
J is kept. prhlProc_abstract_call_upto_ec is prhlProc_abstract_call_upto_module
(Logic/AbstractCallUpto.lean) with EC's premises:
- per oracle procedure
o, EC'sequiv[ O₁.o ~ O₂.o : !bad{2} /\ ={arg} /\ I ==> if bad{2} then J else ={res} /\ I ],={glob D}framed syntactically (the oracles' writes keepglob D,StmtWithHoles.WritesKeep); - EC's right premise
forall &1, phoare[ O₂.o : bad /\ J ==> bad /\ J ] = 1; - the left premise as a Hoare triple
Jis kept byO₁.oafterbad; D(O₁)andD(O₂)lossless.
Deviation (exception E11 of the SHA-3 port, notes/SHA3/Exceptions.md): EC asks the left
oracles lossless only after the bad event (forall &2, bad{2} => phoare[ O₁.o : J ==> J ] = 1),
and D_ll with them; the rule here asks D(O₁), D(O₂) lossless outright (the tactic derives
that from D_ll and each oracle's islossless), since its coupling after the bad event needs the
adversary's remaining runs lossless. Every use in the SHA-3 proofs proves the oracles lossless
outright.
The tactic equiv_call (_ : bad, I[, J]) (bad unsided, about the right state; I, J
relational): the global variables the three read become the view L (EC's invariants on memories,
here on L's contents), and the goals come in EC's order —
D_ll's statement (∀ (F <: … {-D}) (P <: … {-D}), islossless P.f → … → islossless D(F, P), the oracles' procedures in EC's order: the last component's first), closed byexact D_ll(forDdeclaredwith glob R,Logic/DeclareModule.lean, the statement is againstR:∀ (F <: … {-R}) …);- per oracle procedure, in that order: the equivalence, the left oracle's
islossless, the right one'sphoare[ … : bad ∧ J ==> bad ∧ J ] = 1, and (the deviation) the right one'sislossless; - the code before the calls.
The frame (
={glob D}kept by the oracles),L's disjointness fromD, the oracles' countable arguments and, whenJdoes not read the left side,J's preservation on the left are closed.
phoare[ p : A ==> B ] = 1: B holds after every run from A (a Hoare triple).
EC's call (_: bad, I, J) on an abstract procedure: see the module docstring.
EC's call (_: bad, I, J) with ={glob P, …} in I: prhlProc_abstract_call_upto_ec
with the region F of those globs (and glob D) kept equal, which the oracles' judgments
keep themselves (they may change it: glob P of an oracle's own module).
prhlProc_abstract_call_upto_ecF with EC's precondition in full: the bad event may have
happened before the call (then only bad and J are asked: EC's if bad{2} then J else ={args, glob} /\ I).
EC's abstract call (_: ={…} /\ I) with the region glob D alone: the oracles' judgments
are EC's ={arg} /\ I ==> ={res} /\ I, ={glob D} framed syntactically (their writes keep
glob D, StmtWithHoles.WritesKeep).
The frame goals StmtWithHoles.WritesKeep (FVP.fvP D).touched_getter.get o.body of the k
oracle procedures (one goal gw for all holes): each split down to its writes, a write to a local
or a global outside glob D (D's restriction, fp_disjoint) closed.
Equations
- One or more equations did not get rendered due to their size.
Instances For
§x without a side ↦ §x{2}: EC's bad is about the right memory.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The conditions bad, I, J (functions of the two states) on the contents of the global
variables they read: the lens L of those variables (in order of appearance), its content type
Ω, and bad, I, J as predicates on Ω.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's ={glob X, …} in the invariant I of call (_: bad, I, J) (I that or ={…} ∧ rest):
a declared X (a local) leaves ={…}, its glob joins the region kept equal (returned, as
FVP.fvP X); a concrete module's glob is its global variables (DeclareModule.globalVarsOf).
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's D_ll: ∀ (X₁ : C₁) [Module.Declared X₁ G] …, islossless (in order) → islossless D(X₁, …), over the oracles' component module types Cs.
Equations
- GaudisCrypt.ECCallUpto.llStatement D G Cs order accFn? = GaudisCrypt.ECCallUpto.llStatement.go D G Cs order accFn? 0 #[]
Instances For
EC's call (_: bad, I, J): see the module docstring.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A region's view of a conditional state is the conditional of the views (a conditional write,
RO.get's if (x ∉ m) m.[x] <- r, under glob D).
Succeeds when the goal shows a write under a getter, g.get (x.set v σ): the shape
touched_set_of_le_compl rewrites. glob_simp's guard: the rw with the lemma's pattern left
open, when nothing matches, tries to unify it with every get in the goal, and on a large
invariant that is seconds (1.3G heartbeats a call in Handle.CF_G1).
Equations
- GaudisCrypt.tacticGlob_set_present = Lean.ParserDescr.node `GaudisCrypt.tacticGlob_set_present 1024 (Lean.ParserDescr.nonReservedSymbol "glob_set_present" false)
Instances For
EC's implicit ={glob D} across code writing outside glob D: each write x.set v g under
(FVP.fvP D).touched_getter.get removed (touched_set_of_le_compl, x outside glob D by
fp_disjoint), as long as one is found (glob_set_present says whether there is one to look
for); the view taken into conditional states first.
Equations
- tacticGlob_simp = Lean.ParserDescr.node `tacticGlob_simp 1024 (Lean.ParserDescr.nonReservedSymbol "glob_simp" false)
Instances For
EC's call (_: ={glob A, x, …} /\ I) on an abstract procedure D(O₁) ~ D(O₂) (D
declared): the declared modules' globs (and glob D) a region kept equal, the other items and
the variables I reads a view L on which the whole invariant is a relation
(prhlProc_abstract_call_moduleF). Goals: per oracle procedure (EC's order: the last
component's first) its judgment, then the code before the call.
Equations
- One or more equations did not get rendered due to their size.
Instances For
equiv_call (_ : cond) for cond an invariant ={…} ∧ I, or ={…} alone (see
equivCallInvAnd).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The declared module D of the left side's last statement, a call of D(O) (D a local),
if it is one; the goal left as it is.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Do both sides of the relational goal end with a call of an applied declared module
(D(O₁) ~ D(O₂), D a local)?
Equations
- One or more equations did not get rendered due to their size.