Documentation

UniversalHashing.LinearModp

Carter–Wegman-style universal hash family. #

h_{a,b}(x) = a * x + b (mod p),

Main result: linearHashFamily.universal2

@[reducible, inline]
abbrev LinearIndex (p : ) :

Index type: pairs (a, b) in (ZMod p)² with a ≠ 0.

Equations
Instances For

    Linear family over ZMod p:

    h_{a,b}(x) = a * x + b (mod p),

    This is a special case of family H_1 in Wegman, Carter 1979).

    where:

    • p is prime,
    • a ≠ 0 in ZMod p,
    • (a, b) is chosen uniformly from (ZMod p)² with a ≠ 0.
    Equations
    Instances For

      Hash family H_1 in Wegman, Carter 1979).

      ``h_{a,b}(x) = a * x + b  (mod p),``
      

      where:

      • p is prime,
      • a ≠ 0 in ZMod p,
      • (a, b) is chosen uniformly from (ZMod p)² with a ≠ 0.
      • x < a

      Note that x is automatically cast to ℕ and then to ZMod p, which involves a modulo operation. The family is universal-2 for a < p.

      Equations
      Instances For

        Universality of the generalLinearHashFamily, where inputs can be restricted.