Polynomial-evaluation hashes for variable-length messages #
Over a finite field F, a message m = (m₁, …, m_{ℓ'-1}) of length less than ℓ is hashed with a
key k ∈ F by appending a field element that encodes its length and evaluating a polynomial with
these ℓ' coefficients at k ([KL20], Section 4.5.2). The four coefficient layouts
studied there are:
Cslib.Crypto.PolynomialEvaluation.hash:m₁ X ^ ℓ' + ⋯ + m_{ℓ'} X, the layout of [KL20], Theorem 4.17, which isℓ / |F|-difference universal whenever the length encoding is injective.Cslib.Crypto.PolynomialEvaluation.fixedTopHash:m₁ X ^ ℓ + ⋯ + m_{ℓ'} X ^ (ℓ - ℓ' + 1)([KL20], Exercise 4.22(a)).Cslib.Crypto.PolynomialEvaluation.constantTermHash:m₁ X ^ (ℓ' - 1) + ⋯ + m_{ℓ'}([KL20], Exercise 4.22(b)).Cslib.Crypto.PolynomialEvaluation.ascendingHash:m₁ X + ⋯ + m_{ℓ'} X ^ ℓ'([KL20], Exercise 4.22(c)).
Difference universality is Cslib.Probability.IsDeltaUniversalHash for a uniform key, the
Δ-universal property of [KL20], Definition 4.14. Every layout without a constant term
yields polynomials of degree at most ℓ, so it is ℓ / |F|-difference universal as soon as
distinct messages give distinct polynomials (isDeltaUniversalHash_of_polynomial). The exercise
layouts differ in when that happens:
- layouts (a) and (c) are injective, hence
ℓ / |F|-difference universal, when the encoding is injective and never sends a positive length to zero; if the length1is sent to zero, the messages[]and[e 0]collide under every key; - layout (b) has a constant term and fails for every encoding: the hashes of
[]and[0]differ by the key-independent constante 0 - e 1.
Every evaluation is computed by Horner's rule.
Main definitions #
Cslib.Crypto.PolynomialEvaluation.coefficients: the message with its length code appended.Cslib.Crypto.PolynomialEvaluation.ascendingEval: evaluatec₁ X + c₂ X ^ 2 + ⋯ + c_t X ^ t.
Main results #
Cslib.Crypto.PolynomialEvaluation.isDeltaUniversalHash_ascendingEval: an injective family of coefficient lists of length at mostℓwhose linear coefficient determines the length isℓ / |F|-difference universal. Theorem 4.17 is the case of a message followed by its length code.Cslib.Crypto.PolynomialEvaluation.isDeltaUniversalHash_hash: [KL20], Theorem 4.17.Cslib.Crypto.PolynomialEvaluation.isDeltaUniversalHash_fixedTopHash,Cslib.Crypto.PolynomialEvaluation.not_isDeltaUniversalHash_fixedTopHash: Exercise 4.22(a).Cslib.Crypto.PolynomialEvaluation.not_isDeltaUniversalHash_constantTermHash: Exercise 4.22(b).Cslib.Crypto.PolynomialEvaluation.isDeltaUniversalHash_ascendingHash,Cslib.Crypto.PolynomialEvaluation.not_isDeltaUniversalHash_ascendingHash: Exercise 4.22(c).
References #
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, 3rd ed., Section 4.5.2, printed p. 131, and Exercise 4.22, printed p. 143.
Horner evaluation of c₁ X + c₂ X ^ 2 + ⋯ + c_t X ^ t at k: the coefficient list starts at
the linear term, so there is no constant term.
Polynomials without constant term #
A family of polynomials without constant term, of degree at most ℓ, that separates its
inputs is ℓ / |F|-difference universal: a difference d of two distinct evaluations occurs only
at the roots of the nonzero polynomial P x - P x' - d.
The coefficient polynomial #
Layouts whose linear coefficient fixes the length #
An injective family of coefficient lists c₁ X + ⋯ + c_t X ^ t of length at most ℓ, whose
linear coefficient c₁ determines the number of coefficients, is ℓ / |F|-difference universal.
An empty list counts as having linear coefficient 0.
Theorem 4.17 #
[KL20], Theorem 4.17. For an injective length encoding, the polynomial hash
m₁ k ^ ℓ' + ⋯ + m_{ℓ'} k on F^{<ℓ} is ℓ / |F|-difference universal.
Exercise 4.22(a) #
[KL20], Exercise 4.22(a), positive part. If the length encoding sends no
positive length to zero, the layout m₁ k ^ ℓ + ⋯ + m_{ℓ'} k ^ (ℓ - ℓ' + 1) is
ℓ / |F|-difference universal.
[KL20], Exercise 4.22(a), negative part. If the length 1 is encoded as zero
and ℓ ≥ 2, the messages [] and [e 0] collide under every key, so the layout is not
ε-difference universal for any ε < 1; in particular not ℓ / |F|-difference universal when
ℓ < |F|.
Exercise 4.22(b) #
[KL20], Exercise 4.22(b). For ℓ ≥ 2 and every length encoding, the layout
m₁ k ^ (ℓ' - 1) + ⋯ + m_{ℓ'} sends [] and [0] to hashes whose difference is the
key-independent constant e 0 - e 1, so it is not ε-difference universal for any ε < 1.
Exercise 4.22(c) #
[KL20], Exercise 4.22(c), positive part. If the length encoding sends no
positive length to zero, the layout m₁ k + ⋯ + m_{ℓ'} k ^ ℓ' is ℓ / |F|-difference
universal.
[KL20], Exercise 4.22(c), negative part. If the length 1 is encoded as zero
and ℓ ≥ 2, the messages [] and [e 0] collide under every key.