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:

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

    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.

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

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

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

      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