Guessing a hidden bit #
A distinguishing game between two experiments e false and e true has a bit-guessing form:
draw a uniform hidden bit b, run e b and win when the output equals b.
Experiment.guessBit e is that experiment. The distinguishing advantage is twice the bias of the
bit-guessing experiment over a fair coin, and a guess that does not depend on the hidden bit is
right with probability exactly one half.
Main definitions #
Cslib.Crypto.Experiment.guessBit: the bit-guessing form of a pair of experiments.
Main results #
Cslib.Crypto.Game.succProbability_uniform_bool_beq: the success probability of guessing a uniform hidden bit with the output ofg bit.Cslib.Crypto.Game.advantage_eq_two_mul_guessingAdvantage_uniform_bool_beq: the advantage betweeng falseandg trueis twice the guessing advantage of the hidden-bit game.Cslib.Crypto.Game.uniform_bool_bind_map_beq_const: a guess drawn independently of the hidden bit leaves the outcome uniform.Cslib.Crypto.Experiment.eval_guessBit,Cslib.Crypto.Experiment.advantage_eq_two_mul_guessingAdvantage_guessBit: the same facts for experiments.
For any Boolean-indexed family of games g : Bool → Game, sampling a uniform hidden bit
bit ← PMF.uniformOfFintype Bool and outputting guess == bit for guess ← g bit succeeds with
probability (1 - succProbability (g false) + succProbability (g true)) / 2. This is
succProbability_uniform_bool_xor with the complementary output convention.
The advantage between g false and g true is twice the guessing advantage of the game that
guesses a uniform hidden bit bit with the output of g bit.
Guessing a uniform hidden bit with a guess drawn from m, independently of the bit, leaves
the outcome a fair coin.
The bit-guessing form of the experiments e false and e true: draw a uniform hidden bit
b, run e b and return whether its output equals b.
The advantage between e false and e true is twice the guessing advantage of their
bit-guessing form.