Documentation

VCVio.CryptoFoundations.SecExp

Security Experiments #

This file gives a basic way to represent security experiments, as an extension of OracleAlg. The definition is meant to be simple enough to give useful lemmas while still being able to represent most common use cases.

We also give a definition SecAdv α β of a security adversary with input α and output β, as just a computation bundled with a bound on the number of queries it makes.

The main definition is SecExp spec α β, which extends OracleAlg with three functions:

noncomputable def ProbComp.advantage' (p : ProbComp Bool) :
Equations
Instances For
    noncomputable def ProbComp.advantage₂' (p q : ProbComp Bool) :
    Equations
    Instances For
      noncomputable def ProbComp.advantage (p : ProbComp Unit) :

      The advantage of a game p, assumed to be a probabilistic computation ending with a guard statement, is the absolute difference between the probability of success and 1/2.

      Equations
      Instances For

        The advantage doesn't change if we replace with = () (i.e. swap the probability of success and failure).

        The advantage of a probabilistic computation is half the absolute difference between the probabilities of success and failure.

        noncomputable def ProbComp.advantage₂ (p q : ProbComp Unit) :

        The advantage between two games p and q, modeled as probabilistic computations returning Unit, is the absolute difference between their probabilities of success.

        Equations
        Instances For
          @[simp]

          The advantage between a game and itself is zero (i.e. it is reflexive).

          The advantage between two games is symmetric.

          The advantage between two games is the same as the absolute difference between their probabilities of failure.

          structure SecAdv {ι : Type u} [DecidableEq ι] (spec : OracleSpec ι) (α β : Type u) :
          Type (u + 1)

          A security adversary bundling a computation with a bound on the number of queries it makes, where the bound must be shown to satisfy IsQueryBound. We also require an explicit list of all oracles used in the computation, which is necessary in order to make certain reductions computable.

          Instances For