Plain polynomial-time Boolean affine hashing and prefix-collision conditioning #
This module certifies Cslib.BitString.LinearHash.wordAffineHash,
Cslib.BitString.LinearHash.wordAdjustAffineSeed and the zero test
Cslib.BitString.LinearHash.hashZero directly in the plain ComputableInPolyTime
calculus, together with uniform strict-PPT sampling of prefix-colliding affine seeds.
Main results #
Cslib.BitString.LinearHash.computableInPolyTime_wordAffineHash: plain polynomial-time certificate forwordAffineHash.Cslib.BitString.LinearHash.computableInPolyTime_wordAdjustAffineSeed: plain polynomial-time certificate forwordAdjustAffineSeed.Cslib.BitString.LinearHash.isPPTOn_sampleAdjustedAffineSeed: uniform strict-PPT sampler drawing a fresh(k * n + k)-bit affine seed and projecting it onto prefix collisions ofyandy₀.Cslib.BitString.LinearHash.computableInPolyTime_hashZero: plain polynomial-time certificate forhashZero.
References #
theorem Cslib.BitString.LinearHash.computableInPolyTime_wordAffineHash {α : Type} {encode : α ↪ List Bool} {count : α → ℕ} {seed input : α → List Bool} (hcount : Turing.MultiTapeTM.ComputableInPolyTime count encode Turing.MultiTapeTM.encUnary) (hseed : Turing.MultiTapeTM.ComputableInPolyTime seed encode Turing.MultiTapeTM.encBits) (hinput : Turing.MultiTapeTM.ComputableInPolyTime input encode Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : α) => wordAffineHash (count a) (seed a) (input a)) encode
Turing.MultiTapeTM.encBits
Evaluate wordAffineHash in plain polynomial time, with output dimension supplied in unary.
theorem Cslib.BitString.LinearHash.computableInPolyTime_wordAdjustAffineSeed {α : Type} {encode : α ↪ List Bool} {k n r : α → ℕ} {y y₀ seed : α → List Bool} (hk : Turing.MultiTapeTM.ComputableInPolyTime k encode Turing.MultiTapeTM.encUnary) (hn : Turing.MultiTapeTM.ComputableInPolyTime n encode Turing.MultiTapeTM.encUnary) (hr : Turing.MultiTapeTM.ComputableInPolyTime r encode Turing.MultiTapeTM.encUnary) (hy : Turing.MultiTapeTM.ComputableInPolyTime y encode Turing.MultiTapeTM.encBits) (hy₀ : Turing.MultiTapeTM.ComputableInPolyTime y₀ encode Turing.MultiTapeTM.encBits) (hseed : Turing.MultiTapeTM.ComputableInPolyTime seed encode Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : α) => wordAdjustAffineSeed (k a) (n a) (r a) (y a) (y₀ a) (seed a))
encode Turing.MultiTapeTM.encBits
Project an affine seed onto the prefix-collision subgroup in plain polynomial time, with
dimensions k, n, and r supplied in unary.
theorem Cslib.BitString.LinearHash.isPPTOn_sampleAdjustedAffineSeed {α : Type} {encode : α ↪ List Bool} {k n r : α → ℕ} {y y₀ : α → List Bool} (hk : Turing.MultiTapeTM.ComputableInPolyTime k encode Turing.MultiTapeTM.encUnary) (hn : Turing.MultiTapeTM.ComputableInPolyTime n encode Turing.MultiTapeTM.encUnary) (hr : Turing.MultiTapeTM.ComputableInPolyTime r encode Turing.MultiTapeTM.encUnary) (hy : Turing.MultiTapeTM.ComputableInPolyTime y encode Turing.MultiTapeTM.encBits) (hy₀ : Turing.MultiTapeTM.ComputableInPolyTime y₀ encode Turing.MultiTapeTM.encBits) :
Probability.IsPPTOn encode Turing.MultiTapeTM.encBits fun (a : α) => do
let rawSeed ← sampleList (k a * n a + k a)
pure (wordAdjustAffineSeed (k a) (n a) (r a) (y a) (y₀ a) rawSeed)
Sample a fresh (k * n + k)-bit affine seed and project it onto the prefix-collision subgroup
of y and y₀ in uniform strict polynomial time.
theorem Cslib.BitString.LinearHash.computableInPolyTime_hashZero {α : Type} {encode : α ↪ List Bool} {k n : α → ℕ} {seed x : α → List Bool} (hk : Turing.MultiTapeTM.ComputableInPolyTime k encode Turing.MultiTapeTM.encUnary) (hn : Turing.MultiTapeTM.ComputableInPolyTime n encode Turing.MultiTapeTM.encUnary) (hseed : Turing.MultiTapeTM.ComputableInPolyTime seed encode Turing.MultiTapeTM.encBits) (hx : Turing.MultiTapeTM.ComputableInPolyTime x encode Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : α) => hashZero (k a) (n a) (seed a) (x a)) encode
Turing.MultiTapeTM.encBool
Decide hashZero in plain polynomial time, with dimensions k and n supplied in unary.