Documentation

CslibFrontier.Probability.BitString.ToeplitzHash

Toeplitz hashing of bit strings #

The Toeplitz hash Cslib.Probability.toeplitzHash over Bool, the maps x ↦ T x + v of bit strings for a Toeplitz matrix T and an offset v, is pairwise independent (Cslib.BitString.isPairwiseIndependentHash_toeplitzHash_bool) Katz and Lindell, Exercise 4.26. Mathlib has no Field Bool instance, so the field case Cslib.Probability.isPairwiseIndependentHash_toeplitzHash does not apply directly; the surjectivity of a ↦ toeplitz a *ᵥ d for d ≠ 0 transfers from ZMod 2 along the ring isomorphism Cslib.BitString.bitEquiv (Cslib.BitString.toeplitz_mulVec_surjective_bool). From n bits to m bits, its seeds have n + 2 m - 1 bits, against m n + m for the affine family Cslib.BitString.LinearHash.affineHash.

Main results #

References #

theorem Cslib.BitString.toeplitz_mulVec_surjective_bool {m n : ℕ} {d : Fin n → Bool} (hd : d ≠ 0) :
Function.Surjective fun (a : Fin (m + n - 1) → Bool) => (Matrix.toeplitz a).mulVec d

Boolean Toeplitz matrices reach every vector: for every nonzero bit string d, every bit string is T d for some m × n Toeplitz matrix T over Bool.

Toeplitz hashing of bit strings is pairwise independent: the maps x ↦ T x + v from n-bit strings to m-bit strings, for a uniformly random m × n Toeplitz matrix T over Bool and an independent uniformly random offset v, form a pairwise independent hash family Katz and Lindell, Exercise 4.26.