The sponge construction (EasyCrypt proof/Sponge.ec) — EC-fidelity port #
Ported on the strict tactics: Sponge_is_StdSponge (EC l. 99); the whole theory HybridIRO
(EC l. 256–1909; l. 1188–1282, the modules BlockSpongeTrans and BlockGen, are the first
port's);
Sponge_Raise_BlockSponge_f (EC l. 1922), which was the second tactic experiment and is
described below; and the final section with conclusion (EC l. 1913–2163).
Translation:
- the modules are the first port's (section
FirstPortbelow); a procedure takes its parameters as one tuple there, so a statement names them at the triple (StdSponge(P).f (x) ~ …,HybridIROLazy.f (xs, n) ~ …); - the theory
HybridIROis a namespace; its module variablesHybridIROLazy.mp,HybridIROEager.mpand those of the local cloneEROareglobal_vars; - a local clone's variables are fresh for a declared module in EC; here the restriction names
them (
-ERO.RO.m, -ERO.FRO.m).
Gap list (batch-fix later, see TRANSFER_SKILL.md §1.6):
- GAP 1 (closed 2026-11-17): a procedure of a module of one clone's module type, read at
another clone's (
LowerDist(Dist)handsBlockSponge's primitive to the bit sponge'sDist), is opened byequiv_procas EC'sprocdoes. - GAP 2: inside the library's
RO.samplethe callee is the library'sRO.getitself, not the procedure of the moduleERO.RO, so EC'sinline ERO.RO.getdoes not name it: by index. - GAP 3 (closed 2026-11-21): after a call whose result is discarded, the strict
autodid not read through the discarding write (Setter.throwaway_setis now among the reads' lemmas). - GAP 4: the abstract call asks all of
HYBRID_IRO's procedures, where EC's{HI.f}restrictsDtof: one more goal, forinit. (HybridIROLazy.init,.fare declared as the module type's procedures ofHybridIROLazy, the form in which a call of an oracle names them; the first port's own procedures are equal to them only by a rewrite.) - GAP 5 (closed 2026-11-22):
equiv_conseq Hleft its two implications when the goal's conditions are not literallyH's; it closes them now when they are logic alone, as EC's. - GAP 6 (closed 2026-11-21): the strict
autoran out of recursion depth (in its closingsimp_all) on the body of a one-sided loop whose invariant reads the other memory; a closing attempt that hits a runtime limit now leaves the goal as EC'sautodoes. - GAP 7 (closed 2026-11-21): the exit goal of a one-sided loop framed what the postcondition
reads, not what the invariant reads (
xs{1}innext_block_split_BlockSpongeTrans, added to EC'sconseqthere); its frame now has both. - GAP 8:
transitivity N (P₁ ==> Q₁) (P₂ ==> Q₂)on procedures is the ruleprhlProc_trans_ec, not a tactic: the second judgment is its own lemma, and the side conditions are over the parameter tuples (hypotheses restated byreplacebefore use). - GAP 9 (closed 2026-11-18):
BlockGen_loop_directis EC'sbyprproof, no longer the first port's restated by a rewrite. - GAP 10: after a loop, the guard's read of a local and the invariant's read of it can be
different atoms for
omega(equal byrfl):le_antisymmon the two hypotheses instead. - GAP 11:
={bs}in a condition ofequiv_transis not resolved when the two sides of the goal have absof different types, although the middle program's is the left one's:§(localVarLens "bs" (List Bool)){1} = §(localVarLens "bs" (List Bool)){2}. call (_ : ={HybridIROEager.mp})on the concretefill_inneeds its footprint, which EC reads off the code:fvP_HybridIROEager_fill_in,fvP_BIRO_IRO_fill_in(@[fp_bound]). The callee's goal (EC:if=> //; wp; rnd; auto) is then closed by the tactic.- GAP 12 (closed 2026-11-21): the strict
autoandequiv_skipran out of recursion depth on a goal whose conditions havebs{1} = take n1 bs{2}next to={bs}; EC'sskip; smt(take_size)since the closers' runtime limits are caught (2026-11-21). - GAP 13 (closed 2026-11-22):
simdid not pass an inlined call that copies its parameters and has a loop (inline HybridIROEagerTrans.next_block; sim): the loops' callee is named through the port's alias on one side, andsim's pairs of locals now compare such callees by definition. - A middle program of
transitivityis over the variables the goal mentions, not the whole memory: where EC's condition names a variable that neither side reads any more (n{2} = n1 %/ r), the conjunct is dropped; an inlined parameter keeps its name when the caller no longer reads one of that name (EC'sn0isn). equiv_conseq Hon procedures statespostwithout the precondition, where EC keeps it:equiv_conseq_pre H(Logic/ECConseqHoare.lean) where the proof needs it.exists*on a procedure judgment reads the declared parameter names (§x{1}forHybridIROEager.f'sxs). A side goal about parameters and results is over their tuple types: introduce them at the plain types (rintro ⟨xs, (n : ℤ)⟩ … (r₁ : List Bool)), restate the hypotheses byreplace, andchangethe goal, beforerworomega.- EC's
alias{2} 1 with wis not needed: the sampled block is the inlined callee's localr(two localsbs,rof different types on the two sides are read as§(localVarLens "bs" (List Bool)){1}). - A statement that names
HIRO(…).f's parameters(xs, n)as EC does gets a warning: the module typeHYBRID_IROdeclares them(x, n). - GAP 14 (exception E2): EC's module type
SIMULATORlists the oracles of each procedure (init { },f {F.f},fi {F.f});declare moduleknows them only for a functor with one procedure. The final section states them as a hypothesis (BlockSim_rep, the first port'sSIMULATOR.Representable). From it:BlockSim_init_callfor EC'scall (_ : true)onBlockSim(F).init, and EC'sproc (I)onBlockSim(F).f,.fibyequiv_proc (I)(Logic/ECProcInv.lean) with the first port's rulesSIMULATOR.call_f,call_fitagged@[proc_inv]. EC'sswappastBlockSim(F).inithas no footprint to check (the oracle list is known for the procedure's behaviour, not for its code): the call's invariant says what the swap would (equiv_call (_ : ={glob Dist, glob BlockSim} ∧ §HybridIROLazy.mp{2} = FMap.empty), the ruleSIMULATOR.call_init). - GAP 15:
simfinds no equality set for a call ofDistwhose oracles are the same on both sides when the precondition's equalities are aglobregion and a variable (={glob Dist, glob BlockSim, HybridIROLazy.mp}): the call with EC's set (equiv_call (_ : ={glob BlockSim} ∧ §mp{1} = §mp{2})), the simulator's oracles byequiv_proc (I)andsim, the concrete one by a judgment={x, mp} ==> ={res, mp}(sim) underequiv_conseq_frame. - GAP 16:
equiv_autoonskip ~ skipwhose postcondition isequiv_while'shpre(the second loop ofSponge_Raise_BlockSponge_f: the invariant, and the exit under the loops' frames) leaves the exit, whichec_closecloses:equiv_skip; ec_close. - EC's
call (_ : P ==> Q). proc (I)=> //.on the declaredDistis one step,equiv_call (_ : ={glob BlockSim} ∧ I)(the={…} ∧without parentheses); the implication that EC proves next (progress; apply lazy_invar0) is then in the last goal, with the code before the call. - EC's
conseq Hwhere the goal keeps aglobthatHdoes not mention:equiv_conseq_frame H(Logic/ECProcInv.lean), which frames what the procedures do not write and closes the two implications when they are trivial; a section's module thatH's procedures do not name is given (RaiseHybridIRO_HybridIROEager_RaiseFun_BlockIRO_f BlockSim). - The frames need the footprints of the first port's concrete modules (
@[fp_bound]lemmas before the final section, each byfp_module). Two traps:omit [BlockSponge.Params]on such a lemma makesfp_modulefail on a procedure that calls another one (the first port's unfolding lemma takes the instance), and a bound stated afterinclude RtakesRas an argument and is not found.
Sponge_Raise_BlockSponge_f in EC's form — the second tactic experiment #
A procedure-level equivalence with two-sided loops, EC's inline M.f, seq n m : P, rcondt{i},
case, call (_ : ={glob Perm}) on a concrete module and auto, over the old port's
declarations (section FirstPort below). It drove stmt_inline (M.f)
(Logic/ECInline.lean), EC's equiv_seq positions (Logic/ECSeq.lean), equiv_auto,
equiv_call (_ : ={glob P}) on a concrete callee, and the closers of hoare_auto/equiv_auto.
Deviations, all from the old declarations or the closers:
- the statement:
(bs, n)as one parameterx, named at the triple; the old views as coercions; - positions: one more statement on each side (
bs, n <- x), askipwherercondtleft the branch,RaiseFun'sxs <- z0taken bystmt_wp; EC'sswap{2} [3..5] -2,swap{2} 1 1andseq 0 1are not needed (the inlined code is already in that order); - EC's
smt/progress/rewriteclosers:simp_allwith theblocks2bitslemmas.
Declarations of the first port #
Definitions and plain lemmas of the first port of this file (2026-10/11) that the proofs below use; its program-logic proofs are gone.
The first port's translation notes (some mention declarations that went with its proofs):
clone include Indifferentiability with type p <- block * capacity, type f_in <- bool list * int, type f_out <- bool list rename … "Indif" as "Experiment" …is the abbreviations below.clone import IRO as BIRO with type from <- bool list, type to <- bool, op valid <- valid_toplevel, op dto <- dboolis the namespaceBIRO; EasyCrypt's unqualifiedIROisBIRO.IRO.- Procedures whose EasyCrypt parameters
(bs, n)are the module type's single parameter take that pair and name its components, as inBlockSponge.HYBRID_IRO.fis not a functionality: it keeps its two parameters. LowerDist(D, F) = D(RaiseFun(F))is used asLowerDist(Dist) : BlockSponge.DISTINGUISHER:Dis a Lean parameter, and the alias is wrapped in a call (exception E5).RaiseSim(S, F) = S(LowerFun(F))is the compositeModule.comp S LowerFun.- The abstract theory
HybridIROis the namespaceHybridIRO. Its modules' variables (HybridIROLazy.mp,HybridIROEager.mp) are lens parameters, as for every generic theory. - Variables of local clones (
EROinHybridIRO,HIROin the last section) are lens parameters of the local declarations that mention them, with hypotheses that they are fresh for the section's modules; the non-local results do not mention them (exception E6). - EasyCrypt's
proc distinguish()is aRO_Distinguisher, whose procedure takesunit; hereRODist'sdistinguishtakes thatUnitparameter.
Indifferentiability: `clone include Indifferentiability with type p <- block * capacity, #
type f_in <- bool list * int, type f_out <- bool list rename [module] "Indif" as "Experiment" [module] "GReal" as "RealIndif" [module] "GIdeal" as "IdealIndif"`
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
EC's subtyping PRIMITIVE <: DPRIMITIVE (its f, fi).
Equations
- One or more equations did not get rendered due to their size.
EC's subtyping FUNCTIONALITY <: DFUNCTIONALITY (its f).
Equations
- One or more equations did not get rendered due to their size.
BlockSponge's PRIMITIVE where the bit sponge's DPRIMITIVE is expected (one module type in
EC: both are Indifferentiability's at block * capacity).
Equations
- One or more equations did not get rendered due to their size.
The ideal functionality: `clone import IRO as BIRO with type from <- bool list, #
type to <- bool, op valid <- valid_toplevel, op dto <- dbool`
Instances For
The clone's module variable BIRO.IRO.mp.
Equations
- GaudisCrypt.SHA3.Sponge.BIRO.IRO.mp = GaudisCrypt.varLens (GaudisCrypt.VariableName.mk "GaudisCrypt.SHA3.Sponge.BIRO.IRO.mp" (GaudisCrypt.EC.FMap (List Bool × ℤ) Bool))
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
The sponge construction #
@[simp]: applying StdSponge to a tuple of its single parameter P — the record of its procedures StdSponge.init, StdSponge.f, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with StdSponge.init.apply_simp, StdSponge.f.apply_simp to fill that procedure's holes.
The module declared by module StdSponge, abstracted over its single parameter P, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures StdSponge.init, StdSponge.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma StdSponge.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: StdSponge.init = Module.proc StdSponge.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
proc f of module StdSponge as a module, abstracted over the module parameters it uses (P, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma StdSponge.f.apply_simp, which fills the holes of StdSponge.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying StdSponge.f to the parameters proc f uses (P) is Module.proc (StdSponge.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The body of proc f of module StdSponge, as a procedure of its own: the one call it makes to a module parameter (P) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see StdSponge.f.procedure.apply_simp) rather than run. Use StdSponge.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc init of module StdSponge, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see StdSponge.init.procedure.apply_simp) rather than run. Use StdSponge.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.Sponge.StdSponge.init.procedure = proc () : Unit { skip; return () }
Instances For
Instantiating the holes of StdSponge.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [StdSponge.init.procedure.apply_simp]).
Instantiating the holes of StdSponge.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [StdSponge.f.procedure.apply_simp]).
proc init of module StdSponge as a module: Module.proc StdSponge.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — StdSponge.init.apply_simp says exactly that.
Equations
Instances For
Instantiating the holes of Sponge.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [Sponge.init.procedure.apply_simp]).
@[simp]: applying Sponge.f to the parameters proc f uses (P) is Module.proc (Sponge.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
@[simp]: applying Sponge to a tuple of its single parameter P — the record of its procedures Sponge.init, Sponge.f, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with Sponge.init.apply_simp, Sponge.f.apply_simp to fill that procedure's holes.
Instantiating the holes of Sponge.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [Sponge.f.procedure.apply_simp]).
The body of proc init of module Sponge, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Sponge.init.procedure.apply_simp) rather than run. Use Sponge.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.Sponge.Sponge.init.procedure = proc () : Unit { skip; return () }
Instances For
proc f of module Sponge as a module, abstracted over the module parameters it uses (P, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma Sponge.f.apply_simp, which fills the holes of Sponge.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module Sponge, abstracted over its single parameter P, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures Sponge.init, Sponge.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Sponge.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc init of module Sponge as a module: Module.proc Sponge.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Sponge.init.apply_simp says exactly that.
Equations
Instances For
@[simp]: Sponge.init = Module.proc Sponge.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
The body of proc f of module Sponge, as a procedure of its own: the one call it makes to a module parameter (P) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Sponge.f.procedure.apply_simp) rather than run. Use Sponge.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Simulator and distinguisher constructions #
proc f of module LowerFun as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma LowerFun.f.apply_simp, which fills the holes of LowerFun.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying LowerFun to a tuple of its single parameter F — the record of its procedures LowerFun.f, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with LowerFun.f.apply_simp to fill that procedure's holes.
Instantiating the holes of LowerFun.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [LowerFun.f.procedure.apply_simp]).
@[simp]: applying LowerFun.f to the parameters proc f uses (F) is Module.proc (LowerFun.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The body of proc f of module LowerFun, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see LowerFun.f.procedure.apply_simp) rather than run. Use LowerFun.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module LowerFun, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures LowerFun.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma LowerFun.apply_simp says.
Equations
Instances For
The body of proc f of module RaiseFun, as a procedure of its own: the one call it makes to a module parameter (F) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see RaiseFun.f.procedure.apply_simp) rather than run. Use RaiseFun.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc f of module RaiseFun as a module, abstracted over the module parameters it uses (F, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma RaiseFun.f.apply_simp, which fills the holes of RaiseFun.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying RaiseFun to a tuple of its single parameter F — the record of its procedures RaiseFun.f, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with RaiseFun.f.apply_simp to fill that procedure's holes.
@[simp]: applying RaiseFun.f to the parameters proc f uses (F) is Module.proc (RaiseFun.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
Instantiating the holes of RaiseFun.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [RaiseFun.f.procedure.apply_simp]).
The module declared by module RaiseFun, abstracted over its single parameter F, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures RaiseFun.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma RaiseFun.apply_simp says.
Equations
Instances For
@[simp]: applying LowerDist.distinguish to the parameters proc distinguish uses (F, P) is Module.proc (LowerDist.distinguish.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The module declared by module LowerDist, abstracted over its 2 parameters F, P, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures LowerDist.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma LowerDist.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc distinguish of module LowerDist, as a procedure of its own: the one call it makes to a module parameter (F, P) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see LowerDist.distinguish.procedure.apply_simp) rather than run. Use LowerDist.distinguish for this procedure as a module.
Equations
- GaudisCrypt.SHA3.Sponge.LowerDist.distinguish.procedure D = proc () uses (_hole0 : () → Bool) : Bool { var b : Bool; b <- call _hole0 (); return §b }
Instances For
proc distinguish of module LowerDist as a module, abstracted over the module parameters it uses (F, P, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma LowerDist.distinguish.apply_simp, which fills the holes of LowerDist.distinguish.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of LowerDist.distinguish.procedure with a tuple holeArgs of procedures: the body of proc distinguish as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [LowerDist.distinguish.procedure.apply_simp]).
@[simp]: applying LowerDist to a tuple of its 2 parameters F, P — the record of its procedures LowerDist.distinguish, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with LowerDist.distinguish.apply_simp to fill that procedure's holes.
module RaiseSim (S : BlockSponge.SIMULATOR, F : DFUNCTIONALITY) = S(LowerFun(F)), used as
RaiseSim(S) : SIMULATOR.
Equations
Instances For
The abstract theory of hybrid IROs (abstract theory HybridIRO) #
Hybrid IROs map a block list and an index to a bit. The theory has no parameters and is cloned
once (HIRO, in the last section): its declarations are the clone's.
Builds a module of type HYBRID_IRO from the record HYBRID_IRO.Structure of its fields, as a right-nested Module.pair'. @[reducible].
Inverse of HYBRID_IRO.structure (HYBRID_IRO.mk_destruct, HYBRID_IRO.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas HYBRID_IRO.init.mk_simp, HYBRID_IRO.f.mk_simp.
Equations
- GaudisCrypt.SHA3.Sponge.HybridIRO.HYBRID_IRO.mk theRecord✝ = GaudisCrypt.Module.pair' theRecord✝.init theRecord✝.f
Instances For
What is derivable about the accessor HYBRID_IRO.f, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
HYBRID_IRO.f.utilities.accessorModule : HYBRID_IRO →ₘ …— the accessor as a module, a projection being a module morphism;HYBRID_IRO.f.utilities.apply_simp—Module.app HYBRID_IRO.f.utilities.accessorModule m = HYBRID_IRO.f m: applying that module is the accessor;HYBRID_IRO.f.utilities.expression_eq— the same at the level of expressions:(HYBRID_IRO.f m).expression = (HYBRID_IRO.f.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: HYBRID_IRO.structure (HYBRID_IRO.mk r) = r — destructing a module built from a record gives that record back.
The module type declared by moduletype HYBRID_IRO, with fields init, f: the type Module HYBRID_IRO.typeRep of modules that are a right-nested tuple of the field types.
Build one from a record of its fields with HYBRID_IRO.mk, read a single field off one with the accessors HYBRID_IRO.init, HYBRID_IRO.f, and get the whole record back with HYBRID_IRO.structure.
Equations
Instances For
@[simp]: reading the field init back off a module built from a record — HYBRID_IRO.init (HYBRID_IRO.mk r) = r.init.
It is what carries the right-hand side of an X.apply_simp (which is an HYBRID_IRO.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.init.apply_simp.
The field f of a module of type HYBRID_IRO: the projection onto component 1 of the right-nested tuple HYBRID_IRO.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
HYBRID_IRO.f.mk_simp reads this field back off a module built by HYBRID_IRO.mk; HYBRID_IRO.f.utilities has the accessor as a module, and the lemmas about it.
Its parameters are named x, n, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).
Equations
- theModule✝.f = GaudisCrypt.Module.snd' theModule✝
Instances For
The IsModule HYBRID_IRO instance: HYBRID_IRO is a module type, with representation HYBRID_IRO.typeRep.
It is what lets the name HYBRID_IRO stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module HYBRID_IRO.typeRep would do on its own but HYBRID_IRO, a plain (non-reducible) def, would not.
Equations
- GaudisCrypt.SHA3.Sponge.HybridIRO.instIsModuleHYBRID_IRO = { moduleTypeRep := GaudisCrypt.SHA3.Sponge.HybridIRO.HYBRID_IRO.typeRep, isModule := ⋯ }
The record of a module's fields: HYBRID_IRO.structure m is HYBRID_IRO.Structure.mk applied to HYBRID_IRO.init, HYBRID_IRO.f of m.
Inverse of HYBRID_IRO.mk (HYBRID_IRO.mk_destruct, HYBRID_IRO.destruct_mk).
Instances For
The ModuleTypeRep underlying HYBRID_IRO, the module type declared by moduletype HYBRID_IRO: the right-nested product of its 2 field types, in declaration order.
HYBRID_IRO is by definition Module HYBRID_IRO.typeRep.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: HYBRID_IRO.mk (HYBRID_IRO.structure m) = m — rebuilding a module from its own fields gives that module back.
The field init of a module of type HYBRID_IRO: the projection onto component 0 of the right-nested tuple HYBRID_IRO.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].
HYBRID_IRO.init.mk_simp reads this field back off a module built by HYBRID_IRO.mk; HYBRID_IRO.init.utilities has the accessor as a module, and the lemmas about it.
It takes no parameters (recorded in @[gaudiProcParamNames]).
Equations
- theModule✝.init = GaudisCrypt.Module.fst' theModule✝
Instances For
@[simp]: reading the field f back off a module built from a record — HYBRID_IRO.f (HYBRID_IRO.mk r) = r.f.
It is what carries the right-hand side of an X.apply_simp (which is an HYBRID_IRO.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.f.apply_simp.
What is derivable about the accessor HYBRID_IRO.init, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):
HYBRID_IRO.init.utilities.accessorModule : HYBRID_IRO →ₘ …— the accessor as a module, a projection being a module morphism;HYBRID_IRO.init.utilities.apply_simp—Module.app HYBRID_IRO.init.utilities.accessorModule m = HYBRID_IRO.init m: applying that module is the accessor;HYBRID_IRO.init.utilities.expression_eq— the same at the level of expressions:(HYBRID_IRO.init m).expression = (HYBRID_IRO.init.utilities.proj m.expression).reduce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The record of the fields of a module of type HYBRID_IRO: the fields init, f, one per moduletype field, each of that field's own module type.
HYBRID_IRO.mk turns such a record into a HYBRID_IRO, HYBRID_IRO.structure turns a HYBRID_IRO back into one.
Instances For
module type HYBRID_IRO_DIST (HI : HYBRID_IRO) = { proc distinguish() : bool {HI.f} }:
distinguisher for hybrid IROs.
Equations
Instances For
The oracle procedure a HYBRID_IRO_DIST may call (EasyCrypt's {HI.f}): HI.f. The hole of
its representation (Module.Representable, exception E2).
Equations
Instances For
The body of proc main of module HybridIROExper, as a procedure of its own: the 2 calls it makes to module parameters (HI, D) are its holes, in the order the body makes them.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROExper.main.procedure.apply_simp) rather than run. Use HybridIROExper.main for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying HybridIROExper to a tuple of its 2 parameters HI, D — the record of its procedures HybridIROExper.main, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with HybridIROExper.main.apply_simp to fill that procedure's holes.
The module declared by module HybridIROExper, abstracted over its 2 parameters HI, D, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures HybridIROExper.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma HybridIROExper.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc main of module HybridIROExper as a module, abstracted over the module parameters it uses (HI, D, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma HybridIROExper.main.apply_simp, which fills the holes of HybridIROExper.main.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying HybridIROExper.main to the parameters proc main uses (HI, D) is Module.proc (HybridIROExper.main.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
Instantiating the holes of HybridIROExper.main.procedure with a tuple holeArgs of procedures: the body of proc main as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROExper.main.procedure.apply_simp]).
EC's HybridIROLazy.mp.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: HybridIROLazy.fill_in = Module.proc HybridIROLazy.fill_in.procedure — true by definition, proc fill_in using no module parameter and so having no holes to fill.
Instantiating the holes of HybridIROLazy.fill_in.procedure with a tuple holeArgs of procedures: the body of proc fill_in as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROLazy.fill_in.procedure.apply_simp]).
proc f of module HybridIROLazy as a module: Module.proc HybridIROLazy.f.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROLazy.f.apply_simp says exactly that.
Equations
Instances For
The module declared by module HybridIROLazy: the record of its procedures HybridIROLazy.init, HybridIROLazy.fill_in, HybridIROLazy.f.
The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no HybridIROLazy.apply_simp to apply it with.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of HybridIROLazy.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROLazy.f.procedure.apply_simp]).
The body of proc fill_in of module HybridIROLazy, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROLazy.fill_in.procedure.apply_simp) rather than run. Use HybridIROLazy.fill_in for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc init of module HybridIROLazy, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROLazy.init.procedure.apply_simp) rather than run. Use HybridIROLazy.init for this procedure as a module.
Equations
Instances For
@[simp]: HybridIROLazy.f = Module.proc HybridIROLazy.f.procedure — true by definition, proc f using no module parameter and so having no holes to fill.
proc init of module HybridIROLazy as a module: Module.proc HybridIROLazy.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROLazy.init.apply_simp says exactly that.
Equations
Instances For
proc fill_in of module HybridIROLazy as a module: Module.proc HybridIROLazy.fill_in.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROLazy.fill_in.apply_simp says exactly that.
Equations
Instances For
The body of proc f of module HybridIROLazy, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROLazy.f.procedure.apply_simp) rather than run. Use HybridIROLazy.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of HybridIROLazy.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROLazy.init.procedure.apply_simp]).
@[simp]: HybridIROLazy.init = Module.proc HybridIROLazy.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
HybridIROLazy at its type HYBRID_IRO.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's HybridIROEager.mp.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: HybridIROEager.f = Module.proc HybridIROEager.f.procedure — true by definition, proc f using no module parameter and so having no holes to fill.
The body of proc f of module HybridIROEager, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROEager.f.procedure.apply_simp) rather than run. Use HybridIROEager.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc init of module HybridIROEager as a module: Module.proc HybridIROEager.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROEager.init.apply_simp says exactly that.
Equations
Instances For
The body of proc fill_in of module HybridIROEager, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROEager.fill_in.procedure.apply_simp) rather than run. Use HybridIROEager.fill_in for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of HybridIROEager.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROEager.f.procedure.apply_simp]).
Instantiating the holes of HybridIROEager.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROEager.init.procedure.apply_simp]).
The body of proc init of module HybridIROEager, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROEager.init.procedure.apply_simp) rather than run. Use HybridIROEager.init for this procedure as a module.
Equations
Instances For
proc fill_in of module HybridIROEager as a module: Module.proc HybridIROEager.fill_in.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROEager.fill_in.apply_simp says exactly that.
Equations
Instances For
@[simp]: HybridIROEager.init = Module.proc HybridIROEager.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
The module declared by module HybridIROEager: the record of its procedures HybridIROEager.init, HybridIROEager.fill_in, HybridIROEager.f.
The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no HybridIROEager.apply_simp to apply it with.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: HybridIROEager.fill_in = Module.proc HybridIROEager.fill_in.procedure — true by definition, proc fill_in using no module parameter and so having no holes to fill.
proc f of module HybridIROEager as a module: Module.proc HybridIROEager.f.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROEager.f.apply_simp says exactly that.
Equations
Instances For
Instantiating the holes of HybridIROEager.fill_in.procedure with a tuple holeArgs of procedures: the body of proc fill_in as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROEager.fill_in.procedure.apply_simp]).
HybridIROEager at its type HYBRID_IRO.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Lazy = eager: EasyCrypt's section with `declare module D <: HYBRID_IRO_DIST #
{-HybridIROEager, -HybridIROLazy}`
local clone import PROM.FullRO as ERO with type in_t <- block list * int, type out_t <- bool, op dout _ <- dbool, type d_in_t <- unit, type d_out_t <- bool: the namespace ERO of
PROM.FullRO at the clone's types, its module variables global_vars.
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
The clone's module variable ERO.RO.m.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The clone's module variable ERO.FRO.m.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying EROExper.main to the parameters proc main uses (O, D) is Module.proc (EROExper.main.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
Instantiating the holes of EROExper.main.procedure with a tuple holeArgs of procedures: the body of proc main as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [EROExper.main.procedure.apply_simp]).
The module declared by module EROExper, abstracted over its 2 parameters O, D, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures EROExper.main, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma EROExper.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying EROExper to a tuple of its 2 parameters O, D — the record of its procedures EROExper.main, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with EROExper.main.apply_simp to fill that procedure's holes.
The body of proc main of module EROExper, as a procedure of its own: the 2 calls it makes to module parameters (O, D) are its holes, in the order the body makes them.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see EROExper.main.procedure.apply_simp) rather than run. Use EROExper.main for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc main of module EROExper as a module, abstracted over the module parameters it uses (O, D, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma EROExper.main.apply_simp, which fills the holes of EROExper.main.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of HIRO.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HIRO.f.procedure.apply_simp]).
@[simp]: applying HIRO.init to the parameters proc init uses (RO) is Module.proc (HIRO.init.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The body of proc init of module HIRO, as a procedure of its own: the one call it makes to a module parameter (RO) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HIRO.init.procedure.apply_simp) rather than run. Use HIRO.init for this procedure as a module.
Equations
Instances For
@[simp]: applying HIRO to a tuple of its single parameter RO — the record of its procedures HIRO.init, HIRO.f, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with HIRO.init.apply_simp, HIRO.f.apply_simp to fill that procedure's holes.
Instantiating the holes of HIRO.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HIRO.init.procedure.apply_simp]).
@[simp]: applying HIRO.f to the parameters proc f uses (RO) is Module.proc (HIRO.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
proc f of module HIRO as a module, abstracted over the module parameters it uses (RO, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma HIRO.f.apply_simp, which fills the holes of HIRO.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module HIRO, abstracted over its single parameter RO, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures HIRO.init, HIRO.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma HIRO.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc init of module HIRO as a module, abstracted over the module parameters it uses (RO, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma HIRO.init.apply_simp, which fills the holes of HIRO.init.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc f of module HIRO, as a procedure of its own: the 2 calls it makes to module parameters (RO) are its holes, in the order the body makes them.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HIRO.f.procedure.apply_simp) rather than run. Use HIRO.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc distinguish of module RODist, as a procedure of its own: the one call it makes to a module parameter (RO) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see RODist.distinguish.procedure.apply_simp) rather than run. Use RODist.distinguish for this procedure as a module.
Equations
Instances For
@[simp]: applying RODist.distinguish to the parameters proc distinguish uses (RO) is Module.proc (RODist.distinguish.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
Instantiating the holes of RODist.distinguish.procedure with a tuple holeArgs of procedures: the body of proc distinguish as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [RODist.distinguish.procedure.apply_simp]).
proc distinguish of module RODist as a module, abstracted over the module parameters it uses (RO, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma RODist.distinguish.apply_simp, which fills the holes of RODist.distinguish.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying RODist to a tuple of its single parameter RO — the record of its procedures RODist.distinguish, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with RODist.distinguish.apply_simp to fill that procedure's holes.
The module declared by module RODist, abstracted over its single parameter RO, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures RODist.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma RODist.apply_simp says.
Equations
Instances For
HIRO has no globals of its own.
RODist(D) touches what D does.
Instantiating the holes of RaiseHybridIRO.init.procedure with a tuple holeArgs of procedures: the body of proc init as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [RaiseHybridIRO.init.procedure.apply_simp]).
@[simp]: applying RaiseHybridIRO.f to the parameters proc f uses (HI) is Module.proc (RaiseHybridIRO.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
@[simp]: applying RaiseHybridIRO to a tuple of its single parameter HI — the record of its procedures RaiseHybridIRO.init, RaiseHybridIRO.f, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with RaiseHybridIRO.init.apply_simp, RaiseHybridIRO.f.apply_simp to fill that procedure's holes.
proc init of module RaiseHybridIRO as a module, abstracted over the module parameters it uses (HI, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma RaiseHybridIRO.init.apply_simp, which fills the holes of RaiseHybridIRO.init.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying RaiseHybridIRO.init to the parameters proc init uses (HI) is Module.proc (RaiseHybridIRO.init.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The module declared by module RaiseHybridIRO, abstracted over its single parameter HI, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures RaiseHybridIRO.init, RaiseHybridIRO.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma RaiseHybridIRO.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc f of module RaiseHybridIRO as a module, abstracted over the module parameters it uses (HI, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma RaiseHybridIRO.f.apply_simp, which fills the holes of RaiseHybridIRO.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc f of module RaiseHybridIRO, as a procedure of its own: the one call it makes to a module parameter (HI) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see RaiseHybridIRO.f.procedure.apply_simp) rather than run. Use RaiseHybridIRO.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc init of module RaiseHybridIRO, as a procedure of its own: the one call it makes to a module parameter (HI) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see RaiseHybridIRO.init.procedure.apply_simp) rather than run. Use RaiseHybridIRO.init for this procedure as a module.
Equations
Instances For
Instantiating the holes of RaiseHybridIRO.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [RaiseHybridIRO.f.procedure.apply_simp]).
@[simp]: applying LowerHybridIRO to a tuple of its single parameter HI — the record of its procedures LowerHybridIRO.f, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with LowerHybridIRO.f.apply_simp to fill that procedure's holes.
proc f of module LowerHybridIRO as a module, abstracted over the module parameters it uses (HI, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma LowerHybridIRO.f.apply_simp, which fills the holes of LowerHybridIRO.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc f of module LowerHybridIRO, as a procedure of its own: the one call it makes to a module parameter (HI) is its single hole.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see LowerHybridIRO.f.procedure.apply_simp) rather than run. Use LowerHybridIRO.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module declared by module LowerHybridIRO, abstracted over its single parameter HI, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the module type it was declared with.
Applied to such a tuple it is the record of its procedures LowerHybridIRO.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma LowerHybridIRO.apply_simp says.
Equations
Instances For
Instantiating the holes of LowerHybridIRO.f.procedure with a tuple holeArgs of procedures: the body of proc f as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [LowerHybridIRO.f.procedure.apply_simp]).
@[simp]: applying LowerHybridIRO.f to the parameters proc f uses (HI) is Module.proc (LowerHybridIRO.f.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
Invariant relating the maps of BIRO.IRO and HybridIROLazy.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Invariant relating the maps of BlockSponge.BIRO.IRO and HybridIROEager.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc loop of module HybridIROEagerTrans, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROEagerTrans.loop.procedure.apply_simp) rather than run. Use HybridIROEagerTrans.loop for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc next_block_split of module HybridIROEagerTrans, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROEagerTrans.next_block_split.procedure.apply_simp) rather than run. Use HybridIROEagerTrans.next_block_split for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of HybridIROEagerTrans.loop.procedure with a tuple holeArgs of procedures: the body of proc loop as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROEagerTrans.loop.procedure.apply_simp]).
The module declared by module HybridIROEagerTrans: the record of its procedures HybridIROEagerTrans.next_block, HybridIROEagerTrans.next_block_split, HybridIROEagerTrans.loop.
The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no HybridIROEagerTrans.apply_simp to apply it with.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc next_block_split of module HybridIROEagerTrans as a module: Module.proc HybridIROEagerTrans.next_block_split.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROEagerTrans.next_block_split.apply_simp says exactly that.
Equations
Instances For
The body of proc next_block of module HybridIROEagerTrans, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIROEagerTrans.next_block.procedure.apply_simp) rather than run. Use HybridIROEagerTrans.next_block for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of HybridIROEagerTrans.next_block_split.procedure with a tuple holeArgs of procedures: the body of proc next_block_split as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROEagerTrans.next_block_split.procedure.apply_simp]).
@[simp]: HybridIROEagerTrans.next_block_split = Module.proc HybridIROEagerTrans.next_block_split.procedure — true by definition, proc next_block_split using no module parameter and so having no holes to fill.
@[simp]: HybridIROEagerTrans.next_block = Module.proc HybridIROEagerTrans.next_block.procedure — true by definition, proc next_block using no module parameter and so having no holes to fill.
proc loop of module HybridIROEagerTrans as a module: Module.proc HybridIROEagerTrans.loop.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROEagerTrans.loop.apply_simp says exactly that.
Equations
Instances For
proc next_block of module HybridIROEagerTrans as a module: Module.proc HybridIROEagerTrans.next_block.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — HybridIROEagerTrans.next_block.apply_simp says exactly that.
Equations
Instances For
Instantiating the holes of HybridIROEagerTrans.next_block.procedure with a tuple holeArgs of procedures: the body of proc next_block as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIROEagerTrans.next_block.procedure.apply_simp]).
@[simp]: HybridIROEagerTrans.loop = Module.proc HybridIROEagerTrans.loop.procedure — true by definition, proc loop using no module parameter and so having no holes to fill.
Two maps are the same except (perhaps) on a range of bits for a single block list.
Equations
Instances For
proc loop of module BlockSpongeTrans as a module: Module.proc BlockSpongeTrans.loop.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — BlockSpongeTrans.loop.apply_simp says exactly that.
Equations
Instances For
The body of proc next_block of module BlockSpongeTrans, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see BlockSpongeTrans.next_block.procedure.apply_simp) rather than run. Use BlockSpongeTrans.next_block for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc next_block of module BlockSpongeTrans as a module: Module.proc BlockSpongeTrans.next_block.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — BlockSpongeTrans.next_block.apply_simp says exactly that.
Equations
Instances For
The body of proc loop of module BlockSpongeTrans, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see BlockSpongeTrans.loop.procedure.apply_simp) rather than run. Use BlockSpongeTrans.loop for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: BlockSpongeTrans.next_block = Module.proc BlockSpongeTrans.next_block.procedure — true by definition, proc next_block using no module parameter and so having no holes to fill.
@[simp]: BlockSpongeTrans.loop = Module.proc BlockSpongeTrans.loop.procedure — true by definition, proc loop using no module parameter and so having no holes to fill.
The module declared by module BlockSpongeTrans: the record of its procedures BlockSpongeTrans.next_block, BlockSpongeTrans.loop.
The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no BlockSpongeTrans.apply_simp to apply it with.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of BlockSpongeTrans.loop.procedure with a tuple holeArgs of procedures: the body of proc loop as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [BlockSpongeTrans.loop.procedure.apply_simp]).
Instantiating the holes of BlockSpongeTrans.next_block.procedure with a tuple holeArgs of procedures: the body of proc next_block as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [BlockSpongeTrans.next_block.procedure.apply_simp]).
clone Program as Prog with type t = bool, op d = {0,1} (the Program abstract theory of
DList)
Equations
Instances For
The body of proc direct of module BlockGen, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see BlockGen.direct.procedure.apply_simp) rather than run. Use BlockGen.direct for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc direct of module BlockGen as a module: Module.proc BlockGen.direct.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — BlockGen.direct.apply_simp says exactly that.
Equations
Instances For
proc loop of module BlockGen as a module: Module.proc BlockGen.loop.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — BlockGen.loop.apply_simp says exactly that.
Equations
Instances For
@[simp]: BlockGen.direct = Module.proc BlockGen.direct.procedure — true by definition, proc direct using no module parameter and so having no holes to fill.
The body of proc loop of module BlockGen, as a procedure of its own: it calls no module parameter, so it has no holes.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see BlockGen.loop.procedure.apply_simp) rather than run. Use BlockGen.loop for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: BlockGen.loop = Module.proc BlockGen.loop.procedure — true by definition, proc loop using no module parameter and so having no holes to fill.
The module declared by module BlockGen: the record of its procedures BlockGen.loop, BlockGen.direct.
The declaration has no parameter list, so no procedure of it can call one either and the module is not a function — it is the plain record itself, and there is no BlockGen.apply_simp to apply it with.
Equations
Instances For
Instantiating the holes of BlockGen.loop.procedure with a tuple holeArgs of procedures: the body of proc loop as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [BlockGen.loop.procedure.apply_simp]).
Instantiating the holes of BlockGen.direct.procedure with a tuple holeArgs of procedures: the body of proc direct as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [BlockGen.direct.procedure.apply_simp]).
The main result: EasyCrypt's section with `declare module BlockSim <: BlockSponge.SIMULATOR #
{-IRO, -BlockSponge.BIRO.IRO}anddeclare module Dist <: DISTINGUISHER {-Perm, -BlockSim, -IRO,
-BlockSponge.BIRO.IRO}`
local clone HybridIRO as HIRO: the clone is local, so its module variables
HIRO.HybridIROLazy.mp, HIRO.HybridIROEager.mp are the lens parameters HIRO_Lazy_mp,
HIRO_Eager_mp of the local declarations that mention them, fresh by hypothesis (HIRO_fresh,
exception E6). HIRO.X is HybridIRO.X at these lenses.
The ideal side #
Instantiating the holes of HybridIRODist.distinguish.procedure with a tuple holeArgs of procedures: the body of proc distinguish as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.
Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [HybridIRODist.distinguish.procedure.apply_simp]).
@[simp]: applying HybridIRODist.distinguish to the parameters proc distinguish uses (HI) is Module.proc (HybridIRODist.distinguish.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.
The module declared by module HybridIRODist, abstracted over its single parameter HI, which it takes as one right-nested tuple: Module.Arr (T₁ ×ₘ (… ×ₘ Tₙ)) M, with M the anonymous product of the procedures' own types, the declaration naming no module type.
Applied to such a tuple it is the record of its procedures HybridIRODist.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma HybridIRODist.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc distinguish of module HybridIRODist, as a procedure of its own: the 2 calls it makes to module parameters (HI) are its holes, in the order the body makes them.
A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see HybridIRODist.distinguish.procedure.apply_simp) rather than run. Use HybridIRODist.distinguish for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying HybridIRODist to a tuple of its single parameter HI — the record of its procedures HybridIRODist.distinguish, each applied to the parameters it uses.
This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with HybridIRODist.distinguish.apply_simp to fill that procedure's holes.
proc distinguish of module HybridIRODist as a module, abstracted over the module parameters it uses (HI, in declaration order): Module.Arr … (Module.Proc (procsig …)).
Apply it with the @[simp] lemma HybridIRODist.distinguish.apply_simp, which fills the holes of HybridIRODist.distinguish.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
LowerHybridIRO has no globals of its own.
RaiseHybridIRO has no globals of its own.
HybridIRODist touches what BlockSim and Dist do.
EC's size_block (the clone Block of BitWord).
EC derives this inline in each of the three branches of the squeezing loop of
Sponge_is_StdSponge (rewrite size_cat size_block=> -> …; by rewrite -(mulzDr r i 1) loop_cond /#): one more block, and the two loops' tests agree.
EC's equiv Sponge_is_StdSponge (P <: DPRIMITIVE): StdSponge(P).f ~ Sponge(P).f: ={glob P, bs, n} ==> ={glob P, res}.
EC's script. (bs, n) is the one parameter x of the first port's modules, so each side has
one more statement, bs, n <- x (EC's seq 5 5 is equiv_seq 6 6). The fact EC derives inline
in the three branches of the squeezing loop is size_cat_block.
EC's subtyping: a FUNCTIONALITY where a DFUNCTIONALITY is expected (the first port's
view).
Equations
- One or more equations did not get rendered due to their size.
The theory HybridIRO (EC l. 256–1909) #
EC's HybridIROLazy, at its type HYBRID_IRO.
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
EC's HybridIROEager, at its type HYBRID_IRO.
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
EC's local clone import PROM.FullRO as ERO with type in_t <- block list * int, type out_t <- bool, op dout _ <- dbool, type d_in_t <- unit, type d_out_t <- bool: the namespace
ERO of the section FirstPort.
EC's local lemma LRO_RO (D <: ERO.RO_Distinguisher{-ERO.RO, -ERO.FRO}) &m : Pr[EROExper(LRO, D).main() @ &m : res] = Pr[EROExper(ERO.RO, D).main() @ &m : res].
EC's local lemma HybridIROLazy_HIRO_LRO_init : equiv[HybridIROLazy.init ~ HIRO(LRO).init : true ==> HybridIROLazy.mp{1} = ERO.RO.m{2}].
EC's local lemma HybridIROLazy_fill_in_LRO_get : equiv[HybridIROLazy.fill_in ~ LRO.get : (xs, i){1} = x{2} /\ HybridIROLazy.mp{1} = ERO.RO.m{2} ==> ={res} /\ HybridIROLazy.mp{1} = ERO.RO.m{2}].
EC's local lemma HybridIROLazy_HIRO_LRO_f : equiv[HybridIROLazy.f ~ HIRO(LRO).f : ={xs, n} /\ HybridIROLazy.mp{1} = ERO.RO.m{2} ==> ={res} /\ HybridIROLazy.mp{1} = ERO.RO.m{2}].
EC's local lemma HIRO_RO_HybridIROEager_init : equiv[HIRO(ERO.RO).init ~ HybridIROEager.init : true ==> ={res} /\ ERO.RO.m{1} = HybridIROEager.mp{2}].
EC's local lemma RO_get_HybridIROEager_fill_in : equiv[ERO.RO.get ~ HybridIROEager.fill_in : x{1} = (xs, i){2} /\ ERO.RO.m{1} = HybridIROEager.mp{2} ==> ={res} /\ ERO.RO.m{1} = HybridIROEager.mp{2}].
EC's local lemma RO_sample_HybridIROEager_fill_in : equiv[ERO.RO.sample ~ HybridIROEager.fill_in : x{1} = (xs, i){2} /\ ERO.RO.m{1} = HybridIROEager.mp{2} ==> ERO.RO.m{1} = HybridIROEager.mp{2}].
EC's local lemma HIRO_RO_HybridIROEager_f : equiv[HIRO(ERO.RO).f ~ HybridIROEager.f : ={xs, n} /\ ERO.RO.m{1} = HybridIROEager.mp{2} ==> ={res} /\ ERO.RO.m{1} = HybridIROEager.mp{2}].
EC's local lemma Exper_HybridIROLazy_LRO &m : Pr[HybridIROExper(HybridIROLazy, D).main() @ &m : res] = Pr[EROExper(LRO, RODist).main() @ &m : res].
EC's local lemma Exper_RO_HybridIROEager &m : Pr[EROExper(ERO.RO, RODist).main() @ &m : res] = Pr[HybridIROExper(HybridIROEager, D).main() @ &m : res].
EC's lemma HybridIROExper_Lazy_Eager' &m : Pr[HybridIROExper(HybridIROLazy, D).main() @ &m : res] = Pr[HybridIROExper(HybridIROEager, D).main() @ &m : res].
EC's lemma HybridIROExper_Lazy_Eager (D <: HYBRID_IRO_DIST{-HybridIROEager, -HybridIROLazy}) &m : Pr[HybridIROExper(HybridIROLazy, D).main() @ &m : res] = Pr[HybridIROExper(HybridIROEager, D).main() @ &m : res]; the local clone ERO's variables in
D's restriction (fresh in EC).
Raising and lowering hybrid IROs; the lazy invariant (EC l. 553–763) #
RaiseHybridIRO, LowerHybridIRO, lazy_invar and its lemmas are the first port's.
EC derives this inline (have {2}<- := unpadBlocksK xs0{2}; first by rewrite (some_oget (unpad_blocks xs0{2}))): a valid block list is the padding of what it unpads to.
EC's lemma LowerFun_IRO_HybridIROLazy_f : equiv[LowerFun(IRO).f ~ LowerHybridIRO(HybridIROLazy).f : ={xs, n} /\ lazy_invar IRO.mp{1} HybridIROLazy.mp{2} ==> ={res} /\ lazy_invar IRO.mp{1} HybridIROLazy.mp{2}].
EC's script; where EC passes the first assignments by seq 0 1 … ; first auto, sp takes all of
them, so the conditionals EC reaches by position (rcondt{1} 3, rcondt{2} 4, rcondt{1} 7)
are first.
EC's lemma IRO_RaiseHybridIRO_HybridIROLazy_f : equiv[IRO.f ~ RaiseHybridIRO(HybridIROLazy).f : ={n} /\ x{1} = bs{2} /\ lazy_invar IRO.mp{1} HybridIROLazy.mp{2} ==> ={res} /\ lazy_invar IRO.mp{1} HybridIROLazy.mp{2}].
EC's lemma Lower_HybridIROEager_f : equiv[LowerHybridIRO(HybridIROEager).f ~ HybridIROEager.f : ={xs, HybridIROEager.mp} /\ n{1} * r = n{2} ==> res{1} = bits2blocks res{2} /\ ={HybridIROEager.mp}].
HybridIROEagerTrans (EC l. 904–1186) #
The module is declared in the section FirstPort.
Equations
Instances For
Equations
Instances For
Equations
Instances For
EC's lemma HybridIROEagerTrans_next_block_split : equiv[HybridIROEagerTrans.next_block ~ HybridIROEagerTrans.next_block_split : ={i, m, xs, bs, HybridIROEager.mp} /\ m{1} = i{1} + r /\ size bs{1} = i{1} /\ block_bits_dom_all_in_or_out xs{1} i{1} HybridIROEager.mp{1} ==> ={res, HybridIROEager.mp}].
EC's script for the program steps. The goals EC closes by progress and a list of smts (the
invariants of the three loops) are closed by hand, each in one block: the conjuncts by omega
and the eager_eq_except lemmas, the two quantified ones by cases on the updated key.
HybridIROEagerTrans.next_block and BlockSpongeTrans.next_block (EC l. 1188–1505) #
EC l. 1188–1282 (BlockSpongeTrans, Prog, PrLoopSnoc_sample, iter_mul_one_half_pos,
BlockGen) are the first port's.
EC's mkblockK (the clone Block of BitWord).
EC's ofblockK (the clone Block of BitWord).
A block's bits, all r of them (EC: size_block, take_size).
EC's nth_change_dfl (List.ec; to move to Lib/EC/ListLemmas.lean with the next batch).
EC's lemma BlockGen_loop_direct : equiv[BlockGen.loop ~ BlockGen.direct : true ==> ={res}]
(EC l. 1269).
The second judgment of EC's transitivity HybridIROEagerTrans.next_block_split … in
HybridIROEagerTrans_BlockSpongeTrans_next_block (EC l. 1332–1505: proc=> /=; inline*; sp; wp.
to qed). It is its own lemma because procedure-level transitivity is a rule here, not a tactic
(GAP 8).
EC's lemma HybridIROEagerTrans_BlockSpongeTrans_next_block (i2 : int) (EC l. 1307).
EC: transitivity HybridIROEagerTrans.next_block_split (…) (…)=> //., the rule
prhlProc_trans_ec here (GAP 8): its two side conditions (EC's exists HybridIROEager.mp{1} (x{2}, i{1}, m{1}, blocks2bits bs{2}), and the postconditions composed), then
HybridIROEagerTrans_next_block_split and next_block_split_BlockSpongeTrans.
HybridIROEagerTrans.loop and BlockSpongeTrans.loop (EC l. 1507–1612) #
HybridIROEager.fill_in touches HybridIROEager.mp. Not an EC lemma (EC reads a concrete
module's globals off its code, for call (_ : ={HybridIROEager.mp})).
BlockSponge.BIRO.IRO.fill_in touches BlockSponge.BIRO.IRO.mp. Not an EC lemma (as
fvP_HybridIROEager_fill_in).
EC's lemma HybridIROEagerTrans_BlockSpongeTrans_loop (n' : int) (EC l. 1507).
EC's script. elim n' is induction n', ge0_n' using Int.le_induction, after proc as in EC,
so the hypothesis is about the two bodies and conseq IH fits. A middle memory (EC's
exists HybridIROEager.mp{1} n' xs{2}) is one side's memory with n set, and simp_reads
reads through it. The callee goals of call (_ : ={HybridIROEager.mp}) and
call (_ : ={BlockSponge.BIRO.IRO.mp}) (EC: if=> //; wp; rnd; auto) are closed by the
tactic; EC's smts on the split loop's guard are splitwhile_guard.
HybridIROEager.f and BlockSponge.BIRO.IRO.f (EC l. 1614–1871) #
EC's lemma HybridIROEager_f_BlockIRO_f (n1 : int) (x2 : block list) (EC l. 1614).
EC's script. The right procedure takes its parameters as one pair xn, assigned to x, n
first, so EC's seq 3 2 is equiv_seq 3 3. EC's conseq (_ : P ==> Q) _ (_ : size bs = n - 1 ==> size bs = n) is equiv_conseq (: P ==> Q) _ (: … ==> …) (Logic/ECConseqHoare.lean).
The leaves EC closes by smt are closed by hand; the guards the splitwhiles leave are the
lemmas splitwhile_guard_left, _right, _le.
EC's lemma HybridIROEager_BlockIRO_f (EC l. 1873), the last of the theory HybridIRO.
EC: transitivity HybridIROEager.f (…) (…), the rule prhlProc_trans_ec here (GAP 8), so the
two judgments come first (h₁: conseq Lower_HybridIROEager_f; h₂: exists*, then
conseq (HybridIROEager_f_BlockIRO_f n1 xs')), then EC's two side conditions. The middle
memory (EC: exists HybridIROEager.mp{1} BlockSponge.BIRO.IRO.mp{2} (xs{1}, n{1} * r)) is the
left globals with BlockSponge.BIRO.IRO.mp set to the right one's. Both procedures take one
pair: xs{1} = x{2} /\ ={n} is about its components.
Sponge_Raise_BlockSponge_f (EC l. 1922), the second tactic experiment #
Perm (EC's RP, a PRP) where a DPRIMITIVE is expected: its f, fi.
Equations
- One or more equations did not get rendered due to their size.
Perm where a BlockSponge.DPRIMITIVE is expected.
Equations
- One or more equations did not get rendered due to their size.
BlockSponge.Sponge(Perm), as stmt_inline names the callee.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's local lemma Sponge_Raise_BlockSponge_f : equiv[Sponge(Perm).f ~ RaiseFun(BlockSponge.Sponge(Perm)).f : ={bs, n, glob Perm} ==> ={res, glob Perm}], its proof EC's
(see the module docstring).
Footprints of the concrete modules of the final section #
EC reads a concrete module's globals off its code; the frame rules ask fp_le for a bound on a
concrete callee, which it has for the modules it can read and otherwise takes from the lemmas
stated here (@[fp_bound]), each proved by fp_module. They are what the frames of call H,
conseq H and proc (I) below are found from. Not EC lemmas.
RaiseHybridIRO has no variables.
LowerHybridIRO has no variables.
The main result (EC l. 1913–2146) #
local clone HybridIRO as HIRO: the clone's variables are those of HybridIRO above; they are
fresh for the declared modules in EC, and named in their restrictions here. Dist is restricted
against BlockSim: the region form (with glob R, E14).
EC's local lemma RealIndif_Sponge_BlockSponge &m : Pr[RealIndif(Sponge, Perm, Dist).main() @ &m : res] = Pr[BlockSponge.RealIndif(BlockSponge.Sponge, Perm, LowerDist(Dist)).main() @ &m : res].
EC's call (_ : true) on BlockSim(F).init ~ BlockSim(F').init: init calls no oracle
(BlockSim_rep), so the two sides run the same code, which keeps ={glob BlockSim} (and
={glob Dist}, which it does not touch). Not an EC lemma.
EC's local lemma Ideal_IRO_Experiment_HybridLazy &m : Pr[IdealIndif(IRO, RaiseSim(BlockSim), Dist).main() @ &m : res] = Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROLazy), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROLazy)), Dist).main() @ &m : res].
EC's local lemma Experiment_HybridIROExper_Lazy &m : Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROLazy), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROLazy)), Dist).main() @ &m : res] = Pr[HIRO.HybridIROExper(HIRO.HybridIROLazy, HybridIRODist).main() @ &m : res].
EC's local lemma HybridIROExper_Experiment_Eager &m : Pr[HIRO.HybridIROExper(HIRO.HybridIROEager, HybridIRODist).main() @ &m : res] = Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROEager), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROEager)), Dist).main() @ &m : res].
EC's local lemma Experiment_Hybrid_Lazy_Eager &m : Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROLazy), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROLazy)), Dist).main() @ &m : res] = Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROEager), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROEager)), Dist).main() @ &m : res].
HIRO.HybridIROExper_Lazy_Eager is applied to HybridIRODist, which satisfies its restriction:
EC checks that when the lemma is applied, here it is the instance stated first.
EC's local lemma RaiseHybridIRO_HybridIROEager_RaiseFun_BlockIRO_f : equiv[HIRO.RaiseHybridIRO(HIRO.HybridIROEager).f ~ RaiseFun(BlockSponge.BIRO.IRO).f : ={bs, n} /\ ={glob BlockSim} /\ HIRO.eager_invar BlockSponge.BIRO.IRO.mp{2} HIRO.HybridIROEager.mp{1} ==> ={res} /\ ={glob BlockSim} /\ HIRO.eager_invar BlockSponge.BIRO.IRO.mp{2} HIRO.HybridIROEager.mp{1}].
EC's local lemma Experiment_HybridEager_Ideal_BlockIRO &m : Pr[Experiment(HIRO.RaiseHybridIRO(HIRO.HybridIROEager), BlockSim(HIRO.LowerHybridIRO(HIRO.HybridIROEager)), Dist).main() @ &m : res] = Pr[BlockSponge.IdealIndif(BlockSponge.BIRO.IRO, BlockSim, LowerDist(Dist)).main () @ &m : res].
EC's local lemma IdealIndif_IRO_BlockIRO &m : Pr[IdealIndif(IRO, RaiseSim(BlockSim), Dist).main() @ &m : res] = Pr[BlockSponge.IdealIndif(BlockSponge.BIRO.IRO, BlockSim, LowerDist(Dist)).main () @ &m : res].
EC's lemma conclu &m : |Pr[RealIndif(Sponge, Perm, Dist).main() @ &m : res] -
Pr[IdealIndif(IRO, RaiseSim(BlockSim), Dist).main() @ &m : res]| =
|Pr[BlockSponge.RealIndif(BlockSponge.Sponge, Perm, LowerDist(Dist)).main() @ &m : res] - Pr[BlockSponge.IdealIndif(BlockSponge.BIRO.IRO, BlockSim, LowerDist(Dist)).main() @ &m : res]|.
Conclusion (EC l. 2148–2163) #
EC's lemma conclusion (BlockSim <: BlockSponge.SIMULATOR{-IRO, -BlockSponge.BIRO.IRO}) (Dist <: DISTINGUISHER{-Perm, -BlockSim, -IRO, -BlockSponge.BIRO.IRO}) &m : |Pr[RealIndif(Sponge, Perm, Dist).main() @ &m : res] -
Pr[IdealIndif(IRO, RaiseSim(BlockSim), Dist).main() @ &m : res]| =
|Pr[BlockSponge.RealIndif(BlockSponge.Sponge, Perm, LowerDist(Dist)).main() @ &m : res] - Pr[BlockSponge.IdealIndif(BlockSponge.BIRO.IRO, BlockSim, LowerDist(Dist)).main() @ &m : res]|.
The restrictions also name the variables of the theory HybridIRO and of its local clone ERO
(fresh in EC), Dist's restriction against BlockSim is the region form (with glob R, E14),
and the oracle lists of EC's module type SIMULATOR are the hypothesis BlockSim_rep (E2).