Documentation

VCVio.CryptoFoundations.DataEncapMech

Data Encapsulation Mechanisms #

This file defines data encapsulation mechanisms (DEMs), their correctness notion, and the one-time IND-CPA game used by the KEM+DEM composition theorem.

structure DEMScheme (m : TypeType u) [Monad m] (K M C : Type) :

A data encapsulation mechanism with key space K, message space M, and ciphertext space C. The key is supplied externally, matching the proof-ladders DEM model.

  • encrypt : KMm C
  • decrypt : KCm M
Instances For
    def DEMScheme.CorrectExp {m : TypeType v} [Monad m] {K M C : Type} (dem : DEMScheme m K M C) [DecidableEq M] (k : K) (msg : M) :

    Correctness experiment for a DEM under an externally supplied key.

    Instances For
      def DEMScheme.PerfectlyCorrect {m : TypeType v} [Monad m] {K M C : Type} (dem : DEMScheme m K M C) [DecidableEq M] (runtime : ProbCompRuntime m) :

      Perfect correctness for a DEM: every externally supplied key decrypts honest ciphertexts correctly with probability 1.

      Instances For
        structure DEMScheme.IND_CPA_Adversary {K M C ι : Type} {spec : OracleSpec ι} (_dem : DEMScheme (OracleComp spec) K M C) :
        Type (max 1 u_1)

        Two-phase one-time IND-CPA adversary for a DEM. The key is hidden, so the message-selection phase receives no public input.

        Instances For
          def DEMScheme.IND_CPA_Exp {K M C ι : Type} {spec : OracleSpec ι} [SampleableType K] {dem : DEMScheme (OracleComp spec) K M C} (runtime : ProbCompRuntime (OracleComp spec)) (adversary : dem.IND_CPA_Adversary) (b : Bool) :

          Fixed-branch one-time IND-CPA experiment for a DEM, matching the source proof-ladders DEM_1CPA_Exp.run(b) presentation.

          Instances For
            def DEMScheme.IND_CPA_Game {K M C ι : Type} {spec : OracleSpec ι} [SampleableType K] {dem : DEMScheme (OracleComp spec) K M C} (runtime : ProbCompRuntime (OracleComp spec)) (adversary : dem.IND_CPA_Adversary) :

            Game-form one-time IND-CPA experiment for a DEM.

            Instances For
              noncomputable def DEMScheme.IND_CPA_Advantage {K M C ι : Type} {spec : OracleSpec ι} [SampleableType K] {dem : DEMScheme (OracleComp spec) K M C} (runtime : ProbCompRuntime (OracleComp spec)) (adversary : dem.IND_CPA_Adversary) :

              One-time IND-CPA advantage for a DEM, defined canonically as the bias of the single game.

              Instances For
                theorem DEMScheme.IND_CPA_Advantage_eq_game_bias {K M C ι : Type} {spec : OracleSpec ι} [SampleableType K] {dem : DEMScheme (OracleComp spec) K M C} (runtime : ProbCompRuntime (OracleComp spec)) (adversary : dem.IND_CPA_Adversary) :
                IND_CPA_Advantage runtime adversary = (IND_CPA_Game runtime adversary).boolBiasAdvantage

                The canonical one-time IND-CPA advantage is definitionally the bias of the single game.