Indifferentiability of the sponge (EasyCrypt proof/SHA3Indiff.ec) — EC-fidelity port, complete #
The lemmas of SHA3Indiff.ec in EC's scripts, over the old port's declarations of Simulator,
Cntr, FC, PC, DRestr (section FirstPort below), as SmartCounter/Gconcl.lean over the
old Gconcl.
Translation:
require import Common Sponge. import BIRO.is theopenbelow.- EC's section
declare module Dist <: DISTINGUISHER {-…}anddeclare axiom Dist_losslessare adeclare moduleand a variable; the restriction also names the modules of the files whose lemmas the proofs use (fresh in EC).Disthas a region for itsglob(with glob R, exception E14):securityappliesSponge.conclusionandGconcl_list.Real_IdealtoDRestr(Dist)andLowerDist(Dist), andDist_losslessrestricts its oracles againstR.
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):
require import Common Sponge. import BIRO.is theopenbelow: unqualified names areSponge's (DISTINGUISHER,RealIndif,LowerDist…) andIROisSponge.BIRO.IRO.type state = SLCommon.state,op parse = BlockSponge.parse,op valid = Gconcl_list.validandop limit = SLCommon.max_sizeare abbreviations.SimulatorandFC,PChave no type in EasyCrypt; they are used as aSIMULATOR, aFUNCTIONALITYand aPRIMITIVE, and declared at those types.- The section's
declare module Distand its restrictions are hypotheses (DistRestrictions);declare axiom Dist_losslessis the hypothesisDist_losslessof the lemmas whose proofs use it (security).
The last inlined simulator #
Instances For
Instances For
Instances For
EC's Simulator.m.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's Simulator.mi.
Equations
- One or more equations did not get rendered due to their size.
Instances For
EC's Simulator.paths.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instantiating the holes of Simulator.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 [Simulator.fi.procedure.apply_simp]).
The body of proc init of module Simulator, 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 Simulator.init.procedure.apply_simp) rather than run. Use Simulator.init 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 Simulator, 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 Simulator.init, Simulator.f, Simulator.fi, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma Simulator.apply_simp says.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: Simulator.init = Module.proc Simulator.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
@[simp]: applying Simulator.f to the parameters proc f uses (F) is Module.proc (Simulator.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 Simulator, 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 Simulator.f.procedure.apply_simp) rather than run. Use Simulator.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 Simulator.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 [Simulator.init.procedure.apply_simp]).
proc fi of module Simulator as a module: Module.proc Simulator.fi.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Simulator.fi.apply_simp says exactly that.
Equations
Instances For
@[simp]: applying Simulator to a tuple of its single parameter F — the record of its procedures Simulator.init, Simulator.f, Simulator.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 Simulator.init.apply_simp, Simulator.f.apply_simp, Simulator.fi.apply_simp to fill that procedure's holes.
proc f of module Simulator 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 Simulator.f.apply_simp, which fills the holes of Simulator.f.procedure with the callees the body called.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]: Simulator.fi = Module.proc Simulator.fi.procedure — true by definition, proc fi using no module parameter and so having no holes to fill.
proc init of module Simulator as a module: Module.proc Simulator.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Simulator.init.apply_simp says exactly that.
Equations
Instances For
The body of proc fi of module Simulator, 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 Simulator.fi.procedure.apply_simp) rather than run. Use Simulator.fi 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 Simulator.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 [Simulator.f.procedure.apply_simp]).
Restrictions #
The counter for the functionality counts the number of times the underlying primitive is called inside the functionality. This number is equal to the sum of the number of blocks in the padding of the input, plus the number of additional blocks the squeezing phase has to output.
EC's Cntr.c.
Equations
- GaudisCrypt.SHA3.SHA3Indiff.Cntr.c = GaudisCrypt.varLens (GaudisCrypt.VariableName.mk "GaudisCrypt.SHA3.SHA3Indiff.Cntr.c" ℤ)
Instances For
@[simp]: Cntr.init = Module.proc Cntr.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
proc init of module Cntr as a module: Module.proc Cntr.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Cntr.init.apply_simp says exactly that.
Equations
Instances For
The body of proc init of module Cntr, 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 Cntr.init.procedure.apply_simp) rather than run. Use Cntr.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.SHA3Indiff.Cntr.init.procedure = proc () : Unit { GaudisCrypt.SHA3.SHA3Indiff.Cntr.c <- 0; return () }
Instances For
The module declared by module Cntr: the record of its procedures Cntr.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 Cntr.apply_simp to apply it with.
Instances For
Instantiating the holes of Cntr.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 [Cntr.init.procedure.apply_simp]).
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]).
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
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
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]).
proc init of module FC as a module: Module.proc FC.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — FC.init.apply_simp says exactly that.
Equations
Instances For
@[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.
@[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.
The body of proc init of module FC, 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 FC.init.procedure.apply_simp) rather than run. Use FC.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.SHA3Indiff.FC.init.procedure = proc () : Unit { skip; return () }
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
@[simp]: FC.init = Module.proc FC.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
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
@[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.
@[simp]: PC.init = Module.proc PC.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.
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]).
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
@[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.
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.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]).
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
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 init of module PC, 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 PC.init.procedure.apply_simp) rather than run. Use PC.init for this procedure as a module.
Equations
- GaudisCrypt.SHA3.SHA3Indiff.PC.init.procedure = proc () : Unit { skip; return () }
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]).
proc init of module PC as a module: Module.proc PC.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — PC.init.apply_simp says exactly that.
Equations
Instances For
@[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.
@[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.
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 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
@[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.
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
The section, with `declare module Dist <: DISTINGUISHER {-Perm, -Gconcl_list.SimLast, -IRO, #
-Cntr, -BlockSponge.BIRO.IRO, -Simulator, -BlockSponge.C, -Gconcl.S, -SLCommon.F.RO,
-SLCommon.F.FRO, -SLCommon.Redo, -SLCommon.C, -Gconcl_list.BIRO2.IRO, -Gconcl_list.F2.RO,
-Gconcl_list.F2.FRO, -Gconcl_list.Simulator}anddeclare axiom Dist_lossless`
EC's ={c}(Cntr, BlockSponge.C): Cntr.c{1} = BlockSponge.C.c{2}.
Equations
- GaudisCrypt.SHA3.SHA3Indiff.cI x y = (x.1 = y.2)
Instances For
LowerDist(Dist) touches what Dist does. Not an EC lemma.
DRestr(Dist) touches Dist's variables and Cntr.c. Not an EC lemma.
SimLast(Gconcl.S) is an EasyCrypt-like simulator: its init does not depend on the oracle
(Gconcl.S.init calls nothing), so it is representable (SIMULATOR.representable_of_init), and
it has finitely many variables. Not an EC lemma (EasyCrypt's module typing).
The bound (limit ^ 2 - limit)%r / (2 ^ (r + c + 1))%r + (4 * limit ^ 2)%r / (2 ^ c)%r of
security and SHA3Indiff (an abbreviation).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The bound of Gconcl_list.Real_Ideal is bound.
Gap list (batch-fix later, see TRANSFER_SKILL.md §1.6):
- (GAP 3, fixed:
glob IROread off its code as={IRO.mp},Logic/GlobWrites.lean; the call's frame throughRaiseSim(…)(IRO).) - GAP 4 (closed 2026-11-23): after
byequiv(all globals equal) andspover the initializations, the two memories' equation (X.set v (…σ₁.globals) = Y.set w (…σ₂.globals)) was not used forglob D's equality; the closer'smem_eq_readsreads it off now. - GAP 5:
RaiseSim(S)viewsS's block-level procedures at the bit level (PRIMITIVE's parameters spelled differently): the inliner appliesSimLast'sapply_simpthere only at default transparency, byset_option inline.defEqApply true(always on, it inlines further than the first port's proofs expect). - GAP 2 (closed 2026-11-21): our inliner renames a callee's locals per side (
x2, n0againstx0, ninequiv_sim_f's IRO loops), as EC's does;simrelates them by position (EC's equality set of pairs), soequiv_sim_fis EC'slast sim; smt(…). - GAP 6 (closed 2026-11-17):
LowerDist(D, F, P)passesP,BlockSponge's primitive, to the bit sponge'sD(one module type in EC);equiv_procopens its procedures as EC'sproc. - GAP 1: inline by name: EC's paths over
Perm(BlockSponge.FC(BlockSponge.Sponge(Perm)).f) do not elaborate over the old declarations (Permis not aBlockSponge.DPRIMITIVE; Gcol's GAP 2): by index.
RaiseSim(S) touches what S and LowerFun touch (Module.comp). Not an EC lemma.
EC's glob Gconcl_list.SimLast(Gconcl.S): the variables of Gconcl.S and
Gconcl_list.BIRO2.IRO.mp.
EC's glob LowerDist(Dist): glob Dist (LowerDist has no variables).
EC's lemma drestr_commute1 &m.
EC's lemma drestr_commute2 &m.
EC's local equiv equiv_sim_f (F <: DFUNCTIONALITY{-Gconcl.S, -Simulator}) : RaiseSim(Gconcl_list.SimLast(Gconcl.S),F).f ~ Simulator(F).f : ={arg, glob F, glob Gconcl_list.BIRO2.IRO} /\ ={m, mi, paths}(Gconcl.S,Simulator) ==> ={res, glob F, glob Gconcl_list.BIRO2.IRO} /\ ={m, mi, paths}(Gconcl.S,Simulator).
EC's local equiv equiv_sim_fi (F <: DFUNCTIONALITY{-Gconcl.S, -Simulator}) : RaiseSim(Gconcl_list.SimLast(Gconcl.S),F).fi ~ Simulator(F).fi : ={arg, glob F, glob Gconcl_list.BIRO2.IRO} /\ ={m, mi, paths}(Gconcl.S,Simulator) ==> ={res, glob F, glob Gconcl_list.BIRO2.IRO} /\ ={m, mi, paths}(Gconcl.S,Simulator).
EC's local lemma replace_simulator &m.
EC's lemma security &m : |Pr[RealIndif(Sponge, Perm, DRestr(Dist)).main() @ &m : res] -
Pr[IdealIndif(IRO, Simulator, DRestr(Dist)).main() @ &m : res]| <=
(limit ^ 2 - limit)%r / (2 ^ (r + c + 1))%r + (4 * limit ^ 2)%r / (2 ^ c)%r`.
EC's lemma SHA3Indiff (Dist <: DISTINGUISHER{-Perm, -IRO, -BlockSponge.BIRO.IRO, -Cntr, -Simulator, -Gconcl_list.SimLast(Gconcl.S), -BlockSponge.C, -Gconcl.S, -SLCommon.F.RO, -SLCommon.F.FRO, -SLCommon.Redo, -SLCommon.C, -Gconcl_list.BIRO2.IRO, -Gconcl_list.F2.RO, -Gconcl_list.F2.FRO, -Gconcl_list.Simulator}) &m : (forall (F <: DFUNCTIONALITY {-Dist}) (P <: DPRIMITIVE {-Dist}), islossless P.f => islossless P.fi => islossless F.f => islossless Dist(F,P).distinguish) => |Pr[RealIndif(Sponge, Perm, DRestr(Dist)).main() @ &m : res] -
Pr[IdealIndif(IRO, Simulator, DRestr(Dist)).main() @ &m : res]| <=
(limit ^ 2 - limit)%r / (2 ^ (r + c + 1))%r + (4 * limit ^ 2)%r / (2 ^ c)%r`.
The restriction and glob Dist as in the section above.