Documentation

CslibFrontier.Crypto.Computational.CorrelationRobust

Correlation-robust hash functions #

The finite notion Cslib.Crypto.CorrelationRobust.advantage measures how well one test tells (t, fun j => H j (t j + s)) from (t, u), for uniform s, t and u, for one family H on finite types. This module states the asymptotic assumption on a hash given on words, hash : List Bool → Bool, in the form of Definition 1 of Ishai, Kilian, Nissim and Petrank [IKNP03] (§5, p. 157): an efficiently computable h : {0,1}* → {0,1} is correlation robust if for uniform k-bit strings s, t₁, …, tₘ the bits h(t₁ ⊕ s), …, h(tₘ ⊕ s) are pseudorandom given t₁, …, tₘ, for polynomially many m.

At level k with m queries, CorrelationRobust.atLevel hash k m hashes the word of the k bits of each input with hash, the same function at every position. A distinguisher for the query count m : ℕ → ℕ (CorrelationRobust.Distinguisher m) is a finite test at each level k on m k inputs of k bits and m k output bits. It is PPT (CorrelationRobust.Distinguisher.IsPPT) when one uniform strict PPT machine reads CorrelationRobust.encInput m: the unary level, the framed list of the input words and the word of the output bits, and writes the test's bit.

CorrelationRobust hash asks that the hash be computable in polynomial time and that, for every polynomially bounded query count m, every PPT distinguisher have negligible advantage. Its level-k advantage is, by definition, the finite advantage CorrelationRobust.advantage (CorrelationRobust.atLevel hash k (m k)) (D k), so the finite theorems about that advantage apply at every level without a bridge.

Relation to the source #

The two parts of the assumption are Definition 1's two conditions. polyTime reads "efficiently computable" as one deterministic polynomial-time machine on all words. The security condition secure differs from Definition 1 as follows; each difference admits fewer distinguishers, so for a hash with polyTime, Definition 1 implies secure.

The bound on m is needed. With m k = 2 ^ k queries, a distinguisher whose clock is polynomial in its input length can try every s against all the outputs, so the condition without the bound would fail for every hash computed in polynomial time.

The protocol of [IKNP03] (Fig. 1, p. 152) hashes (j, u) with a random oracle H : [m] × {0,1}^k → {0,1}^ℓ; §5 (p. 157, with footnote 10) replaces it by a correlation robust h for bit transfers (ℓ = 1), hashing u alone. CorrelationRobust.atLevel is that replacement: it ignores the position.

Main definitions #

This module has definitions only. The test module CslibFrontierTests.Crypto.CorrelationRobust shows that a constant hash is not correlation robust.

References #

The hash of the word function hash at level k, for m queries: every position hashes the word List.ofFn t of the k bits of its input with hash.

@[reducible, inline]

A distinguisher for the query count m: at each level k, a test on m k inputs of k bits and m k output bits. Distinguisher.IsPPT states its efficiency.

noncomputable def Cslib.Crypto.CorrelationRobust.inputsWord (k count : ℕ) (t : Fin count → BitString k) :

The word of count inputs of k bits: the framed list (encList encBits) of their bit words.

The word of the inputs determines them.

The input of a distinguisher for the query count m, as a record: the level, the m level inputs and the m level output bits.

theorem Cslib.Crypto.CorrelationRobust.encInput_mk_budget (m : ℕ → ℕ) {γ : Type} {encIn : γ ↪ List Bool} {budget x0 : γ → ℕ} {x1 : (c : γ) → Fin (m (x0 c)) → BitString (x0 c)} {x2 : (c : γ) → BitString (m (x0 c))} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encUnary budget) (h1 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => inputsWord (x0 c) (m (x0 c)) (x1 c)) encIn Turing.MultiTapeTM.encBits budget) (h2 : Turing.MultiTapeTM.ComputableInSpace (fun (c : γ) => (Turing.MultiTapeTM.encBitString (m (x0 c))) (x2 c)) encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { level := x0 x, inputs := x1 x, outputs := x2 x }) encIn (encInput m) budget
theorem Cslib.Crypto.CorrelationRobust.encInput_outputs_budget (m : ℕ → ℕ) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Input m} :
theorem Cslib.Crypto.CorrelationRobust.encInput_level_budget (m : ℕ → ℕ) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Input m} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encInput m) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).level) encIn✝ Turing.MultiTapeTM.encUnary S✝
theorem Cslib.Crypto.CorrelationRobust.encInput_mk_polyTime (m : ℕ → ℕ) {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → ℕ} {x1 : (c : γ) → Fin (m (x0 c)) → BitString (x0 c)} {x2 : (c : γ) → BitString (m (x0 c))} (h0 : Turing.MultiTapeTM.ComputableInPolyTime x0 encIn Turing.MultiTapeTM.encUnary) (h1 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => inputsWord (x0 c) (m (x0 c)) (x1 c)) encIn Turing.MultiTapeTM.encBits) (h2 : Turing.MultiTapeTM.ComputableInPolyTime (fun (c : γ) => (Turing.MultiTapeTM.encBitString (m (x0 c))) (x2 c)) encIn Turing.MultiTapeTM.encBits) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (x : γ) => { level := x0 x, inputs := x1 x, outputs := x2 x }) encIn (encInput m)
theorem Cslib.Crypto.CorrelationRobust.encInput_inputs_polyTime (m : ℕ → ℕ) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Input m} :
theorem Cslib.Crypto.CorrelationRobust.encInput_inputs_budget (m : ℕ → ℕ) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Input m} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ (encInput m) S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => inputsWord (g✝ c).level (m (g✝ c).level) (g✝ c).inputs) encIn✝ Turing.MultiTapeTM.encBits S✝
theorem Cslib.Crypto.CorrelationRobust.encInput_mk_inO (m : ℕ → ℕ) {γ : Type} {encIn : γ ↪ List Bool} {x0 T0 S0 : γ → ℕ} {x1 : (c : γ) → Fin (m (x0 c)) → BitString (x0 c)} {T1 S1 : γ → ℕ} {x2 : (c : γ) → BitString (m (x0 c))} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encUnary T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => inputsWord (x0 c) (m (x0 c)) (x1 c)) encIn Turing.MultiTapeTM.encBits T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO (fun (c : γ) => (Turing.MultiTapeTM.encBitString (m (x0 c))) (x2 c)) encIn Turing.MultiTapeTM.encBits T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { level := x0 x, inputs := x1 x, outputs := x2 x }) encIn (encInput m) (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
theorem Cslib.Crypto.CorrelationRobust.encInput_level_polyTime (m : ℕ → ℕ) {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {g✝ : γ✝ → Input m} :

The encoding of a distinguisher's input: the unary level, the word of the inputs (inputsWord) and the word of the output bits (encBitString), each framed except the last.

@[reducible, inline]

The tuple of the fields of encInput.

A distinguisher is PPT when one uniform strict PPT machine reads encInput m and writes the test's bit.

Correlation robustness of a hash on words ([IKNP03], Definition 1, §5, p. 157): the hash is evaluated in polynomial time, and for every polynomially bounded query count m and at every level k, no uniform strict PPT distinguisher tells the inputs t with the bits hash (t j + s), for a uniform k-bit s, from t with uniform bits, except with negligible advantage. The distinguishers are uniform and the negligible function may depend on m; Definition 1 implies the security condition (module documentation).