Documentation

UniversalHashing.AlmostUniversal

ε-Almost Universal Hashing #

This file defines the notions

These are relaxations of HashFamily.universal2 and HashFamily.stronglyUniversal2 where equality/bounds are replaced by ε.

Main definitions #

Main results #

References #

def HashFamily.almostUniversal2 {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [DecidableEq Output] (ε : ) (H : HashFamily Seed Input Output) :

A hash family is ε-almost-universal₂ (ε-AU₂) with parameter ε : ℚ if for any two distinct inputs x and y, the probability over a uniform random seed of a collision is at most ε:

Pr_{s}[H s x = H s y] ≤ ε

HashFamily.universal2 is the special case ε = 1 / |Output|; see HashFamily.universal2_iff_probUniform.

Definition 1.1 in [BKST15].

Equations
Instances For
    def HashFamily.almostStronglyUniversal2 {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [Fintype Output] [DecidableEq Output] (ε : ) (H : HashFamily Seed Input Output) :

    A hash family is ε-almost-strongly-universal₂ (ε-ASU₂) with parameter ε : ℚ if for every pair of distinct inputs x ≠ y and all outputs a, b:

    Pr_{s}[H s x = a ∧ H s y = b] ≤ ε / |Output|

    HashFamily.stronglyUniversal2 is the special case ε = 1 / |Output| where the bound is tight; see HashFamily.stronglyUniversal2_iff_almostStronglyUniversal2.

    Definition 1.1 in [BKST15]. This is the prevalent definition in modern literature.

    Relationship to alternative definitions #

    [S94] additionally requires uniformity Pr_{s}[H s x = a] = 1 / |Output| (see HashFamily.uniform), i.e., the conjunction H.uniform ∧ H.almostStronglyUniversal2 ε.

    The uniformity condition is motivated by Wegman–Carter MACs, where it ensures that observing a tag (m, t) reveals no information about the key. The two definitions coincide when ε = 1 / |Output| (the strongly-universal case): the joint bound then forces all marginals to equal 1 / |Output|, implying uniformity.

    Equations
    Instances For
      def HashFamily.uniform {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [Fintype Output] [DecidableEq Output] (H : HashFamily Seed Input Output) :

      A hash family is uniform if every input maps to every output with equal probability:

      Pr_{s}[H s x = a] = 1 / |Output|

      [S94] defines ε-ASU₂ as the conjunction H.uniform ∧ H.almostStronglyUniversal2 ε; see HashFamily.almostStronglyUniversal2 for a discussion of the two definitions and when they coincide.

      Equations
      Instances For
        theorem HashFamily.almostUniversal2_mono {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [DecidableEq Output] {ε₁ ε₂ : } ( : ε₁ ε₂) (H : HashFamily Seed Input Output) (h : almostUniversal2 ε₁ H) :
        theorem HashFamily.almostStronglyUniversal2_mono {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [Fintype Output] [DecidableEq Output] {ε₁ ε₂ : } ( : ε₁ ε₂) (H : HashFamily Seed Input Output) (h : almostStronglyUniversal2 ε₁ H) :
        theorem HashFamily.almostUniversal2_of_almostStronglyUniversal2 {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [Fintype Output] [DecidableEq Output] [Nonempty Seed] {ε : } (H : HashFamily Seed Input Output) (h : almostStronglyUniversal2 ε H) :
        theorem HashFamily.almostStronglyUniversal2_of_stronglyUniversal2 {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [Fintype Output] [DecidableEq Output] [Nonempty Seed] (H : HashFamily Seed Input Output) (hsu : H.stronglyUniversal2) :
        theorem HashFamily.stronglyUniversal2_iff_almostStronglyUniversal2 {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [Fintype Output] [DecidableEq Output] [Nonempty Seed] (H : HashFamily Seed Input Output) :

        stronglyUniversal2 is equivalent to almostStronglyUniversal2 (1 / |Output|). Since 1 / |Output| is the minimum possible ε for any ε-ASU₂ family (see almostStronglyUniversal2_eps_lower_bound), this characterizes strongly universal families as exactly those achieving the tightest possible near-independence bound.

        theorem HashFamily.uniform_of_stronglyUniversal2 {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [Fintype Output] [DecidableEq Output] [Nonempty Seed] [Nontrivial Input] (H : HashFamily Seed Input Output) (hsu : H.stronglyUniversal2) :
        theorem HashFamily.almostStronglyUniversal2_eps_lower_bound {Seed : Type u_1} {Input : Type u_2} {Output : Type u_3} [Fintype Seed] [Fintype Output] [DecidableEq Output] [Nonempty Seed] [Nontrivial Input] {ε : } (H : HashFamily Seed Input Output) (h : almostStronglyUniversal2 ε H) :
        1 / (Fintype.card Output) ε