State-Separating Proofs: Advantage and evalDist congruences #
This file bridges the SSP Package layer to VCVio's probability machinery.
Package.runProbreads off theProbCompproduced by running a probability-only package (imports= unifSpec) against an adversary.Package.advantagemeasures the Boolean distinguishing advantage between two packagesG₀ G₁ : Package unifSpec E σagainst an external adversaryA : OracleComp E Bool. It is built directly out ofProbComp.boolDistAdvantagefromVCVio.CryptoFoundations.SecExp, and inherits its triangle inequality.Package.simulateQ_evalDist_congris the SSP-flavoured "rewrite the handler up to evalDist" rule: two query implementations that agree pointwise underevalDistyield the same simulation distribution, even when the underlyingProbComps are not propositionally equal.
The program-level reduction lemmas (simulateQ_link_run, run_link, run_link_ofStateless)
live in VCVio.SSP.Composition, since they do not involve ProbComp and are stated for the
fully universe-polymorphic Package.
Universe layout #
Everything in this file is fixed at Type 0: ProbComp : Type → Type and the adversary
returns a Bool : Type, so the export indices, ranges, and state are all Type. Only the
import range universe and import index universe could a priori be larger, but runProb ties
the import to unifSpec : OracleSpec ℕ whose own indices and ranges are in Type.
Run a probability-only package (imports = unifSpec) against an adversary. The result is
a ProbComp, ready to be measured with Pr[= true | _] and boolDistAdvantage.
Instances For
runProb unfolds to run definitionally; exposed as a simp lemma so that SSP-facing
lemmas phrased in terms of runProb rewrite cleanly against run-phrased ones in
VCVio.SSP.Composition.
Advantage and triangle inequality #
The Boolean distinguishing advantage between two probability-only packages, against a
single Boolean-valued adversary. The internal state types σ₀, σ₁ of the two games are
independent: from the adversary's point of view only the export interface and the resulting
output distribution matter.
This quantity is always nonnegative and symmetric in its first two arguments (see
advantage_symm), so it should be read as an unsigned gap rather than a signed quantity.
Instances For
If two packages run an adversary to the same ProbComp Bool up to evalDist, their
distinguishing advantages against any third package coincide. This is the basic "replace by
equivalent game" rule that underlies SSP game-hopping at the advantage level: only the
output distributions matter, not the syntactic form of the resulting OracleComp.
Two ProbComp-valued query implementations that agree on every input under evalDist
yield identical evaluations of any simulateQ. This is the SSP-flavoured "rewrite the handler
up to evalDist" rule used to discharge program equivalences whose underlying computations
are not propositionally equal but agree distributionally.
Stateful generalization of simulateQ_evalDist_congr: two StateT σ ProbComp-valued query
implementations that agree on every (input, state) pair under evalDist yield identical
evaluations of (simulateQ _ A).run s for every starting state s.
This is the lemma to use when both sides of a game equivalence are stateful packages with the
same internal state type and only their per-query handlers differ up to distribution (e.g., a
dhTripleReal-vs-dhTripleRand swap propagated through a stateless reduction).