Documentation

GaudisCrypt.Examples.SHA3.SecureHash

Security games for hash functions with failing oracles (EasyCrypt proof/SecureHash.eca) — #

EC-fidelity port

Preimage, second-preimage and collision games for a construction F : OCONSTRUCTION over a primitive P : OPRIMITIVE, against an adversary whose oracle calls are bounded by bound (FBounder, PBounder). The file has no lemmas: SHA3OSecurity clones it.

Translation (as the pilot SecureRO's):

EC's type from, to, block., op sampleto, op bound, op increase_counter and their axioms. The types are outParams: a clone of the theory is an instance.

Instances
    Equations
    Instances For
      instance GaudisCrypt.SHA3.Pilot.SecureHash.instIsGlobalVarIntBounderMk :
      Bounder.bounder.IsGlobalVar (VariableName.mk "GaudisCrypt.SHA3.Pilot.SecureHash.Bounder.bounder" ℤ)

      proc init of module Bounder as a module: Module.proc Bounder.init.procedure, of type Module.Proc (procsig …). It uses no module parameter, so it is not a function — Bounder.init.apply_simp says exactly that.

      Equations
      Instances For

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

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

        Equations
        Instances For
          @[simp]

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

          The module declared by module Bounder: the record of its procedures Bounder.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 Bounder.apply_simp to apply it with.

          Equations
          Instances For
            theorem GaudisCrypt.SHA3.Pilot.SecureHash.FBounder.f.procedure.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (holeArgs✝ : (HoleSigs.cons (procsig («from») → Option «to») HoleSigs.empty).Instantiation) :
            procedure.instantiate holeArgs✝ = proc (x : «from») : (Option «to») { var y : Option «to»; y <- none; if (decide (increase_counter §Bounder.bounder §x ≤ bound)) { Bounder.bounder <- increase_counter §Bounder.bounder §x; y <- call (holeArgs✝.lookup HoleIndex.zero) (§x); } return §y }

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

            theorem GaudisCrypt.SHA3.Pilot.SecureHash.FBounder.init.procedure.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) HoleSigs.empty).Instantiation) :
            procedure.instantiate holeArgs✝ = proc () : Unit { call Bounder.init.procedure (); call (holeArgs✝.lookup HoleIndex.zero) (); return () }

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

            @[simp]
            theorem GaudisCrypt.SHA3.Pilot.SecureHash.FBounder.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (F : OIndif.OFUNCTIONALITY) :

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

            noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.FBounder {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
            Module.Arr OIndif.OFUNCTIONALITY OIndif.OFUNCTIONALITY

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

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.FBounder.f.procedure {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :

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

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.FBounder.f {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                Module.Arr OIndif.OFUNCTIONALITY (procmod («from») → Option «to»)

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

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[simp]
                  theorem GaudisCrypt.SHA3.Pilot.SecureHash.FBounder.init.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (F : OIndif.OFUNCTIONALITY) :

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

                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.FBounder.init {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                  Module.Arr OIndif.OFUNCTIONALITY (procmod () → Unit)

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

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.FBounder.init.procedure {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :

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

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[simp]
                      theorem GaudisCrypt.SHA3.Pilot.SecureHash.FBounder.f.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (F : OIndif.OFUNCTIONALITY) :

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

                      theorem GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.init.procedure.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) HoleSigs.empty).Instantiation) :
                      procedure.instantiate holeArgs✝ = proc () : Unit { call (holeArgs✝.lookup HoleIndex.zero) (); call Bounder.init.procedure (); return () }

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

                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.f {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                      Module.Arr OIndif.OPRIMITIVE (procmod (block) → Option block)

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

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.fi.procedure.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (holeArgs✝ : (HoleSigs.cons (procsig (block) → Option block) HoleSigs.empty).Instantiation) :
                        procedure.instantiate holeArgs✝ = proc (x : block) : (Option block) { var y : Option block; y <- none; if (decide (§Bounder.bounder < bound)) { y <- call (holeArgs✝.lookup HoleIndex.zero) (§x); Bounder.bounder <- §Bounder.bounder + 1; } return §y }

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

                        @[simp]
                        theorem GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.fi.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (P : OIndif.OPRIMITIVE) :

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

                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.PBounder {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                        Module.Arr OIndif.OPRIMITIVE OIndif.OPRIMITIVE

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

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.f.procedure {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :

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

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.init {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                            Module.Arr OIndif.OPRIMITIVE (procmod () → Unit)

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

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              theorem GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.f.procedure.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (holeArgs✝ : (HoleSigs.cons (procsig (block) → Option block) HoleSigs.empty).Instantiation) :
                              procedure.instantiate holeArgs✝ = proc (x : block) : (Option block) { var y : Option block; y <- none; if (decide (§Bounder.bounder < bound)) { y <- call (holeArgs✝.lookup HoleIndex.zero) (§x); Bounder.bounder <- §Bounder.bounder + 1; } return §y }

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

                              @[simp]
                              theorem GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.init.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (P : OIndif.OPRIMITIVE) :

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

                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.fi {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                              Module.Arr OIndif.OPRIMITIVE (procmod (block) → Option block)

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

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.fi.procedure {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :

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

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[simp]
                                  theorem GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.f.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (P : OIndif.OPRIMITIVE) :

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

                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.init.procedure {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :

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

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[simp]
                                    theorem GaudisCrypt.SHA3.Pilot.SecureHash.PBounder.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (P : OIndif.OPRIMITIVE) :

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

                                    @[reducible, inline]
                                    abbrev GaudisCrypt.SHA3.Pilot.SecureHash.AdvPreimage {«from» «to» block : Type} [Inhabited «from»] [Inhabited «to»] [Inhabited block] [Params «from» «to» block] :

                                    EC's module type AdvPreimage (F : ODFUNCTIONALITY) (P : ODPRIMITIVE) = { proc guess(h : to) : from }.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.Preimage.main {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                                      Module.Arr AdvPreimage (Module.Arr OIndif.OCONSTRUCTION (Module.Arr OIndif.OPRIMITIVE (procmod () → Bool)))

                                      proc main of module Preimage as a module, abstracted over the module parameters it uses (A, F, P, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                      Apply it with the @[simp] lemma Preimage.main.apply_simp, which fills the holes of Preimage.main.procedure with the callees the body called.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.Preimage.main.procedure {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                                        proctype () → Bool uses (() → Unit, () → Unit, («to») → «from», («from») → Option «to»)

                                        The body of proc main of module Preimage, as a procedure of its own: the 4 calls it makes to module parameters (A, F, P) are its holes, in the order the body makes them.

                                        A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Preimage.main.procedure.apply_simp) rather than run. Use Preimage.main for this procedure as a module.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          @[simp]
                                          theorem GaudisCrypt.SHA3.Pilot.SecureHash.Preimage.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (A : AdvPreimage) (F : OIndif.OCONSTRUCTION) (P : OIndif.OPRIMITIVE) :
                                          Preimage(A, F, P).main = Module.app (Module.app (Module.app main A) F) P

                                          @[simp]: applying Preimage to a tuple of its 3 parameters A, F, P — the record of its procedures Preimage.main, each applied to the parameters it uses.

                                          This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with Preimage.main.apply_simp to fill that procedure's holes.

                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.Preimage {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                                          Module.Arr (Module.Prod AdvPreimage (Module.Prod OIndif.OCONSTRUCTION OIndif.OPRIMITIVE)) (procmod () → Bool)

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

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            @[simp]
                                            theorem GaudisCrypt.SHA3.Pilot.SecureHash.Preimage.main.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (A : AdvPreimage) (F : OIndif.OCONSTRUCTION) (P : OIndif.OPRIMITIVE) :

                                            @[simp]: applying Preimage.main to the parameters proc main uses (A, F, P) is Module.proc (Preimage.main.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

                                            theorem GaudisCrypt.SHA3.Pilot.SecureHash.Preimage.main.procedure.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig («to») → «from») (HoleSigs.cons (procsig («from») → Option «to») HoleSigs.empty)))).Instantiation) :
                                            procedure.instantiate holeArgs✝ = proc () : Bool { var hash : «to», m : «from», hash' : Option «to»; hash <$ sampleto; call (holeArgs✝.lookup HoleIndex.zero) (); call (holeArgs✝.lookup HoleIndex.zero.succ) (); m <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§hash); hash' <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (§m); return decide (§hash' = some §hash) }

                                            Instantiating the holes of Preimage.main.procedure with a tuple holeArgs of procedures: the body of proc main as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                            Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [Preimage.main.procedure.apply_simp]).

                                            Second preimage #

                                            @[reducible, inline]
                                            abbrev GaudisCrypt.SHA3.Pilot.SecureHash.AdvSecondPreimage {«from» «to» block : Type} [Inhabited «from»] [Inhabited «to»] [Inhabited block] [Params «from» «to» block] :

                                            EC's module type AdvSecondPreimage (F : ODFUNCTIONALITY) (P : ODPRIMITIVE) = { proc guess(m : from) : from }.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.SecondPreimage.main {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                                              Module.Arr AdvSecondPreimage (Module.Arr OIndif.OCONSTRUCTION (Module.Arr OIndif.OPRIMITIVE (procmod («from») → Bool)))

                                              proc main of module SecondPreimage as a module, abstracted over the module parameters it uses (A, F, P, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                              Apply it with the @[simp] lemma SecondPreimage.main.apply_simp, which fills the holes of SecondPreimage.main.procedure with the callees the body called.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                @[simp]
                                                theorem GaudisCrypt.SHA3.Pilot.SecureHash.SecondPreimage.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (A : AdvSecondPreimage) (F : OIndif.OCONSTRUCTION) (P : OIndif.OPRIMITIVE) :

                                                @[simp]: applying SecondPreimage to a tuple of its 3 parameters A, F, P — the record of its procedures SecondPreimage.main, each applied to the parameters it uses.

                                                This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with SecondPreimage.main.apply_simp to fill that procedure's holes.

                                                theorem GaudisCrypt.SHA3.Pilot.SecureHash.SecondPreimage.main.procedure.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig («from») → «from») (HoleSigs.cons (procsig («from») → Option «to») HoleSigs.empty)))).Instantiation) :
                                                procedure.instantiate holeArgs✝ = proc (m1 : «from») : Bool { var m2 : «from», hash1 : Option «to», hash2 : Option «to»; call (holeArgs✝.lookup HoleIndex.zero) (); call (holeArgs✝.lookup HoleIndex.zero.succ) (); m2 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§m1); hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (§m1); hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (§m2); return decide (§m1 ≠ §m2 ∧ ∃ (y : «to»), some y = §hash1 ∧ some y = §hash2) }

                                                Instantiating the holes of SecondPreimage.main.procedure with a tuple holeArgs of procedures: the body of proc main as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [SecondPreimage.main.procedure.apply_simp]).

                                                noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.SecondPreimage {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                                                Module.Arr (Module.Prod AdvSecondPreimage (Module.Prod OIndif.OCONSTRUCTION OIndif.OPRIMITIVE)) (procmod («from») → Bool)

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

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.SecondPreimage.main.procedure {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                                                  proctype («from») → Bool uses (() → Unit, () → Unit, («from») → «from», («from») → Option «to»)

                                                  The body of proc main of module SecondPreimage, as a procedure of its own: the 4 calls it makes to module parameters (A, F, P) are its holes, in the order the body makes them.

                                                  A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see SecondPreimage.main.procedure.apply_simp) rather than run. Use SecondPreimage.main for this procedure as a module.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    @[simp]
                                                    theorem GaudisCrypt.SHA3.Pilot.SecureHash.SecondPreimage.main.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (A : AdvSecondPreimage) (F : OIndif.OCONSTRUCTION) (P : OIndif.OPRIMITIVE) :

                                                    @[simp]: applying SecondPreimage.main to the parameters proc main uses (A, F, P) is Module.proc (SecondPreimage.main.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

                                                    Collision #

                                                    @[reducible, inline]
                                                    abbrev GaudisCrypt.SHA3.Pilot.SecureHash.AdvCollision {«from» «to» block : Type} [Inhabited «from»] [Inhabited «to»] [Inhabited block] [Params «from» «to» block] :

                                                    EC's module type AdvCollision (F : ODFUNCTIONALITY) (P : ODPRIMITIVE) = { proc guess() : from * from }.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.Collision {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                                                      Module.Arr (Module.Prod AdvCollision (Module.Prod OIndif.OCONSTRUCTION OIndif.OPRIMITIVE)) (procmod () → Bool)

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

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.Collision.main.procedure {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                                                        proctype () → Bool uses (() → Unit, () → Unit, () → «from» × «from», («from») → Option «to»)

                                                        The body of proc main of module Collision, as a procedure of its own: the 4 calls it makes to module parameters (A, F, P) are its holes, in the order the body makes them.

                                                        A hole stands for a call whose callee is not known here — a module parameter is supplied only when the module is applied — so the body is a ProcedureWithHoles, to be instantiated (see Collision.main.procedure.apply_simp) rather than run. Use Collision.main for this procedure as a module.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          @[simp]
                                                          theorem GaudisCrypt.SHA3.Pilot.SecureHash.Collision.main.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (A : AdvCollision) (F : OIndif.OCONSTRUCTION) (P : OIndif.OPRIMITIVE) :

                                                          @[simp]: applying Collision.main to the parameters proc main uses (A, F, P) is Module.proc (Collision.main.procedure.instantiate …) — the procedure with its holes filled by the callees they were made from, each written as it was in the body (with the arguments in place of the module parameters) and turned into a Procedure by Module.Proc.procedure.

                                                          @[simp]
                                                          theorem GaudisCrypt.SHA3.Pilot.SecureHash.Collision.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (A : AdvCollision) (F : OIndif.OCONSTRUCTION) (P : OIndif.OPRIMITIVE) :

                                                          @[simp]: applying Collision to a tuple of its 3 parameters A, F, P — the record of its procedures Collision.main, each applied to the parameters it uses.

                                                          This is the lemma that unfolds a module use: simp rewrites with it, then with the field lemmas of the module type (N.f.mk_simp) to get at the one procedure the goal is about, and then with Collision.main.apply_simp to fill that procedure's holes.

                                                          theorem GaudisCrypt.SHA3.Pilot.SecureHash.Collision.main.procedure.apply_simp {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] (holeArgs✝ : (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig () → Unit) (HoleSigs.cons (procsig () → «from» × «from») (HoleSigs.cons (procsig («from») → Option «to») HoleSigs.empty)))).Instantiation) :
                                                          procedure.instantiate holeArgs✝ = proc () : Bool { var m1 : «from», m2 : «from», hash1 : Option «to», hash2 : Option «to»; call (holeArgs✝.lookup HoleIndex.zero) (); call (holeArgs✝.lookup HoleIndex.zero.succ) (); m1, m2 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (); hash1 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (§m1); hash2 <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (§m2); return decide (§m1 ≠ §m2 ∧ ∃ (y : «to»), some y = §hash1 ∧ some y = §hash2) }

                                                          Instantiating the holes of Collision.main.procedure with a tuple holeArgs of procedures: the body of proc main as written, with each hole call replaced by the matching holeArgs.lookup (HoleIndex.zero being the first hole the body declared). True by rfl.

                                                          Deliberately not @[simp], unlike the other apply_simp lemmas: its right-hand side is the whole body written out, so letting it fire on its own would turn any goal mentioning an instantiated procedure into that body. Inlining a procedure is a step to ask for by name (simp [Collision.main.procedure.apply_simp]).

                                                          noncomputable def GaudisCrypt.SHA3.Pilot.SecureHash.Collision.main {«from» «to» block : Type} [_gaudiParam0 : Inhabited «from»] [_gaudiParam1 : Inhabited «to»] [_gaudiParam2 : Inhabited block] [_gaudiParam3 : Params «from» «to» block] :
                                                          Module.Arr AdvCollision (Module.Arr OIndif.OCONSTRUCTION (Module.Arr OIndif.OPRIMITIVE (procmod () → Bool)))

                                                          proc main of module Collision as a module, abstracted over the module parameters it uses (A, F, P, in declaration order): Module.Arr … (Module.Proc (procsig …)).

                                                          Apply it with the @[simp] lemma Collision.main.apply_simp, which fills the holes of Collision.main.procedure with the callees the body called.

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