Documentation

CatCryptCore.Examples.UniversalHash

Universal Hashing and Carter-Wegman MAC #

This file formalizes universal hash families and the Carter-Wegman one-time MAC construction from Chapter 12 of "The Joy of Cryptography".

Main definitions #

Main results #

References #

Universal Hash Family #

A universal hash family with collision bound ε.

Instances For

    Pairwise-independent hash over Bool.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Forgery Games #

      Real forgery game: sample key, check if adversary's guess matches hash on new message.

      Equations
      Instances For

        Forgery advantage.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          IsPure Proofs #

          Arithmetic Helpers #

          2 × 4⁻¹ = 2⁻¹ in ENNReal.

          4⁻¹ + 4⁻¹ = 2⁻¹ in ENNReal.

          Doubling a quarter gives a half: 4⁻¹x + 4⁻¹x = 2⁻¹*x in ENNReal.

          Core prTrue Equality #

          For the Bool pairwise hash forgery game with m_star ≠ m, the prTrue distribution equals that of uniform Bool sampling.

          The proof expands the sums over Bool × Bool, computes the hash values, and uses arithmetic to show the 4-element sum equals the 2-element sum.

          Main Security Theorem #

          For the Bool hash, forgery advantage ≤ 1/2. Uses forge_prTrue_eq to show the advantage equals that of sample Bool vs pure false.

          Concrete instance: Bool hash MAC security bound.

          Collision Game and Universality #

          Collision probability game.

          Equations
          Instances For

            A hash family is ε-universal.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Collision prTrue equals uniform Bool prTrue (same argument as forge).