Security experiments as programs #
A security experiment is the challenger's program: it samples, runs the adversary and returns a
bit. Experiment is that program, a ProbComp Bool, and mirrors Game := PMF Bool, its output
distribution. Scheme algorithms, adversaries and experiments are written as programs, and
ProbComp.eval appears only where a probability is taken: in Experiment.succProbability and
Experiment.advantage, which are the Game notions of the evaluated programs.
Names follow one convention. A …Experiment is one instance, at fixed parameters (a group, a key
space, a security parameter already chosen). A …Game is a family: Game.withSetup draws public
parameters from a setup law, which need not be efficiently sampleable, and then runs the fixed
experiment. When the setup is itself a program, such as key generation, the experiment binds it:
Experiment.advantage_bind_le_of_support and Experiment.succProbability_bind_le_of_support
lift a bound that holds at every possible output of the setup program.
Experiment.succProbability and Experiment.advantage are reducible abbreviations, so simp and
term-mode applications of the Game lemmas see through them. rw matches syntactically: unfold
with simp only [Experiment.advantage] before rewriting with a Game lemma.
distAdvantage real sim D is the advantage of a distinguisher D between two view distributions,
as in simulation-based definitions.
Main definitions #
Cslib.Crypto.Experiment: a security experiment, as a program returning a bit.Cslib.Crypto.Experiment.succProbability,Cslib.Crypto.Experiment.advantage: the success probability of an experiment and the distinguishing advantage between two experiments.Cslib.Crypto.distAdvantage: the advantage of a distinguisher between two view distributions.Cslib.Crypto.Game.withSetup: the game that draws public parameters and runs an experiment.
Main results #
Cslib.Crypto.Experiment.coe_succProbability,Cslib.Crypto.Experiment.coe_advantage: as real numbers, the success probability isPr[e]and the advantage is|Pr[e₀] - Pr[e₁]|.Cslib.Crypto.distAdvantage_eq_zero_of_eval_eq: a perfect simulation has advantage zero.Cslib.Crypto.Game.withSetup_pure: a point setup law runs one experiment.Cslib.Crypto.Game.advantage_withSetup_le,Cslib.Crypto.Game.succProbability_withSetup_le: a bound for every supported parameter bounds the game.Cslib.Crypto.Experiment.advantage_bind_le_of_support,Cslib.Crypto.Experiment.succProbability_bind_le_of_support: a bound for every output of a setup program bounds the experiment that runs it first.
References #
A security experiment: the challenger's program, which returns whether the adversary won (for
a search or forgery experiment) or the adversary's guess (for a distinguishing experiment). Its
output distribution is the Game ProbComp.eval e.
The success probability of an experiment: the probability that it returns true.
The distinguishing advantage between two experiments: the absolute difference of their success probabilities ([BS23], Section 3.1).
As a real number, the success probability of an experiment is Pr[e].
As a real number, the advantage between two experiments is |Pr[e₀] - Pr[e₁]|.
The advantage of the distinguisher D between the view distributions real and sim: the
advantage between running D on a real view and on a simulated one.
A perfect simulation, one with the same view distribution, gives every distinguisher advantage zero.
The game that draws public parameters p from the setup law setup and runs the experiment
exp p. The setup law is a distribution, not a program: it need not be efficiently
sampleable.
With a point setup law, the game is the evaluated experiment.
A bound on the advantage between two experiments at every supported parameter bounds the advantage between the games over the same setup law.
A bound on the success probability of an experiment at every supported parameter bounds the success probability of the game.
The experiment that runs a setup program and then an experiment on its output is the game over the setup's output distribution.
A bound on the advantage at every possible output of a setup program, such as key generation, bounds the advantage between the experiments that run it first.
A bound on the success probability at every possible output of a setup program bounds the success probability of the experiment that runs it first.