Documentation

GaudisCrypt.Lib.RO.OneWayness_GameHop.Definitions

OneWayness GameHop: Definitions #

This module collects the game definitions used in the game-hopping proof of one-wayness for a random-oracle adversary:

Plus the tracking flags and collector variables with their disjointness axioms / instances:

This module also defines lazy_query_tracked (the flag-flipping variant of lazy_query) which is shared by Game 1 and Game 2.

Game 0 — the original OW experiment #

This is exactly ow_experiment ow_adv q lazy_init lazy_query. We give it a new name here for clarity in the game-hopping chain.

Game 1 — explicit y sampling #

lazy_query x on an empty cache at x unfolds to "sample y uniform, write (x ↦ y) into RO, return y". Game 1 makes this explicit: sample y separately and write it into RO manually. Same distribution as Game 0.

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

    Hop 0 → 1: program equality #

    ow_game_0 = ow_game_1 (no probabilistic content; just unfolding lazy_query x on an RO state where x is not cached).

    On a state whose entire RO is fun _ => none (i.e., immediately after lazy_init), lazy_query inp is wp-equivalent to "sample a fresh y, insert (inp ↦ y) into the RO, return y".

    Hop 1 → 2: up-to-bad #

    P[Game 1 wins] ≤ P[Game 2 wins] + P[bad in Game 1], where bad = "adversary queries the oracle at chal_x at some point in the loop or in the verification step."

    The strategy:

    instance instIsGlobalVarBoolChal_x_queried_ghMk :
    chal_x_queried_gh.IsGlobalVar { name := "chal_x_queried_gh", type := Bool, nonempty := ⋯, key := 591631538543112835044201471496796222888401557337706049032565236488427516503197119205646226087805028, keyCorrect := ⋯ }

    Fresh tracking flag for the game-hopping proof (separate from QueryHit's chal_x_queried to avoid cross-contamination).

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

      A lazy_query that also sets chal_x_queried_gh to true if the input equals chal_x. The tracked games use this in place of lazy_query. Defined via explicit >>= to avoid Lean's do-notation join-point macro on the if branch.

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

        Output-side matched flag for the Game 2 reduction #

        The reduction Game 2 wins ≤ guess(output, q+1) matched tracks "some lazy_query returned chal_y" via a fresh flag matched_chal_y. Game 2's win event implies this flag is set: the final lazy_query_tracked returns y_check = chal_y, which sets the flag.

        This is the standard cryptographic factorization where the matching event is captured by a dedicated flag, exposing it as a guess_experiment instance.

        instance instIsGlobalVarBoolMatched_chal_yMk :
        matched_chal_y.IsGlobalVar { name := "matched_chal_y", type := Bool, nonempty := ⋯, key := 497090213979999097269279505642886367906600992254961721271251819160921180955869294, keyCorrect := ⋯ }

        Matched flag for the output-side guess (against chal_y).

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          instance instIsGlobalVarListInputQueries_inputMk :
          queries_input.IsGlobalVar { name := "queries_input", type := List input, nonempty := ⋯, key := 427890336944210892864940756239465376254891241977580946207644200197340659826, keyCorrect := ⋯ }

          Queries list for the input-side collector (Game 1 bad reduction). Records adversary's inputs across loop iterations.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            instance instIsGlobalVarListOutputQueries_outputMk :
            queries_output.IsGlobalVar { name := "queries_output", type := List output, nonempty := ⋯, key := 476717759073588686289223177868809398395024665074198397264579418271829119622054002, keyCorrect := ⋯ }

            Queries list for the output-side collector (Game 2 wins reduction). Records lazy_query_tracked outputs across loop iterations.

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

              Tracked Game 1: same as ow_game_1, but every lazy_query is replaced by lazy_query_tracked so the chal_x_queried_gh flag tracks whether the adversary ever queried chal_x.

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

                Tracked Game 2: same as ow_game_2, with lazy_query → lazy_query_tracked.

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