Documentation

CslibFrontier.Crypto.Game.AttackResources

Componentwise resources for concrete security #

Concrete reductions need to retain static descriptions and charge online execution without identifying unrelated units. An explicit InstalledArtifact list records each stored occurrence. Per-kind description sizes are sums over that inventory, so distinct stored copies contribute separately, while components inlined into a final artifact are not charged again. Adversaries, reducers and generic or main programs have independent coordinates; separately installed handlers and static tables or advice use their own occurrences too. AttackResources adds the common execution coordinates; Fits and IsPolynomial keep every comparison and asymptotic bound componentwise.

Offline generation is not online time unless the attack executes it. A generated artifact is still an installed occurrence, whether its compiler ran online or offline. A canonical phase ledger records input reading, compilation and its output copy, marshalling, tags, dispatch, request/reply handling, handler/interpreter/controller work, and final-output production and copying. Its time sum and peak workspace are certified against the aggregate online coordinates. Compiler and final- output accounting refer to ledger phases rather than adding duplicate time or workspace fields.

This module sums only the times of the named online phases and takes their workspace maximum. It supplies no scalar total across unrelated units; any further aggregation must state its units and be proved separately. It also supplies no program, circuit or controller: callers provide exact retained artifacts and prove that their executions fit the declared budget.

Main definitions #

Main results #

References #

This resource interface and bridge are original infrastructure.

The role of one separately installed static artifact occurrence. A final program containing hardwired components is one program occurrence; those components are not additional occurrences.

One occurrence in the installed static inventory. Repeating the same value in the inventory models distinct stored copies and charges each copy once.

  • The role under which this occurrence is installed.

  • bits : ℕ

    Exact encoded length of this occurrence.

Description bits of the occurrences of kind in an explicit installed inventory.

Concatenating inventories adds their per-kind occurrence sums. In particular, separately stored copies appearing in both inventories are charged separately.

Time and peak workspace charged to one named online phase.

  • time : ℕ

    Steps executed in this phase.

  • workspace : ℕ

    Peak workspace used during this phase.

Componentwise comparison of one online phase.

Instances For
    @[instance_reducible]

    A phase schedule has independently polynomial time and workspace.

    Canonical ledger of online phases. Sequential phase times add; workspace is aggregated by maximum because phases need not retain each other's temporary storage. Compiler and output-copy costs occur here only, rather than in duplicate view fields.

    The canonical phase order used for aggregation.

    Exact total online time: every named phase occurrence contributes once.

    Exact peak online workspace: the maximum of the named phase peaks.

    Every phase coordinate of used fits the corresponding phase coordinate of budget.

    Instances For
      @[instance_reducible]

      A phase ledger is polynomial when every named phase coordinate is polynomial independently.

      Input/output lengths of a compiler executed inside the attack experiment. Its execution and output-copy costs are the corresponding online ledger phases, so they cannot be charged twice.

      • inputBits : ℕ

        Encoded compiler-input length, independent of the attack's initial input.

      • outputBits : ℕ

        Encoded length emitted by the compiler.

      Execution resources of an explicitly realized attack. Compiler coordinates are zero when compilation is offline. Model-specific execution certificates separately justify that the declared input/output lengths and step/workspace bounds describe the actual programs.

      • inputBits : ℕ

        Encoded length of the attack's initial input, distinct from oracle requests.

      • onlineTime : ℕ

        Online steps, including marshalling, tags, dispatch, queries, interpreter/controller work, compiler work, and output production/copying, but excluding offline generation.

      • onlineWorkspace : ℕ

        Peak online workspace, rather than the sum of workspace across sequential phases.

      • Named online phase costs whose sum and maximum are certified against the aggregates above.

      • Executed compiler input/output lengths; both are zero when compilation is offline.

      • randomBits : ℕ

        Fair random bits consumed online.

      • classicalQueries : ℕ

        Classical oracle calls.

      • quantumQueries : ℕ

        Coherent quantum-oracle calls.

      • qubits : ℕ

        Maximum simultaneously active qubits, including inputs and ancillas.

      • gates : ℕ

        Executed elementary quantum gates.

      • requestBits : ℕ

        Maximum encoded request length.

      • replyBits : ℕ

        Maximum encoded reply length read by the attack.

      • outputBits : ℕ

        Maximum encoded output length emitted by the attack.

      Independent resources of an explicitly retained and executed attack. Static description sizes are derived from the occurrence inventory rather than supplied as unaudited numeric labels.

      How compiler logic used online is represented in the installed inventory. A separate compiler is its own occurrence; an inlined compiler is part of one retained main-program occurrence and is not also charged under compiler. The payload is that occurrence's exact encoded length.

      The installed occurrence selected by a compiler-installation mode.

      Instances For
        @[instance_reducible]

        Per-kind installed description bits of a resource profile.

        Installed adversary-program or circuit bits, summed once per retained occurrence.

        Installed reduction-program or circuit bits, summed once per retained occurrence.

        Installed generic or main-program bits, summed once per retained occurrence.

        Installed compiler-emitted program or circuit bits, summed once per retained occurrence.

        Installed generator bits, summed once per retained occurrence.

        Installed compiler bits, summed once per retained occurrence.

        Installed interpreter bits, summed once per retained occurrence.

        Installed separately retained wrapper/controller bits, summed once per occurrence.

        Installed separately retained handler bits, summed once per occurrence. A handler hardwired into the main program contributes only to programBits.

        Installed separately retained transition, dispatch, lookup-table or static-advice bits, summed once per occurrence. A table or advice string hardwired into the main program contributes only to programBits.

        def Cslib.Crypto.Game.AttackResources.AccountsForOnlinePhases {Certificate : Type u_1} (Certifies : Certificate → AttackExecutionResources → Prop) (certificate : Certificate) (resources : AttackResources) :

        A model-specific certificate ties every named phase to the represented execution, while the two equalities require exact aggregation rather than loose independent upper bounds. Compiler and output views are not added here because their costs already occur in the ledger.

        def Cslib.Crypto.Game.AttackResources.AccountsForExecutedCompiler {Certificate : Type u_1} (Certifies : Certificate → ExecutedCompilerResources → OnlinePhaseResources → OnlinePhaseResources → Prop) (certificate : Certificate) (installation : CompilerInstallation) (resources : AttackResources) :

        An executed compiler is fully accounted for relative to a model-specific execution certificate. The certificate connects compiler input/output and the ledger's compiler and compiler-output-copy phases to an actual execution. The installation mode charges either a separate compiler or the single main program containing inlined compiler logic. The emitted description is a distinct generatedProgram occurrence. Phase costs are bounded by, but never added again to, the overall online aggregates.

        def Cslib.Crypto.Game.AttackResources.AccountsForOutput {Certificate : Type u_1} (Certifies : Certificate → AttackExecutionResources → Prop) (certificate : Certificate) (resources : AttackResources) :

        The attack's initial input, emitted output and copying are accounted for relative to a model-specific execution certificate. This proposition is intended as an explicit part of a concrete Within certificate; it does not manufacture an execution witness.

        used fits budget when every named coordinate fits independently. This intentionally does not turn the coordinates into a scalar total.

        Instances For
          @[instance_reducible]

          Every exact resource profile fits itself.

          A resource schedule is polynomial when each coordinate is polynomially bounded independently.

          theorem Cslib.Crypto.Game.IndistinguishableWithin.indistinguishable_attackResources {Adversary : Type u_1} {game1 game2 : Adversary → ℕ → Game} {Within : ℕ → AttackResources → Adversary → Prop} {ε : ℕ → AttackResources → NNReal} {Admissible : Adversary → Prop} (h : IndistinguishableWithin game1 game2 Within ε) (hsched : ∀ (adversary : Adversary), Admissible adversary → ∃ (r : ℕ → AttackResources), AttackResources.IsPolynomial r ∧ ∀ (n : ℕ), Within n (r n) adversary) (hneg : ∀ (r : ℕ → AttackResources), AttackResources.IsPolynomial r → Negligible fun (n : ℕ) => ε n (r n)) :
          Indistinguishable game1 game2 Admissible

          Exact finite advantage bounds yield asymptotic indistinguishability when every admissible adversary supplies an explicit componentwise-polynomial resource schedule and the finite error is negligible along every such schedule. The schedule premise does not extract any program or circuit from an existential efficiency hypothesis.