OneWayness GameHop: Definitions #
This module collects the game definitions used in the game-hopping proof of one-wayness for a random-oracle adversary:
ow_game_0— the original OW experiment (eager RO).ow_game_1— equivalent to Game 0 but withysampled and pre-programmed explicitly. Connected to Game 0 byow_game_0_eq_ow_game_1(Hop 0→1).ow_game_1_tracked,ow_game_2_tracked— versions of Game 1 and Game 2 usinglazy_query_trackedinstead oflazy_queryso thechal_x_queried_ghflag tracks whetherchal_xwas ever queried.
Plus the tracking flags and collector variables with their disjointness axioms / instances:
chal_x_queried_gh : Variable Bool— tracks whether the adv queriedchal_x.matched_chal_y : Variable Bool— tracks whetherchal_ywas returned.queries_input : Variable (List input)— adversary's query list.queries_output : Variable (List output)— RO's response list.
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.
Equations
- ow_game_0 ow_adv q = ow_experiment ow_adv q lazy_init lazy_query
Instances For
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:
- Augment both games with a tracking flag
chal_x_queried_ghthat gets set totruewhenever alazy_queryis invoked at inputchal_x. - Show the tracked games are wp-equivalent to the untracked games on
posts that ignore the flag (
ProgramDenotation.wp_conditional_set_disjoint_no_op_footprint). - Show the tracked Game 1 and tracked Game 2 are identical until bad:
their wp's agree on posts that vanish whenever the flag is
true. - Apply
ProgramDenotation.up_to_badto deriveGame 1_tracked.wp G ≤ Game 2_tracked.wp G + Game 1_tracked.wp (G | bad). - Strip tracking to obtain the corresponding statement for the un-tracked games.
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.
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
oracle_step adv lazy_query_tracked is ow_challenge_y-disjoint when
adv is.