Documentation

GaudisCrypt.Examples.SHA3.SHA3Security

Top-level proof of SHA-3 security (EasyCrypt proof/SHA3Security.ec) — EC-fidelity port #

All of SHA3Security.ec: the file's modules, the clone S of IndifRO_is_secure, and the sections Preimage (Sponge_preimage_resistant), SecondPreimage (Sponge_second_preimage_resistant), Collision (Sponge_coll_resistant), SHA3_Collision (SHA3_coll_resistant).

Translation:

Gap list (batch-fix later, see TRANSFER_SKILL.md §1.6):

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):

EasyCrypt's file-level abstract type and operators, with their axioms: op size_out with size_out_gt0, op sigma with sigma_gt0, type f_out, op dout with dout_ll, dout_fu, dout_full, op to_list, op of_list with spec_dout, spec2_dout, to_list_inj, to_listK and dout_equal_dlist.

Instances
    @[reducible, inline]

    The bound of SHA3Indiff, (limit ^ 2 - limit)%r / (2 ^ (r + c + 1))%r + (4 * limit ^ 2)%r / (2 ^ c)%r, the clone's bound.

    Equations
    Instances For

      The section's ops same_ro, same_ro2: the map of SRO.RO.RO agrees with that of BIRO.IRO on the first size_out bits.

      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

          The real side of the sections' first have #

          GReal(CSetSize(Sponge), Perm, D(A)) against RealIndif(Sponge, Perm, DRestr(DSetSize(D(A)))): the two games differ in Cntr.c (written on the right only); EC's invariant ={glob SRO.Counter, glob Perm} /\ invm Perm.m{1} Perm.mi{1} /\ ={c}(SRO.Counter, Cntr) is the states equal outside realL with realI on its contents (the adversary is outside realL).

          The sections' side conditions: adversaries, distinguishers, the simulator #

          The section Preimage, with declare module A <: SRO.AdvPreimage {…, -DPre} and #

          declare axiom A_ll (its local declarations in the namespace Preimage)

          The section SecondPreimage, with `declare module A <: SRO.AdvSecondPreimage #

          {…, -D2Pre}anddeclare axiom A_ll(its local declarations in the namespace `SecondPreimage`)

          The section Collision, with declare module A <: SRO.AdvCollision {…} and #

          declare axiom A_ll (its local declarations in the namespace Collision)

          Instantiating the holes of SHA3.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 [SHA3.init.procedure.apply_simp]).

          @[simp]

          @[simp]: applying SHA3 to a tuple of its single parameter P — the record of its procedures SHA3.init, SHA3.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 SHA3.init.apply_simp, SHA3.f.apply_simp to fill that procedure's holes.

          proc f of module SHA3 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 SHA3.f.apply_simp, which fills the holes of SHA3.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 SHA3, 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 SHA3.init, SHA3.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma SHA3.apply_simp says.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[simp]

              @[simp]: SHA3.init = Module.proc SHA3.init.procedure — true by definition, proc init using no module parameter and so having no holes to fill.

              Instantiating the holes of SHA3.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 [SHA3.f.procedure.apply_simp]).

              The body of proc f of module SHA3, 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 SHA3.f.procedure.apply_simp) rather than run. Use SHA3.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 SHA3 as a module: Module.proc SHA3.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — SHA3.init.apply_simp says exactly that.

                Equations
                Instances For
                  @[simp]

                  @[simp]: applying SHA3.f to the parameters proc f uses (P) is Module.proc (SHA3.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 init of module SHA3, 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 SHA3.init.procedure.apply_simp) rather than run. Use SHA3.init for this procedure as a module.

                  Equations
                  Instances For

                    clone import IndifRO_is_secure as S with … (EC l. 80–100) #

                    The file's modules (EC l. 62–123) #

                    @[simp]

                    @[simp]: applying CSetSize to a tuple of its single parameter P — the record of its procedures CSetSize.init, CSetSize.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 CSetSize.init.apply_simp, CSetSize.f.apply_simp to fill that procedure's holes.

                    proc init = …; of module CSetSize: an alias, EasyCrypt's proc init = M.g — the callee itself, as a module abstracted over the module parameters it uses (P, in declaration order). It has no CSetSize.init.procedure: applied with the @[simp] lemma CSetSize.init.apply_simp, it is the callee.

                    Equations
                    Instances For
                      @[simp]

                      @[simp]: applying CSetSize.f to the parameters proc f uses (P) is Module.proc (CSetSize.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]

                      @[simp]: the alias CSetSize.init, applied to the parameters its callee uses (P), is its callee, as written in the declaration.

                      proc f of module CSetSize 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 CSetSize.f.apply_simp, which fills the holes of CSetSize.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 CSetSize.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 [CSetSize.f.procedure.apply_simp]).

                        The body of proc f of module CSetSize, 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 CSetSize.f.procedure.apply_simp) rather than run. Use CSetSize.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 CSetSize, 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 CSetSize.init, CSetSize.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma CSetSize.apply_simp says.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            proc init = …; of module FSetSize: an alias, EasyCrypt's proc init = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, in declaration order). It has no FSetSize.init.procedure: applied with the @[simp] lemma FSetSize.init.apply_simp, it is the callee.

                            Equations
                            Instances For

                              The module declared by module FSetSize, 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 FSetSize.init, FSetSize.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma FSetSize.apply_simp says.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                The body of proc f of module FSetSize, 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 FSetSize.f.procedure.apply_simp) rather than run. Use FSetSize.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 FSetSize.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 [FSetSize.f.procedure.apply_simp]).

                                  @[simp]

                                  @[simp]: applying FSetSize to a tuple of its single parameter F — the record of its procedures FSetSize.init, FSetSize.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 FSetSize.init.apply_simp, FSetSize.f.apply_simp to fill that procedure's holes.

                                  @[simp]

                                  @[simp]: applying FSetSize.f to the parameters proc f uses (F) is Module.proc (FSetSize.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 FSetSize 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 FSetSize.f.apply_simp, which fills the holes of FSetSize.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 FGetSize.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 [FGetSize.f.procedure.apply_simp]).

                                    proc f of module FGetSize 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 FGetSize.f.apply_simp, which fills the holes of FGetSize.f.procedure with the callees the body called.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      @[simp]

                                      @[simp]: applying FGetSize to a tuple of its single parameter F — the record of its procedures FGetSize.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 FGetSize.f.apply_simp to fill that procedure's holes.

                                      @[simp]

                                      @[simp]: applying FGetSize.f to the parameters proc f uses (F) is Module.proc (FGetSize.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 FGetSize, 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 FGetSize.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma FGetSize.apply_simp says.

                                      Equations
                                      Instances For

                                        The body of proc f of module FGetSize, 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 FGetSize.f.procedure.apply_simp) rather than run. Use FGetSize.f for this procedure as a module.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          EC's module SimSetSize (S : SIMULATOR) (F : Indiff0.DFUNCTIONALITY) = S(FGetSize(F)).

                                          Equations
                                          Instances For

                                            Instantiating the holes of DFSetSize.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 [DFSetSize.f.procedure.apply_simp]).

                                            @[simp]

                                            @[simp]: applying DFSetSize.f to the parameters proc f uses (F) is Module.proc (DFSetSize.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 DFSetSize, 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 DFSetSize.f, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DFSetSize.apply_simp says.

                                            Equations
                                            Instances For

                                              The body of proc f of module DFSetSize, 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 DFSetSize.f.procedure.apply_simp) rather than run. Use DFSetSize.f for this procedure as a module.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                @[simp]

                                                @[simp]: applying DFSetSize to a tuple of its single parameter F — the record of its procedures DFSetSize.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 DFSetSize.f.apply_simp to fill that procedure's holes.

                                                proc f of module DFSetSize 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 DFSetSize.f.apply_simp, which fills the holes of DFSetSize.f.procedure with the callees the body called.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  The globals of the file's modules, and the modules under the clone's module types #

                                                  EC reads a concrete module's globals off its code, and a module of a sponge module type is one of the clone's. Here the bounds are stated (@[fp_bound], Module.GlobBound at the clone's module types: what the clone's lemmas ask), and the modules that the clone's games apply at its types are the file's by equations that hold by definition (GAP 6).

                                                  @[simp]

                                                  @[simp]: applying DSetSize to a tuple of its 2 parameters F, P — the record of its procedures DSetSize.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 DSetSize.distinguish.apply_simp to fill that procedure's holes.

                                                  proc distinguish = …; of module DSetSize: an alias, EasyCrypt's proc distinguish = M.g — the callee itself, as a module abstracted over the module parameters it uses (F, P, in declaration order). It has no DSetSize.distinguish.procedure: applied with the @[simp] lemma DSetSize.distinguish.apply_simp, it is the callee.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For

                                                    The module declared by module DSetSize, 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 DSetSize.distinguish, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma DSetSize.apply_simp says.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      @[simp]

                                                      @[simp]: the alias DSetSize.distinguish, applied to the parameters its callee uses (F, P), is its callee, as written in the declaration.

                                                      theorem GaudisCrypt.SHA3.Pilot.SHA3Security.fvP_DSetSize_DPre [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] [SHA3Security.Params] (A : S.SRO.AdvPreimage) :
                                                      FVP.fvP (DSetSize (S.DPre A)) ≤ FVP.fvP A ⊔ (S.SRO.Counter.c.footprint ⊔ (S.SRO.Bounder.bounder.footprint ⊔ S.DPre.h.footprint))

                                                      DSetSize(DPre(A)) touches A's variables, SRO.Counter.c, SRO.Bounder.bounder and DPre.h (EC reads the globals off the code).

                                                      theorem GaudisCrypt.SHA3.Pilot.SHA3Security.fvP_DSetSize_D2Pre [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] [SHA3Security.Params] (A : S.SRO.AdvSecondPreimage) :
                                                      FVP.fvP (DSetSize (S.D2Pre A)) ≤ FVP.fvP A ⊔ (S.SRO.Counter.c.footprint ⊔ (S.SRO.Bounder.bounder.footprint ⊔ S.D2Pre.m2.footprint))

                                                      DSetSize(D2Pre(A)) touches A's variables, SRO.Counter.c, SRO.Bounder.bounder and D2Pre.m2 (EC reads the globals off the code).

                                                      instance GaudisCrypt.SHA3.Pilot.SHA3Security.instECGlobDSetSizeD2Pre [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] [SHA3Security.Params] (A : S.SRO.AdvSecondPreimage) {R : Footprint VariableAssignment} [h : Module.ECGlob A R] :
                                                      Module.ECGlob (DSetSize (S.D2Pre A)) (R ⊔ (S.SRO.Counter.c.footprint ⊔ (S.SRO.Bounder.bounder.footprint ⊔ S.D2Pre.m2.footprint)))

                                                      EC's glob DSetSize(D2Pre(A)): glob A (the region given for A), SRO.Counter.c, SRO.Bounder.bounder and D2Pre.m2.

                                                      theorem GaudisCrypt.SHA3.Pilot.SHA3Security.fvP_DSetSize_DColl [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] [SHA3Security.Params] (A : S.SRO.AdvCollision) :
                                                      FVP.fvP (DSetSize (S.DColl A)) ≤ FVP.fvP A ⊔ (S.SRO.Counter.c.footprint ⊔ S.SRO.Bounder.bounder.footprint)

                                                      DSetSize(DColl(A)) touches A's variables, SRO.Counter.c and SRO.Bounder.bounder (EC reads the globals off the code).

                                                      EC's glob DSetSize(DColl(A)): glob A (the region given for A), SRO.Counter.c and SRO.Bounder.bounder.

                                                      instance GaudisCrypt.SHA3.Pilot.SHA3Security.instECGlobDSetSizeDPre [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] [SHA3Security.Params] (A : S.SRO.AdvPreimage) {R : Footprint VariableAssignment} [h : Module.ECGlob A R] :
                                                      Module.ECGlob (DSetSize (S.DPre A)) (R ⊔ (S.SRO.Counter.c.footprint ⊔ (S.SRO.Bounder.bounder.footprint ⊔ S.DPre.h.footprint)))

                                                      EC's glob DSetSize(DPre(A)): glob A (the region given for A), SRO.Counter.c, SRO.Bounder.bounder and DPre.h.

                                                      CSetSize(Sponge) has no globals (EC reads it off the code), at the clone's module type.

                                                      Perm touches Perm.m, Perm.mi, at the clone's module type (Perm is an Indiff0.PRIMITIVE by definition).

                                                      SimSetSize(Simulator, F).init is Simulator.init: the simulator is the first port's module, which proc does not open behind the clone's accessor (GAP 6).

                                                      CSetSize(Sponge) applied to Perm at the clone's module types (in Indiff0.GReal) is CSetSize(Sponge, Perm) at the sponge's, by definition: init.

                                                      Section Preimage (EC l. 125–475) #

                                                      EC's local equiv equiv_sponge_perm c m : FInit(CSetSize(Sponge, Perm)).get ~ FInit(DFSetSize(FC(Sponge(Perm)))).get : ={arg, glob Perm} /\ invm Perm.m{1} Perm.mi{1} /\ Cntr.c{2} = c /\ arg{2} = m /\ (Cntr.c + ((size arg + 1) %/ Common.r + 1) + max ((size_out + Common.r - 1) %/ Common.r - 1) 0 <= limit){2} ==> ={res, glob Perm} /\ invm Perm.m{1} Perm.mi{1} /\ Cntr.c{2} = c + ((size m + 1) %/ Common.r + 1) + max ((size_out + Common.r - 1) %/ Common.r - 1) 0. (EC's c is c': c is the capacity.)

                                                      EC's Sample_LoopSnoc_eq (theory Program) under rnd to_list (fun x => oget (of_list x)): sampling dout is running LoopSnoc.sample(size_out) and reading the list back. EC's module Sample is not ported (the first port has LoopSnoc and its run, LoopSnoc.sample_denotation): EC's two transitivity steps of equiv_ro_iro through Sample.sample and LoopSnoc.sample are one, with this as its first leg, proved by the first port's rule.

                                                      EC's local equiv equiv_ro_iro c m : FInit(RO).get ~ FInit(DFSetSize(FC(BIRO.IRO))).get : ={arg} /\ m = x{2} /\ Cntr.c{2} = c /\ (Cntr.c + ((size arg + 1) %/ Common.r + 1) + max ((size_out + Common.r - 1) %/ Common.r - 1) 0 <= limit){2} /\ same_ro SRO.RO.RO.m{1} BIRO.IRO.mp{2} ==> ={res} /\ same_ro SRO.RO.RO.m{1} BIRO.IRO.mp{2} /\ Cntr.c{2} = c + ((size m + 1) %/ Common.r + 1) + max ((size_out + Common.r - 1) %/ Common.r - 1) 0. (EC's c is c'.)

                                                      theorem GaudisCrypt.SHA3.Pilot.SHA3Security.Preimage.Sponge_preimage_resistant [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] [SHA3Security.Params] (A : S.SRO.AdvPreimage) [Module.Declared A (⋯ ⊔ Common.Perm.mi.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ SHA3Indiff.Simulator.m.footprint ⊔ SHA3Indiff.Simulator.mi.footprint ⊔ SHA3Indiff.Simulator.paths.footprint ⊔ SHA3Indiff.Cntr.c.footprint ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.C.c.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ S.DPre.h.footprint ⊔ Sponge.HybridIRO.HybridIROLazy.mp.footprint ⊔ Sponge.HybridIRO.HybridIROEager.mp.footprint ⊔ Sponge.HybridIRO.ERO.RO.m.footprint ⊔ Sponge.HybridIRO.ERO.FRO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.RO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob A R] [R.Restricted (⋯ ⊔ Common.Perm.mi.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ SHA3Indiff.Simulator.m.footprint ⊔ SHA3Indiff.Simulator.mi.footprint ⊔ SHA3Indiff.Simulator.paths.footprint ⊔ SHA3Indiff.Cntr.c.footprint ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.C.c.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ S.DPre.h.footprint ⊔ Sponge.HybridIRO.HybridIROLazy.mp.footprint ⊔ Sponge.HybridIRO.HybridIROEager.mp.footprint ⊔ Sponge.HybridIRO.ERO.RO.m.footprint ⊔ Sponge.HybridIRO.ERO.FRO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.RO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (A_ll : ∀ (F : S.SRO.Oracle) [Module.Declared F R], F.get.procedure.IsLossless → (Module.app A F).procedure.IsLossless) (m : VariableAssignment) (ha : SHA3Security.f_out) :
                                                      S.DPre.h.get m = ha → Pr[ S.SRO.Preimage(A, S.FM((CSetSize Sponge.Sponge), Common.Perm)).main (ha) @ &m : §res = true ] ≤ ↑(SHA3Indiff.limit ^ 2 - SHA3Indiff.limit) / ↑(2 ^ (Common.r + Common.c + 1).toNat) + ↑(4 * SHA3Indiff.limit ^ 2) / ↑(2 ^ Common.c.toNat) + ↑(SHA3Security.sigma + 1) / 2 ^ SHA3Security.size_out

                                                      EC's lemma Sponge_preimage_resistant &m ha : (DPre.h{m} = ha) => Pr[SRO.Preimage(A, FM(CSetSize(Sponge), Perm)).main(ha) @ &m : res] <= (limit ^ 2 - limit)%r / (2 ^ (r + c + 1))%r + (4 * limit ^ 2)%r / (2 ^ c)%r + (sigma + 1)%r / (2%r ^ size_out).

                                                      Section SecondPreimage (EC l. 479–865) #

                                                      theorem GaudisCrypt.SHA3.Pilot.SHA3Security.SecondPreimage.Sponge_second_preimage_resistant [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] [SHA3Security.Params] (A : S.SRO.AdvSecondPreimage) [Module.Declared A (⋯ ⊔ SHA3Indiff.Simulator.m.footprint ⊔ SHA3Indiff.Simulator.mi.footprint ⊔ SHA3Indiff.Simulator.paths.footprint ⊔ SHA3Indiff.Cntr.c.footprint ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.C.c.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ S.D2Pre.m2.footprint ⊔ S.SRO.SecondPreimage.SecondPreimage2.m2.footprint ⊔ S.SRO.SecondPreimage.D1.m1.footprint ⊔ Sponge.HybridIRO.HybridIROLazy.mp.footprint ⊔ Sponge.HybridIRO.HybridIROEager.mp.footprint ⊔ Sponge.HybridIRO.ERO.RO.m.footprint ⊔ Sponge.HybridIRO.ERO.FRO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.RO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob A R] [R.Restricted (⋯ ⊔ SHA3Indiff.Simulator.m.footprint ⊔ SHA3Indiff.Simulator.mi.footprint ⊔ SHA3Indiff.Simulator.paths.footprint ⊔ SHA3Indiff.Cntr.c.footprint ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.C.c.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ S.D2Pre.m2.footprint ⊔ S.SRO.SecondPreimage.SecondPreimage2.m2.footprint ⊔ S.SRO.SecondPreimage.D1.m1.footprint ⊔ Sponge.HybridIRO.HybridIROLazy.mp.footprint ⊔ Sponge.HybridIRO.HybridIROEager.mp.footprint ⊔ Sponge.HybridIRO.ERO.RO.m.footprint ⊔ Sponge.HybridIRO.ERO.FRO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.RO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (A_ll : ∀ (F : S.SRO.Oracle) [Module.Declared F R], F.get.procedure.IsLossless → (Module.app A F).procedure.IsLossless) (m : VariableAssignment) (mess : List Bool) :
                                                      S.D2Pre.m2.get m = mess → Pr[ S.SRO.SecondPreimage(A, S.FM((CSetSize Sponge.Sponge), Common.Perm)).main (mess) @ &m : §res = true ] ≤ ↑(SHA3Indiff.limit ^ 2 - SHA3Indiff.limit) / ↑(2 ^ (Common.r + Common.c + 1).toNat) + ↑(4 * SHA3Indiff.limit ^ 2) / ↑(2 ^ Common.c.toNat) + ↑(SHA3Security.sigma + 1) / 2 ^ SHA3Security.size_out

                                                      EC's lemma Sponge_second_preimage_resistant &m mess : (D2Pre.m2{m} = mess) => Pr[SRO.SecondPreimage(A, FM(CSetSize(Sponge), Perm)).main(mess) @ &m : res] <= (limit ^ 2 - limit)%r / (2 ^ (r + c + 1))%r + (4 * limit ^ 2)%r / (2 ^ c)%r + (sigma + 1)%r / (2%r ^ size_out).

                                                      Section Collision (EC l. 869–1239) #

                                                      theorem GaudisCrypt.SHA3.Pilot.SHA3Security.Collision.Sponge_coll_resistant [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] [SHA3Security.Params] (A : S.SRO.AdvCollision) [Module.Declared A (⋯ ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ SHA3Indiff.Simulator.m.footprint ⊔ SHA3Indiff.Simulator.mi.footprint ⊔ SHA3Indiff.Simulator.paths.footprint ⊔ SHA3Indiff.Cntr.c.footprint ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.C.c.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ Sponge.HybridIRO.HybridIROLazy.mp.footprint ⊔ Sponge.HybridIRO.HybridIROEager.mp.footprint ⊔ Sponge.HybridIRO.ERO.RO.m.footprint ⊔ Sponge.HybridIRO.ERO.FRO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.RO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob A R] [R.Restricted (⋯ ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ SHA3Indiff.Simulator.m.footprint ⊔ SHA3Indiff.Simulator.mi.footprint ⊔ SHA3Indiff.Simulator.paths.footprint ⊔ SHA3Indiff.Cntr.c.footprint ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.C.c.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ Sponge.HybridIRO.HybridIROLazy.mp.footprint ⊔ Sponge.HybridIRO.HybridIROEager.mp.footprint ⊔ Sponge.HybridIRO.ERO.RO.m.footprint ⊔ Sponge.HybridIRO.ERO.FRO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.RO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (A_ll : ∀ (F : S.SRO.Oracle) [Module.Declared F R], F.get.procedure.IsLossless → (Module.app A F).procedure.IsLossless) (m : VariableAssignment) :
                                                      Pr[ S.SRO.Collision(A, S.FM((CSetSize Sponge.Sponge), Common.Perm)).main () @ &m : §res = true ] ≤ ↑(SHA3Indiff.limit ^ 2 - SHA3Indiff.limit) / ↑(2 ^ (Common.r + Common.c + 1).toNat) + ↑(4 * SHA3Indiff.limit ^ 2) / ↑(2 ^ Common.c.toNat) + ↑(SHA3Security.sigma * (SHA3Security.sigma - 1) + 2) / 2 / 2 ^ SHA3Security.size_out

                                                      EC's lemma Sponge_coll_resistant &m : Pr[SRO.Collision(A, FM(CSetSize(Sponge), Perm)).main() @ &m : res] <= (limit ^ 2 - limit)%r / (2 ^ (r + c + 1))%r + (4 * limit ^ 2)%r / (2 ^ c)%r + (sigma * (sigma - 1) + 2)%r / 2%r / (2%r ^ size_out).

                                                      The modules X, AdvCollisionSHA3, and section SHA3_Collision (EC l. 1241–1274) #

                                                      The body of proc get of module X, 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 X.get.procedure.apply_simp) rather than run. Use X.get 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 X, 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 X.get, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma X.apply_simp says.

                                                        Equations
                                                        Instances For

                                                          proc get of module X 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 X.get.apply_simp, which fills the holes of X.get.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 X.get.procedure with a tuple holeArgs of procedures: the body of proc get 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 [X.get.procedure.apply_simp]).

                                                            @[simp]

                                                            @[simp]: applying X.get to the parameters proc get uses (F) is Module.proc (X.get.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]

                                                            @[simp]: applying X to a tuple of its single parameter F — the record of its procedures X.get, 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 X.get.apply_simp to fill that procedure's holes.

                                                            The module declared by module AdvCollisionSHA3, abstracted over its single parameter F, 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 AdvCollisionSHA3.guess, each applied to the parameters that procedure itself uses — which is what the @[simp] lemma AdvCollisionSHA3.apply_simp says.

                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For

                                                              Instantiating the holes of AdvCollisionSHA3.guess.procedure with a tuple holeArgs of procedures: the body of proc guess 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 [AdvCollisionSHA3.guess.procedure.apply_simp]).

                                                              proc guess of module AdvCollisionSHA3 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 AdvCollisionSHA3.guess.apply_simp, which fills the holes of AdvCollisionSHA3.guess.procedure with the callees the body called.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                @[simp]

                                                                @[simp]: applying AdvCollisionSHA3 to a tuple of its single parameter F — the record of its procedures AdvCollisionSHA3.guess, 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 AdvCollisionSHA3.guess.apply_simp to fill that procedure's holes.

                                                                The body of proc guess of module AdvCollisionSHA3, 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 AdvCollisionSHA3.guess.procedure.apply_simp) rather than run. Use AdvCollisionSHA3.guess for this procedure as a module.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  @[simp]

                                                                  @[simp]: applying AdvCollisionSHA3.guess to the parameters proc guess uses (F) is Module.proc (AdvCollisionSHA3.guess.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.

                                                                  AdvCollisionSHA3(A) touches A's variables only (EC reads the globals off the code).

                                                                  theorem GaudisCrypt.SHA3.Pilot.SHA3Security.SHA3_Collision.SHA3_coll_resistant [SLCommon.Params] [BlockSponge.Params] [Gconcl_list.Params] [SHA3Security.Params] (A : S.SRO.AdvCollision) [Module.Declared A (⋯ ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ SHA3Indiff.Simulator.m.footprint ⊔ SHA3Indiff.Simulator.mi.footprint ⊔ SHA3Indiff.Simulator.paths.footprint ⊔ SHA3Indiff.Cntr.c.footprint ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.C.c.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ Sponge.HybridIRO.HybridIROLazy.mp.footprint ⊔ Sponge.HybridIRO.HybridIROEager.mp.footprint ⊔ Sponge.HybridIRO.ERO.RO.m.footprint ⊔ Sponge.HybridIRO.ERO.FRO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.RO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] {R : Footprint VariableAssignment} [Module.ECGlob A R] [R.Restricted (⋯ ⊔ Common.Perm.m.footprint ⊔ Common.Perm.mi.footprint ⊔ Gconcl_list.BIRO2.IRO.mp.footprint ⊔ SHA3Indiff.Simulator.m.footprint ⊔ SHA3Indiff.Simulator.mi.footprint ⊔ SHA3Indiff.Simulator.paths.footprint ⊔ SHA3Indiff.Cntr.c.footprint ⊔ Sponge.BIRO.IRO.mp.footprint ⊔ SLCommon.F.RO.m.footprint ⊔ SLCommon.F.FRO.m.footprint ⊔ SLCommon.Redo.prefixes.footprint ⊔ SLCommon.C.c.footprint ⊔ SLCommon.C.queries.footprint ⊔ Gconcl.S.m.footprint ⊔ Gconcl.S.mi.footprint ⊔ Gconcl.S.paths.footprint ⊔ BlockSponge.BIRO.IRO.mp.footprint ⊔ BlockSponge.C.c.footprint ⊔ Gconcl_list.F2.RO.m.footprint ⊔ Gconcl_list.F2.FRO.m.footprint ⊔ Gconcl_list.Simulator.m.footprint ⊔ Gconcl_list.Simulator.mi.footprint ⊔ Gconcl_list.Simulator.paths.footprint ⊔ Gconcl_list.Simulator.unvalid_map.footprint ⊔ Sponge.HybridIRO.HybridIROLazy.mp.footprint ⊔ Sponge.HybridIRO.HybridIROEager.mp.footprint ⊔ Sponge.HybridIRO.ERO.RO.m.footprint ⊔ Sponge.HybridIRO.ERO.FRO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.RO.m.footprint ⊔ Gconcl_list.Simplify_Simulator.IRO2.FRO.m.footprint ⊔ Handle.G1.m.footprint ⊔ Handle.G1.mi.footprint ⊔ Handle.G1.mh.footprint ⊔ Handle.G1.mhi.footprint ⊔ Handle.G1.bext.footprint ⊔ Handle.G1.bcol.footprint ⊔ Handle.ROhandle.FRO.m.footprint ⊔ Handle.G1.paths.footprint ⊔ Handle.G1.chandle.footprint ⊔ ConcreteF.PF.m.footprint ⊔ ConcreteF.PF.mi.footprint ⊔ Handle.ROhandle.RO.m.footprint ⊔ Gext.ReSample.count.footprint ⊔ Gcol.Gcol.count.footprint ⊔ ConcreteF.Switching.DBounder.FBounder.c.footprint ⊔ ConcreteF.Switching.ARP.coll.footprint ⊔ ConcreteF.Switching.ARP.m.footprint ⊔ ConcreteF.Switching.ARP.mi.footprint ⊔ ConcreteF.Switching.PRPi.m.footprint ⊔ ConcreteF.Switching.PRPi.mi.footprint)] (A_ll : ∀ (F : S.SRO.Oracle) [Module.Declared F R], F.get.procedure.IsLossless → (Module.app A F).procedure.IsLossless) (m : VariableAssignment) :

                                                                  EC's lemma SHA3_coll_resistant &m : Pr[SRO.Collision(AdvCollisionSHA3(A), FM(CSetSize(Sponge), Perm)).main() @ &m : res] <= (limit ^ 2 - limit)%r / (2 ^ (r + c + 1))%r + (4 * limit ^ 2)%r / (2 ^ c)%r + (sigma * (sigma - 1) + 2)%r / 2%r / (2%r ^ size_out).