Word-level Boolean affine hashes and zero tests #
An affine hash x ↦ A x + b to k bits of n-bit strings
(Cslib.BitString.LinearHash.affineHash) has a (k * n + k)-bit seed: the k rows of the matrix
A, followed by the k-bit offset b. packAffineSeed and unpackAffineSeed convert between
(Fin k → BitString n) × BitString k and words (List Bool), padding missing seed bits with
false and ignoring extra trailing bits; on fixed-length bit strings they induce the equivalence
affineSeedEquiv.
wordAffineHash evaluates x ↦ A x + b on words, agreeing with affineHash on List.ofFn inputs
(wordAffineHash_eq_ofFn). hashZero decides whether the affine hash sends the n-bit view of a
word to zero (hashZero_eq_true_iff, hashZero_ofFn), providing Arthur's hash test in the set
lower bound protocol of Goldwasser and Sipser [GS86]
Arora and Barak, Section 8.2 (Cslib.Complexity.SetLowerBound.verifier) and in the
public-coin emulation of private coins (Cslib.Complexity.Emulation.check). Plain polynomial-time
certificates for wordAffineHash and hashZero are proved in
CslibFrontier.Computability.Probabilistic.AffineHash.
Main definitions #
Cslib.BitString.LinearHash.packAffineSeed,Cslib.BitString.LinearHash.unpackAffineSeed: total word-level packing and unpacking of affine seeds(A, b).Cslib.BitString.LinearHash.affineSeedEquiv: equivalence betweenBitString (k * n + k)and(Fin k → BitString n) × BitString k.Cslib.BitString.LinearHash.wordAffineHash: total word-level Boolean affine hashx ↦ A x + b.Cslib.BitString.LinearHash.hashZero: word-level zero test decidingA x + b = 0on then-bit view ofx.
Main results #
Cslib.BitString.LinearHash.unpackAffineSeed_packAffineSeed,Cslib.BitString.LinearHash.packAffineSeed_unpackAffineSeed: round-trip identities for affine seed words.Cslib.BitString.LinearHash.wordAffineHash_eq_ofFn: exact agreement betweenwordAffineHashandaffineHashon unpacked seeds.Cslib.BitString.LinearHash.hashZero_eq_true_iff,Cslib.BitString.LinearHash.hashZero_ofFn: exact agreement betweenhashZeroand the kernel testaffineHash s x = 0.
References #
- S. Goldwasser, M. Sipser, Private coins versus public coins in interactive proof systems
- S. Arora, B. Barak, Computational Complexity: A Modern Approach
- I. Haitner, T. Holenstein, O. Reingold, S. Vadhan, H. Wee, Inaccessible Entropy II: IE Functions and Universal One-Way Hashing, Section 4.2, Theorem 4.5, pp. 21–25
Row i of unpackAffineSeed k n seed is row i of width n of the matrix prefix.
The offset of unpackAffineSeed k n seed is the k-bit prefix after the k * n matrix
bits.
On a fixed-width input, wordAffineHash computes affineHash on the unpacked seed.
On arbitrary words, hashZero decides whether the unpacked affine hash sends the n-bit view
of x to zero.