Carter–Wegman polynomial evaluation #
Over a finite field F, a message m = (a₁, …, a_v) of length at most ℓ is hashed with a key
k ∈ F by evaluating a polynomial at k [WC81]:
polyHash k m = k ^ v + a₁ k ^ (v - 1) + ⋯ + a_v, Boneh and Shoup'sHpoly([BS23], Equation 7.3). It isℓ / |F|-universal ([BS23], Lemma 7.2).xpolyHash k m = k * polyHash k m, theirHxpoly([BS23], Equation 7.23). It is(ℓ + 1) / |F|-Δ-universal ([BS23], Lemma 7.8), which is what the Carter–Wegman MAC needs.
The leading k ^ v lets messages of different lengths be compared: the message polynomials are
monic of degree v, so distinct messages give distinct polynomials, and the difference of two of
them has at most ℓ roots. Both functions are computed by Horner's rule.
Main definitions #
Cslib.Probability.polyHash,Cslib.Probability.xpolyHash: polynomial evaluation hashes.
Main results #
Cslib.Probability.isUniversalHash_polyHash:polyHashisℓ / |F|-universal.Cslib.Probability.isDeltaUniversalHash_xpolyHash:xpolyHashis(ℓ + 1) / |F|-Δ-universal.
References #
Hpoly is ℓ / |F|-universal ([BS23], Lemma 7.2): two distinct messages of
length at most ℓ collide only at the roots of the nonzero difference of their polynomials.
Hxpoly is (ℓ + 1) / |F|-Δ-universal ([BS23], Lemma 7.8): a difference d
of the hashes of two distinct messages occurs only at the roots of the nonzero polynomial
X (f - g) - d of degree at most ℓ + 1.