The squeezeless sponge: common definitions (EasyCrypt proof/smart_counter/SLCommon.ec) — #
EC-fidelity port
The construction SqueezelessSponge, the counting and restricting wrappers C, PC, DPRestr,
FC, DFRestr, DRestr, and their lemmas. The operators without modules (the parameter class
with max_size, state, the Prefix theory, the handle operators) are
SmartCounter/SLCommonCore.lean, shared with the first port.
Translation (as the pilots' IndifRO_is_secure):
clone include Indifferentiability with type p <- state, … rename [module] "GReal" as "RealIndif" [module] "GIdeal" as "IdealIndif"isclone import … as Indiff(clonehas noincludeand norename),RealIndifandIdealIndifaliases ofGReal,GIdeal;clone import FullRO as F with …is the namespaceFofPROM.FullROat the clone's types, its module variablesglobal_vars;- the procedure aliases of
PRestr,FRestr(proc f = DPRestr(P).f) are wrapped in a call (exception E5); DRestr(D, F, P)takesDas a Lean parameter:DRestr(D)is EC's partial application.
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):
op max_size : { int | 0 <= max_size } as max_ge0extends the parameter class:Params.prefixis a Lean keyword, hence«prefix».clone include Indifferentiability with type p <- state …is the abbreviations below (PRIMITIVE…,Indif,RealIndif,IdealIndif);clone import FullRO as F …is the namespaceF.- Modules whose procedures alias another module's (
PRestr,FRestr:proc f = DPRestr(P).f) are Lean functions assembling the procedures withT.mk. DRestr(D : DISTINGUISHER, F, P)takesDas a Lean parameter, so thatDRestr Dis aDISTINGUISHER(EasyCrypt uses it partially applied,DRestr(D)).- A memory restriction
{-C}is a footprint hypothesis againstC.footprint.
`clone include Indifferentiability with type p <- state, type f_in <- block list, #
type f_out <- block rename [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.
The ideal functionality #
The clone's module variable F.RO.m.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The clone's module variable F.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
F.RO as its type RO (PROM.FullRO.RO.asRO).
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
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The squeezeless sponge #
EC's Redo.prefixes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc init of module Redo, 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 Redo.init.procedure.apply_simp) rather than run. Use Redo.init 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 Redo as a module: Module.proc Redo.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Redo.init.apply_simp says exactly that.
Equations
Instances For
Instantiating the holes of Redo.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 [Redo.init.procedure.apply_simp]).
The module declared by module Redo: the record of its procedures Redo.init.
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 Redo.apply_simp to apply it with.
Instances For
@[simp]: Redo.init = Module.proc Redo.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
proc f of module SqueezelessSponge 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 SqueezelessSponge.f.apply_simp, which fills the holes of SqueezelessSponge.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 SqueezelessSponge, 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 SqueezelessSponge.f.procedure.apply_simp) rather than run. Use SqueezelessSponge.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying SqueezelessSponge to a tuple of its single parameter P — the record of its procedures SqueezelessSponge.init, SqueezelessSponge.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 SqueezelessSponge.init.apply_simp, SqueezelessSponge.f.apply_simp to fill that procedure's holes.
The body of proc init of module SqueezelessSponge, 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 SqueezelessSponge.init.procedure.apply_simp) rather than run. Use SqueezelessSponge.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.SLCommon.SqueezelessSponge.init.procedure = proc () : Unit { call GaudisCrypt.SHA3.SLCommon.Redo.init.procedure (); return () }
Instances For
Instantiating the holes of SqueezelessSponge.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 [SqueezelessSponge.init.procedure.apply_simp]).
@[simp]: applying SqueezelessSponge.f to the parameters proc f uses (P) is Module.proc (SqueezelessSponge.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 init of module SqueezelessSponge as a module: Module.proc SqueezelessSponge.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — SqueezelessSponge.init.apply_simp says exactly that.
Equations
Instances For
@[simp]: SqueezelessSponge.init = Module.proc SqueezelessSponge.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
The module declared by module SqueezelessSponge, 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 SqueezelessSponge.init, SqueezelessSponge.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma SqueezelessSponge.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of SqueezelessSponge.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 [SqueezelessSponge.f.procedure.apply_simp]).
Counting and restricting #
EC's C.c.
Equations
- GaudisCrypt.SHA3.SLCommon.C.c = GaudisCrypt.varLens (GaudisCrypt.VariableName.mk "GaudisCrypt.SHA3.SLCommon.C.c" ℤ)
Instances For
EC's C.queries.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of C.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 [C.init.procedure.apply_simp]).
@[simp]: C.init = Module.proc C.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
The module declared by module C: the record of its procedures C.init.
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 C.apply_simp to apply it with.
Instances For
The body of proc init of module C, 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 C.init.procedure.apply_simp) rather than run. Use C.init 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 C as a module: Module.proc C.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — C.init.apply_simp says exactly that.
Equations
Instances For
@[simp]: applying PC.init to the parameters proc init uses (P) is Module.proc (PC.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.
proc fi of module PC 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 PC.fi.apply_simp, which fills the holes of PC.fi.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 PC.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 [PC.f.procedure.apply_simp]).
@[simp]: applying PC.f to the parameters proc f uses (P) is Module.proc (PC.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 module declared by module PC, 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 PC.init, PC.f, PC.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma PC.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc fi of module PC, 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 PC.fi.procedure.apply_simp) rather than run. Use PC.fi 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 PC, 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 PC.init.procedure.apply_simp) rather than run. Use PC.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.SLCommon.PC.init.procedure = proc () uses (P_init : () → Unit) : Unit { call GaudisCrypt.SHA3.SLCommon.C.init.procedure (); call P_init (); return () }
Instances For
Instantiating the holes of PC.fi.procedure with a tuple holeArgs of procedures: the body of proc fi 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 [PC.fi.procedure.apply_simp]).
@[simp]: applying PC.fi to the parameters proc fi uses (P) is Module.proc (PC.fi.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 PC to a tuple of its single parameter P — the record of its procedures PC.init, PC.f, PC.fi, 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 PC.init.apply_simp, PC.f.apply_simp, PC.fi.apply_simp to fill that procedure's holes.
proc f of module PC 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 PC.f.apply_simp, which fills the holes of PC.f.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 PC.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 [PC.init.procedure.apply_simp]).
proc init of module PC 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 PC.init.apply_simp, which fills the holes of PC.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 PC, 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 PC.f.procedure.apply_simp) rather than run. Use PC.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc fi of module DPRestr 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 DPRestr.fi.apply_simp, which fills the holes of DPRestr.fi.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 DPRestr, 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 DPRestr.f, DPRestr.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DPRestr.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc f of module DPRestr 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 DPRestr.f.apply_simp, which fills the holes of DPRestr.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 fi of module DPRestr, 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 DPRestr.fi.procedure.apply_simp) rather than run. Use DPRestr.fi 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 f of module DPRestr, 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 DPRestr.f.procedure.apply_simp) rather than run. Use DPRestr.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 DPRestr.fi.procedure with a tuple holeArgs of procedures: the body of proc fi 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 [DPRestr.fi.procedure.apply_simp]).
@[simp]: applying DPRestr.f to the parameters proc f uses (P) is Module.proc (DPRestr.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 DPRestr to a tuple of its single parameter P — the record of its procedures DPRestr.f, DPRestr.fi, 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 DPRestr.f.apply_simp, DPRestr.fi.apply_simp to fill that procedure's holes.
@[simp]: applying DPRestr.fi to the parameters proc fi uses (P) is Module.proc (DPRestr.fi.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 DPRestr.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 [DPRestr.f.procedure.apply_simp]).
proc init of module FC 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 FC.init.apply_simp, which fills the holes of FC.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 FC, 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 FC.f.procedure.apply_simp) rather than run. Use FC.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 FC, 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 FC.init, FC.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma FC.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The body of proc init of module FC, 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 FC.init.procedure.apply_simp) rather than run. Use FC.init for this procedure as a module.
Equations
Instances For
@[simp]: applying FC.init to the parameters proc init uses (F) is Module.proc (FC.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.
proc f of module FC 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 FC.f.apply_simp, which fills the holes of FC.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 FC to a tuple of its single parameter F — the record of its procedures FC.init, FC.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 FC.init.apply_simp, FC.f.apply_simp to fill that procedure's holes.
Instantiating the holes of FC.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 [FC.f.procedure.apply_simp]).
@[simp]: applying FC.f to the parameters proc f uses (F) is Module.proc (FC.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 FC.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 [FC.init.procedure.apply_simp]).
proc f of module DFRestr 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 DFRestr.f.apply_simp, which fills the holes of DFRestr.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 DFRestr to a tuple of its single parameter F — the record of its procedures DFRestr.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 DFRestr.f.apply_simp to fill that procedure's holes.
Instantiating the holes of DFRestr.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 [DFRestr.f.procedure.apply_simp]).
@[simp]: applying DFRestr.f to the parameters proc f uses (F) is Module.proc (DFRestr.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 DFRestr, 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 DFRestr.f.procedure.apply_simp) rather than run. Use DFRestr.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 DFRestr, 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 DFRestr.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DFRestr.apply_simp says.
Equations
Instances For
proc distinguish of module DRestr 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 DRestr.distinguish.apply_simp, which fills the holes of DRestr.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 DRestr to a tuple of its 2 parameters F, P — the record of its procedures DRestr.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 DRestr.distinguish.apply_simp to fill that procedure's holes.
@[simp]: applying DRestr.distinguish to the parameters proc distinguish uses (F, P) is Module.proc (DRestr.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 DRestr, 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 DRestr.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DRestr.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of DRestr.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 [DRestr.distinguish.procedure.apply_simp]).
The body of proc distinguish of module DRestr, 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 DRestr.distinguish.procedure.apply_simp) rather than run. Use DRestr.distinguish for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The module types, the module variables and the modules C, Redo,
SqueezelessSponge, PC, DPRestr, FC, DFRestr, DRestr are declared in the section
FirstPort above: one declaration per EC variable, shared with Handle, Gcol, Gext,
Gconcl.
Instantiating the holes of PRestr.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 [PRestr.f.procedure.apply_simp]).
proc fi of module PRestr 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 PRestr.fi.apply_simp, which fills the holes of PRestr.fi.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 PRestr, 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 PRestr.init, PRestr.f, PRestr.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma PRestr.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
proc init of module PRestr 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 PRestr.init.apply_simp, which fills the holes of PRestr.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 PRestr, 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 PRestr.f.procedure.apply_simp) rather than run. Use PRestr.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying PRestr.f to the parameters proc f uses (P) is Module.proc (PRestr.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 PRestr 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 PRestr.f.apply_simp, which fills the holes of PRestr.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 fi of module PRestr, 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 PRestr.fi.procedure.apply_simp) rather than run. Use PRestr.fi for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying PRestr to a tuple of its single parameter P — the record of its procedures PRestr.init, PRestr.f, PRestr.fi, 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 PRestr.init.apply_simp, PRestr.f.apply_simp, PRestr.fi.apply_simp to fill that procedure's holes.
@[simp]: applying PRestr.fi to the parameters proc fi uses (P) is Module.proc (PRestr.fi.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 PRestr.init to the parameters proc init uses (P) is Module.proc (PRestr.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 PRestr, 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 PRestr.init.procedure.apply_simp) rather than run. Use PRestr.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.Pilot.SLCommon.PRestr.init.procedure = proc () uses (P_init : () → Unit) : Unit { call GaudisCrypt.SHA3.SLCommon.C.init.procedure (); call P_init (); return () }
Instances For
Instantiating the holes of PRestr.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 [PRestr.init.procedure.apply_simp]).
Instantiating the holes of PRestr.fi.procedure with a tuple holeArgs of procedures: the body of proc fi 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 [PRestr.fi.procedure.apply_simp]).
Instantiating the holes of FRestr.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 [FRestr.init.procedure.apply_simp]).
@[simp]: applying FRestr.init to the parameters proc init uses (F) is Module.proc (FRestr.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 FRestr, 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 FRestr.init, FRestr.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma FRestr.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying FRestr to a tuple of its single parameter F — the record of its procedures FRestr.init, FRestr.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 FRestr.init.apply_simp, FRestr.f.apply_simp to fill that procedure's holes.
proc f of module FRestr 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 FRestr.f.apply_simp, which fills the holes of FRestr.f.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 FRestr.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 [FRestr.f.procedure.apply_simp]).
The body of proc f of module FRestr, 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 FRestr.f.procedure.apply_simp) rather than run. Use FRestr.f for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: applying FRestr.f to the parameters proc f uses (F) is Module.proc (FRestr.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 init of module FRestr 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 FRestr.init.apply_simp, which fills the holes of FRestr.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 init of module FRestr, 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 FRestr.init.procedure.apply_simp) rather than run. Use FRestr.init for this procedure as a module.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's lemma rp_ll (P <: DPRIMITIVE{-C}): islossless P.f => islossless DPRestr(P).f.
EC's lemma rpi_ll (P <: DPRIMITIVE{-C}): islossless P.fi => islossless DPRestr(P).fi.
EC's lemma rf_ll (F <: DFUNCTIONALITY{-C}): islossless F.f => islossless DFRestr(F).f.
EC's lemma DRestr_ll (D <: DISTINGUISHER{-C}): (forall (F <: DFUNCTIONALITY{-D}) (P <: DPRIMITIVE{-D}), islossless P.f => islossless P.fi => islossless F.f => islossless D(F,P).distinguish) => forall (F <: DFUNCTIONALITY{-DRestr(D)}) (P <: DPRIMITIVE{-DRestr(D)}), islossless P.f => islossless P.fi => islossless F.f => islossless DRestr(D, F, P).distinguish; {-DRestr(D)} is {-D, -C}, its globals.
Section RESTR #
EC's lemma swap_restr &m: Pr[Indif(FRestr(F), PRestr(P), D).main() @ &m: res] = Pr[Indif(F,P,DRestr(D)).main() @ &m: res].
Section COUNT #
EC's lemma Pr_restr &m : Pr[Indif(FC(CO(P)), PC(P), D).main()@ &m:res /\ C.c <= max_size] <= Pr[Indif(CO(P), P, DRestr(D)).main()@ &m:res].
EC's proof, step for step: byequiv (_: ={glob D, glob P, glob CO} ==> …); symmetry; proc; inline *; wp; call (_: max_size < C.c, ={glob P, glob CO, glob C}), then per oracle its
equivalence (proc; sp; if{1}, the call kept by sim, EC's call (_: true); call{2} f_ll
past the bad event), the left oracle's losslessness and the right one's phoare (call f_ll
keeping C.c, phoare_call f_ll / C.c); EC's auto => /# is auto_close, its
smt(prefix_sizel) the instance of prefix_sizel and auto_close. Deviation: the right
oracles' islossless (exception E11).
module GReal(D : DISTINGUISHER) = RealIndif(SqueezelessSponge, PC(Perm), D), Perm the
PRIMITIVE of Common's permutation (EC's clone of RP at block * capacity).
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.