Documentation

VCVio.CryptoFoundations.MacAlg

Message Authentication Codes #

This file defines keyed message-authentication-code algorithms together with their standard UF-CMA security game.

structure MacAlg (m : TypeType v) [Monad m] (M K T : Type) :

MAC algorithm with computations in the monad m, where M is the message space, K the key space, and T the tag space.

  • keygen : m K
  • tag : KMm T
  • verify : KMTm Bool
Instances For
    def MacAlg.taggingOracle {m : TypeType v} [Monad m] {M K T : Type} (macAlg : MacAlg m M K T) (k : K) :
    QueryImpl (OracleSpec.ofFn fun (x : M) => T) (WriterT (OracleSpec.ofFn fun (x : M) => T).QueryLog m)

    Oracle exposing chosen-message tagging queries while logging every queried message.

    Instances For
      def MacAlg.PerfectlyComplete {m : TypeType v} [Monad m] {M K T : Type} (macAlg : MacAlg m M K T) (runtime : ProbCompRuntime m) :

      Perfect completeness for a MAC: honestly generated tags always verify.

      Instances For
        structure MacAlg.UF_CMA_Adversary {ι : Type u} {spec : OracleSpec ι} {M K T : Type} (_macAlg : MacAlg (OracleComp spec) M K T) :

        UF-CMA adversary for a MAC: it receives oracle access to the tagging oracle and outputs a candidate forgery (msg, tag).

        Instances For
          def MacAlg.UF_CMA_Exp {ι : Type u} {spec : OracleSpec ι} {M K T : Type} [DecidableEq M] [DecidableEq T] {macAlg : MacAlg (OracleComp spec) M K T} (runtime : ProbCompRuntime (OracleComp spec)) (adversary : macAlg.UF_CMA_Adversary) :

          UF-CMA experiment for a MAC: the adversary succeeds iff it outputs a valid tag for a fresh message under the challenge key.

          Instances For
            noncomputable def MacAlg.UF_CMA_Advantage {ι : Type u} {spec : OracleSpec ι} {M K T : Type} [DecidableEq M] [DecidableEq T] {macAlg : MacAlg (OracleComp spec) M K T} (runtime : ProbCompRuntime (OracleComp spec)) (adversary : macAlg.UF_CMA_Adversary) :

            UF-CMA advantage for a MAC, represented as the probability of producing a valid forgery on a fresh message.

            Instances For