Documentation

GaudisCrypt.Lib.EC.PKE.PKE_CPA

IND-CPA security of a public-key encryption scheme #

(EasyCrypt theories/crypto/pke/PKE_CPA.eca)

The theory's types pkey, skey, ptxt, ctxt are outParams of the (field-less) class Params: a clone is clone import GaudisCrypt.EC.PKE_CPA as PKE with type pkey <- ….

class GaudisCrypt.EC.PKE_CPA.Params (pkey skey ptxt ctxt : outParam Type) :

EC's type pkey, skey, ptxt, ctxt.

    Instances
      noncomputable def GaudisCrypt.EC.PKE_CPA.Scheme.enc {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

      The field enc of a module of type Scheme: the projection onto component 1 of the right-nested tuple Scheme.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

      Scheme.enc.mk_simp reads this field back off a module built by Scheme.mk; Scheme.enc.utilities has the accessor as a module, and the lemmas about it.

      Its parameters are named pk, m, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).

      Equations
      Instances For
        @[simp]
        theorem GaudisCrypt.EC.PKE_CPA.Scheme.mk_destruct {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (theRecord✝ : Structure) :
        (mk theRecord✝).structure = theRecord✝

        @[simp]: Scheme.structure (Scheme.mk r) = r — destructing a module built from a record gives that record back.

        def GaudisCrypt.EC.PKE_CPA.Scheme.typeRep {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

        The ModuleTypeRep underlying Scheme, the module type declared by moduletype Scheme: the right-nested product of its 2 field types, in declaration order.

        Scheme is by definition Module Scheme.typeRep.

        Equations
        Instances For
          @[reducible]
          noncomputable def GaudisCrypt.EC.PKE_CPA.Scheme.mk {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

          Builds a module of type Scheme from the record Scheme.Structure of its fields, as a right-nested Module.pair'. @[reducible].

          Inverse of Scheme.structure (Scheme.mk_destruct, Scheme.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas Scheme.kg.mk_simp, Scheme.enc.mk_simp.

          Equations
          Instances For
            @[simp]
            theorem GaudisCrypt.EC.PKE_CPA.Scheme.enc.mk_simp {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (theRecord✝ : Structure) :
            (mk theRecord✝).enc = theRecord✝.enc

            @[simp]: reading the field enc back off a module built from a record — Scheme.enc (Scheme.mk r) = r.enc.

            It is what carries the right-hand side of an X.apply_simp (which is an Scheme.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.enc.apply_simp.

            def GaudisCrypt.EC.PKE_CPA.Scheme {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

            The module type declared by moduletype Scheme, with fields kg, enc: the type Module Scheme.typeRep of modules that are a right-nested tuple of the field types.

            Build one from a record of its fields with Scheme.mk, read a single field off one with the accessors Scheme.kg, Scheme.enc, and get the whole record back with Scheme.structure.

            Equations
            Instances For
              @[simp]
              theorem GaudisCrypt.EC.PKE_CPA.Scheme.kg.mk_simp {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (theRecord✝ : Structure) :
              (mk theRecord✝).kg = theRecord✝.kg

              @[simp]: reading the field kg back off a module built from a record — Scheme.kg (Scheme.mk r) = r.kg.

              It is what carries the right-hand side of an X.apply_simp (which is an Scheme.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.kg.apply_simp.

              noncomputable def GaudisCrypt.EC.PKE_CPA.Scheme.kg.utilities {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

              What is derivable about the accessor Scheme.kg, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

              • Scheme.kg.utilities.accessorModule : Scheme →ₘ … — the accessor as a module, a projection being a module morphism;
              • Scheme.kg.utilities.apply_simp — Module.app Scheme.kg.utilities.accessorModule m = Scheme.kg m: applying that module is the accessor;
              • Scheme.kg.utilities.expression_eq — the same at the level of expressions: (Scheme.kg m).expression = (Scheme.kg.utilities.proj m.expression).reduce.
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def GaudisCrypt.EC.PKE_CPA.Scheme.structure {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                The record of a module's fields: Scheme.structure m is Scheme.Structure.mk applied to Scheme.kg, Scheme.enc of m.

                Inverse of Scheme.mk (Scheme.mk_destruct, Scheme.destruct_mk).

                Equations
                Instances For
                  noncomputable def GaudisCrypt.EC.PKE_CPA.Scheme.kg {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :
                  Scheme → procmod () → (pkey × skey)

                  The field kg of a module of type Scheme: the projection onto component 0 of the right-nested tuple Scheme.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

                  Scheme.kg.mk_simp reads this field back off a module built by Scheme.mk; Scheme.kg.utilities has the accessor as a module, and the lemmas about it.

                  It takes no parameters (recorded in @[gaudiProcParamNames]).

                  Equations
                  Instances For
                    @[implicit_reducible]
                    instance GaudisCrypt.EC.PKE_CPA.instIsModuleScheme {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                    The IsModule Scheme instance: Scheme is a module type, with representation Scheme.typeRep.

                    It is what lets the name Scheme stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module Scheme.typeRep would do on its own but Scheme, a plain (non-reducible) def, would not.

                    Equations
                    structure GaudisCrypt.EC.PKE_CPA.Scheme.Structure {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                    The record of the fields of a module of type Scheme: the fields kg, enc, one per moduletype field, each of that field's own module type.

                    Scheme.mk turns such a record into a Scheme, Scheme.structure turns a Scheme back into one.

                    Instances For
                      noncomputable def GaudisCrypt.EC.PKE_CPA.Scheme.enc.utilities {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                      What is derivable about the accessor Scheme.enc, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

                      • Scheme.enc.utilities.accessorModule : Scheme →ₘ … — the accessor as a module, a projection being a module morphism;
                      • Scheme.enc.utilities.apply_simp — Module.app Scheme.enc.utilities.accessorModule m = Scheme.enc m: applying that module is the accessor;
                      • Scheme.enc.utilities.expression_eq — the same at the level of expressions: (Scheme.enc m).expression = (Scheme.enc.utilities.proj m.expression).reduce.
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        @[simp]
                        theorem GaudisCrypt.EC.PKE_CPA.Scheme.destruct_mk {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (theModule✝ : Scheme) :
                        mk theModule✝.structure = theModule✝

                        @[simp]: Scheme.mk (Scheme.structure m) = m — rebuilding a module from its own fields gives that module back.

                        noncomputable def GaudisCrypt.EC.PKE_CPA.Adversary.structure {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                        The record of a module's fields: Adversary.structure m is Adversary.Structure.mk applied to Adversary.choose, Adversary.guess of m.

                        Inverse of Adversary.mk (Adversary.mk_destruct, Adversary.destruct_mk).

                        Equations
                        Instances For
                          @[simp]
                          theorem GaudisCrypt.EC.PKE_CPA.Adversary.guess.mk_simp {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (theRecord✝ : Structure) :
                          (mk theRecord✝).guess = theRecord✝.guess

                          @[simp]: reading the field guess back off a module built from a record — Adversary.guess (Adversary.mk r) = r.guess.

                          It is what carries the right-hand side of an X.apply_simp (which is an Adversary.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.guess.apply_simp.

                          @[simp]
                          theorem GaudisCrypt.EC.PKE_CPA.Adversary.choose.mk_simp {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (theRecord✝ : Structure) :
                          (mk theRecord✝).choose = theRecord✝.choose

                          @[simp]: reading the field choose back off a module built from a record — Adversary.choose (Adversary.mk r) = r.choose.

                          It is what carries the right-hand side of an X.apply_simp (which is an Adversary.mk) on to the field the caller actually asked for, so that simp chains X.apply_simp into X.choose.apply_simp.

                          structure GaudisCrypt.EC.PKE_CPA.Adversary.Structure {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                          The record of the fields of a module of type Adversary: the fields choose, guess, one per moduletype field, each of that field's own module type.

                          Adversary.mk turns such a record into a Adversary, Adversary.structure turns a Adversary back into one.

                          Instances For
                            noncomputable def GaudisCrypt.EC.PKE_CPA.Adversary.guess.utilities {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                            What is derivable about the accessor Adversary.guess, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

                            • Adversary.guess.utilities.accessorModule : Adversary →ₘ … — the accessor as a module, a projection being a module morphism;
                            • Adversary.guess.utilities.apply_simp — Module.app Adversary.guess.utilities.accessorModule m = Adversary.guess m: applying that module is the accessor;
                            • Adversary.guess.utilities.expression_eq — the same at the level of expressions: (Adversary.guess m).expression = (Adversary.guess.utilities.proj m.expression).reduce.
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              noncomputable def GaudisCrypt.EC.PKE_CPA.Adversary.guess {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                              The field guess of a module of type Adversary: the projection onto component 1 of the right-nested tuple Adversary.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

                              Adversary.guess.mk_simp reads this field back off a module built by Adversary.mk; Adversary.guess.utilities has the accessor as a module, and the lemmas about it.

                              Its parameters are named c, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).

                              Equations
                              Instances For
                                def GaudisCrypt.EC.PKE_CPA.Adversary.typeRep {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                                The ModuleTypeRep underlying Adversary, the module type declared by moduletype Adversary: the right-nested product of its 2 field types, in declaration order.

                                Adversary is by definition Module Adversary.typeRep.

                                Equations
                                Instances For
                                  def GaudisCrypt.EC.PKE_CPA.Adversary {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                                  The module type declared by moduletype Adversary, with fields choose, guess: the type Module Adversary.typeRep of modules that are a right-nested tuple of the field types.

                                  Build one from a record of its fields with Adversary.mk, read a single field off one with the accessors Adversary.choose, Adversary.guess, and get the whole record back with Adversary.structure.

                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem GaudisCrypt.EC.PKE_CPA.Adversary.destruct_mk {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (theModule✝ : Adversary) :
                                    mk theModule✝.structure = theModule✝

                                    @[simp]: Adversary.mk (Adversary.structure m) = m — rebuilding a module from its own fields gives that module back.

                                    noncomputable def GaudisCrypt.EC.PKE_CPA.Adversary.choose {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :
                                    Adversary → procmod (pkey) → (ptxt × ptxt)

                                    The field choose of a module of type Adversary: the projection onto component 0 of the right-nested tuple Adversary.typeRep, as a chain of Module.fst'/Module.snd'. Tagged @[module_accessor].

                                    Adversary.choose.mk_simp reads this field back off a module built by Adversary.mk; Adversary.choose.utilities has the accessor as a module, and the lemmas about it.

                                    Its parameters are named pk, in that order (recorded in @[gaudiProcParamNames], a ProcedureSignature holding only their types).

                                    Equations
                                    Instances For
                                      @[implicit_reducible]
                                      instance GaudisCrypt.EC.PKE_CPA.instIsModuleAdversary {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                                      The IsModule Adversary instance: Adversary is a module type, with representation Adversary.typeRep.

                                      It is what lets the name Adversary stand where a module type is expected — in Module.Arr/Module.Prod (→ₘ/×ₘ), say — which the underlying Module Adversary.typeRep would do on its own but Adversary, a plain (non-reducible) def, would not.

                                      Equations
                                      noncomputable def GaudisCrypt.EC.PKE_CPA.Adversary.choose.utilities {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                                      What is derivable about the accessor Adversary.choose, bundled into one ModuleTypeUtilities (one name per field in the namespace, rather than one per fact):

                                      • Adversary.choose.utilities.accessorModule : Adversary →ₘ … — the accessor as a module, a projection being a module morphism;
                                      • Adversary.choose.utilities.apply_simp — Module.app Adversary.choose.utilities.accessorModule m = Adversary.choose m: applying that module is the accessor;
                                      • Adversary.choose.utilities.expression_eq — the same at the level of expressions: (Adversary.choose m).expression = (Adversary.choose.utilities.proj m.expression).reduce.
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        @[reducible]
                                        noncomputable def GaudisCrypt.EC.PKE_CPA.Adversary.mk {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

                                        Builds a module of type Adversary from the record Adversary.Structure of its fields, as a right-nested Module.pair'. @[reducible].

                                        Inverse of Adversary.structure (Adversary.mk_destruct, Adversary.destruct_mk); a single field of a module built this way is read back by the @[simp] lemmas Adversary.choose.mk_simp, Adversary.guess.mk_simp.

                                        Equations
                                        Instances For
                                          @[simp]
                                          theorem GaudisCrypt.EC.PKE_CPA.Adversary.mk_destruct {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (theRecord✝ : Structure) :
                                          (mk theRecord✝).structure = theRecord✝

                                          @[simp]: Adversary.structure (Adversary.mk r) = r — destructing a module built from a record gives that record back.

                                          noncomputable def GaudisCrypt.EC.PKE_CPA.CPA.main {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

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

                                          Apply it with the @[simp] lemma CPA.main.apply_simp, which fills the holes of CPA.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.EC.PKE_CPA.CPA.apply_simp {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (S : Scheme) (A : Adversary) :
                                            CPA(S, A).main = Module.app (Module.app main S) A

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

                                            @[simp]
                                            theorem GaudisCrypt.EC.PKE_CPA.CPA.main.apply_simp {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (S : Scheme) (A : Adversary) :

                                            @[simp]: applying CPA.main to the parameters proc main uses (S, A) is Module.proc (CPA.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.

                                            noncomputable def GaudisCrypt.EC.PKE_CPA.CPA {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :

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

                                            Equations
                                            Instances For
                                              noncomputable def GaudisCrypt.EC.PKE_CPA.CPA.main.procedure {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] :
                                              proctype () → Bool uses (() → pkey × skey, (pkey) → ptxt × ptxt, (pkey, ptxt) → ctxt, (ctxt) → Bool)

                                              The body of proc main of module CPA, as a procedure of its own: the 4 calls it makes to module parameters (S, A) 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 CPA.main.procedure.apply_simp) rather than run. Use CPA.main for this procedure as a module.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem GaudisCrypt.EC.PKE_CPA.CPA.main.procedure.apply_simp {pkey skey ptxt ctxt : Type} [_gaudiParam0 : Inhabited pkey] [_gaudiParam1 : Inhabited skey] [_gaudiParam2 : Inhabited ptxt] [_gaudiParam3 : Inhabited ctxt] [_gaudiParam4 : Params pkey skey ptxt ctxt] (holeArgs✝ : (HoleSigs.cons (procsig () → pkey × skey) (HoleSigs.cons (procsig (pkey) → ptxt × ptxt) (HoleSigs.cons (procsig (pkey, ptxt) → ctxt) (HoleSigs.cons (procsig (ctxt) → Bool) HoleSigs.empty)))).Instantiation) :
                                                procedure.instantiate holeArgs✝ = proc () : Bool { var pk : pkey, sk : skey, m0 : ptxt, m1 : ptxt, b : Bool, c : ctxt, b' : Bool; pk, sk <- call (holeArgs✝.lookup HoleIndex.zero) (); m0, m1 <- call (holeArgs✝.lookup HoleIndex.zero.succ) (§pk); b <$ dbool; c <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ) (§pk, if §b = true then §m1 else §m0); b' <- call (holeArgs✝.lookup HoleIndex.zero.succ.succ.succ) (§c); return decide (§b' = §b) }

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