Documentation

CslibFrontier.Crypto.Computational.InaccessibleEntropy.OneWay

Inaccessible average max-entropy from any one-way function #

Given any uniform OneWay function f, output-length normalization (OneWay.exists_fixedOutputLength) produces a one-way function g sending n-bit inputs to m(n)-bit outputs. Following [HHRVW2020], Section 4.2, Theorem 4.5 (pp. 21–25), we combine g with the constructible 3-wise independent Boolean affine hash family affineHash on m(n)-bit strings (isThreeWiseIndependentHash_affineHash) and a dyadic (Nat.log 2 n + 1)-bit prefix index r truncated at min r n: $$F_0(x, A, b, r) = \bigl(A, b, r, \mathrm{zeroPadPrefix}\;n\;r\;(A\,g(x) + b)\bigr).$$

Parameterizing the light-sibling set by a polynomial threshold exponent c : ℕ, $$\widetilde{L}_c(y_0, r) = \{y_0\} \cup \{y \mid 4 (n + 1)^c |g^{-1}(y)| \le 2^{n - \min(r, n)}\},$$ establishes [HHRVW2020], Theorem 4.5 against uniform strict-PPT adversaries (with an adversary-independent accessible-set family for each c, stronger than Definition 3.9's adversary-dependent quantifier):

  1. Claim 4.6 (rompelBase_escape_le_mul_inversion, pp. 21–22): sampling a prefix-colliding affine seed via adjustAffineSeed (toReal_map_adjustAffineSeed_eq) turns any adversary A into a uniform strict-PPT g-inverter (rompelBaseInverter) whose inversion success is at least 1 / (4 * (n + 1) ^ c) of A's escape probability outside L_{0, c}.
  2. Claim 4.8 (rompelBase_heavy_sibling_prob_ge, p. 23): for gFin x ≠ gFin x* with |gFin⁻¹(gFin x)| ≤ |gFin⁻¹(gFin x*)| ≤ 2^(n - r), 3-wise independence and Markov's inequality show that uniform resampling from F₀⁻¹(F₀(x, s, r)) hits (x*, s, r) with probability at least 2^(-n) / 8.
  3. Claim 4.7 (rompelBase_accessible_le_conditionalEntropy_sub, pp. 21, 23–25): Markov's inequality on collisionProbability bounds heavy fibers |gFin⁻¹(gFin x*)| ≥ 2^(n - c⌊log₂ n⌋), and for every remaining distinct-image pair with |gFin⁻¹(gFin x)| ≤ |gFin⁻¹(gFin x*)|, all c * Nat.log 2 n + 1 truncation lengths r_j = n - (Nat.log 2 |gFin⁻¹(gFin x*)| + 1 + j) simultaneously satisfy Claim 4.8 and exclude gFin x* from rompelLightImages c, yielding a gap of at least (c * Nat.log 2 n + 1) / (64 * (n + 1)) (recovering 1 / (64 * (n + 1)) at c = 0).
  4. Theorem 4.5 (OneWay.rompelBase_logGap, p. 21): for a OneWay function g with fixed output length m(n), the single uniform polynomial-time function family rompelBaseEvalWord g outLen achieves an eventual d * Real.logb 2 n / n entropy gap for every constant d > 0. OneWay.rompelFamily packages each threshold exponent c as an InaccessibleEntropyFamily with integer denominator rompelGapDenom c n = 64 * (n + 1) / (c * Nat.log 2 n + 1) + 1. OneWay.exists_rompelBase_logGap and OneWay.exists_inaccessibleEntropyFamily apply this to an arbitrary OneWay function, after normalizing its output length.

F₀ differs from the source's $F(x, g, i) = (g(f(x))_{1, \dots, i}, g, i)$ on $\{0,1\}^n \times G \times [n]$ in three ways:

Main definitions #

Main results #

References #

Bit-width schedule and structured input/output views #

Bit width $\lfloor \log_2 n \rfloor + 1$ of the truncation-length field in $F_0$, large enough to represent every $r \in \{0, \dots, n\}$ injectively (n < 2 ^ rompelTruncWidth n).

Affine seed bit width $n m + n$ for hashing $m$-bit images to $n$-bit digests.

Total input bit width $n + (n m + n) + (\lfloor \log_2 n \rfloor + 1)$ of $F_0$.

Total output bit width $(n m + n) + (\lfloor \log_2 n \rfloor + 1) + n$ of $F_0$.

Integer entropy-gap denominator $\lfloor 64 (n + 1) / (c \lfloor \log_2 n \rfloor + 1) \rfloor + 1$ at polynomial light-image threshold exponent c.

Structured input (preimage, hashRows, hashShift, truncBits) to [HHRVW2020]'s base function $F_0$ (Section 4.2, Theorem 4.5, p. 21).

  • preimage : BitString n

    Uniform n-bit input $x$ to the normalized one-way function $g$.

  • hashRows : Fin n → BitString m

    Matrix rows of the Boolean affine hash BitString m → BitString n.

  • hashShift : BitString n

    Shift vector of the Boolean affine hash $h_{A, b}$.

  • truncBits : BitString (rompelTruncWidth n)

    (Nat.log 2 n + 1)-bit word encoding the saturating prefix length $r \le n$.

Instances For
    @[instance_reducible]
    def Cslib.Crypto.instDecidableEqRompelBaseInput.decEq {n✝ m✝ : ℕ} (x✝ x✝¹ : RompelBaseInput n✝ m✝) :
    Decidable (x✝ = x✝¹)
    @[instance_reducible]

    Saturating prefix length $r = \min(n, \mathrm{binaryValue}(\mathrm{truncBits})) \le n$.

    Pack a RompelBaseInput n m into a word of length rompelBaseInLen n m.

    Exact bit-string equivalence between RompelBaseInput n m and BitString (rompelBaseInLen n m).

    Structured output (hashRows, hashShift, truncBits, prefixDigest) of [HHRVW2020]'s base function $F_0$ (Section 4.2, Theorem 4.5, p. 21).

    • hashRows : Fin n → BitString m

      Matrix rows of the Boolean affine hash $h_{A, b}$.

    • hashShift : BitString n

      Shift vector of the Boolean affine hash $h_{A, b}$.

    • truncBits : BitString (rompelTruncWidth n)

      (Nat.log 2 n + 1)-bit word encoding the saturating prefix length $r$.

    • prefixDigest : BitString n

      Zero-padded r-bit prefix of $h_{A, b}(g(x))$.

    Instances For
      def Cslib.Crypto.instDecidableEqRompelBaseOutput.decEq {n✝ m✝ : ℕ} (x✝ x✝¹ : RompelBaseOutput n✝ m✝) :
      Decidable (x✝ = x✝¹)
      @[instance_reducible]
      @[instance_reducible]

      Exact bit-string equivalence between RompelBaseOutput n m and BitString (rompelBaseOutLen n m).

      Finite and word-level evaluators of $F_0$ #

      Finite evaluator $F_0(x, A, b, r) = (A, b, r, \mathrm{zeroPadPrefix}\;n\;r\;(A\,g(x) + b))$ ([HHRVW2020], Section 4.2, Theorem 4.5, p. 21).

      def Cslib.Crypto.rompelBaseEvalWord (g : List Bool → List Bool) (outLen : ℕ → ℕ) (n : ℕ) (zWord : List Bool) :

      Word-level evaluator of [HHRVW2020]'s base function $F_0$ (Section 4.2, Theorem 4.5, p. 21).

      @[simp]
      theorem Cslib.Crypto.length_rompelBaseEvalWord (g : List Bool → List Bool) (outLen : ℕ → ℕ) (n : ℕ) (zWord : List Bool) :
      (rompelBaseEvalWord g outLen n zWord).length = rompelBaseOutLen n (outLen n)
      theorem Cslib.Crypto.rompelBaseEvalWord_packWord (g : List Bool → List Bool) (outLen : ℕ → ℕ) (n : ℕ) (z : RompelBaseInput n (outLen n)) :

      On packed inputs, rompelBaseEvalWord computes rompelBaseHashFin exactly.

      theorem Cslib.Crypto.wordToFinMap_rompelBaseEvalWord (g : List Bool → List Bool) (outLen : ℕ → ℕ) (n : ℕ) (z : RompelBaseInput n (outLen n)) :
      wordToFinMap (rompelBaseInLen n (outLen n)) (rompelBaseOutLen n (outLen n)) (rompelBaseEvalWord g outLen n) ((rompelBaseInputEquiv n (outLen n)) z) = (rompelBaseOutputEquiv n (outLen n)) (rompelBaseHashFin (wordToFinMap n (outLen n) g) z)

      Accessible preimage sets $L_{0, c}$ and the OWF inverter reduction (Claim 4.6) #

      def Cslib.Crypto.rompelLightImages {n m : ℕ} (c : ℕ) (gFin : BitString n → BitString m) (y₀ : BitString m) (r : ℕ) :

      Light sibling images $\widetilde{L}_c(y_0, r) = \{y_0\} \cup \{y \mid 4 (n + 1)^c |g^{-1}(y)| \le 2^{n - \min(r, n)}\}$ with polynomial threshold exponent c ([HHRVW2020], Section 4.2, Theorem 4.5, p. 21; setting c = 0 recovers the constant threshold $2^{n - \min(r, n)} / 4$).

      theorem Cslib.Crypto.self_mem_rompelLightImages {n m : ℕ} (c : ℕ) (gFin : BitString n → BitString m) (y₀ : BitString m) (r : ℕ) :
      y₀ ∈ rompelLightImages c gFin y₀ r

      Accessible preimage set $L_{0, c}(z) = \{z' \in F_0^{-1}(F_0(z)) \mid g(x') \in \widetilde{L}_c(g(x), r)\}$ on RompelBaseInput n m ([HHRVW2020], Section 4.2, Theorem 4.5, p. 21).

      def Cslib.Crypto.rompelAccessibleSet (c : ℕ) (g : List Bool → List Bool) (outLen : ℕ → ℕ) (n : ℕ) (b : BitString (rompelBaseInLen n (outLen n))) :

      Accessible preimage set $L_{0, c}$ transported to BitString (rompelBaseInLen n (outLen n)).

      theorem Cslib.Crypto.self_mem_rompelAccessibleSet (c : ℕ) (g : List Bool → List Bool) (outLen : ℕ → ℕ) (n : ℕ) (b : BitString (rompelBaseInLen n (outLen n))) :
      b ∈ rompelAccessibleSet c g outLen n b
      theorem Cslib.Crypto.rompelAccessibleSet_subset_fiber (c : ℕ) (g : List Bool → List Bool) (outLen : ℕ → ℕ) (n : ℕ) (b : BitString (rompelBaseInLen n (outLen n))) :
      rompelAccessibleSet c g outLen n b ⊆ fiberSet (wordToFinMap (rompelBaseInLen n (outLen n)) (rompelBaseOutLen n (outLen n)) (rompelBaseEvalWord g outLen n)) (wordToFinMap (rompelBaseInLen n (outLen n)) (rompelBaseOutLen n (outLen n)) (rompelBaseEvalWord g outLen n) b)
      noncomputable def Cslib.Crypto.rompelBaseInverter (g : List Bool → List Bool) (outLen : ℕ → ℕ) (A : ℕ → List Bool → ProbComp (List Bool)) (n : ℕ) (y : List Bool) :

      Uniform strict-PPT inverter reduction ([HHRVW2020], Section 4.2, Claim 4.6, pp. 21–22): on challenge image y, sample uniform x and rBits, sample a prefix-colliding affine seed via wordAdjustAffineSeed, run A on x ++ seed ++ rBits, and output the n-bit prefix.

      theorem Cslib.Crypto.rompelBase_escape_le_mul_inversion (c : ℕ) (g : List Bool → List Bool) (outLen : ℕ → ℕ) (A : ℕ → List Bool → ProbComp (List Bool)) (n : ℕ) (hlen : ∀ (w : List Bool), w.length = n → (g w).length = outLen n) :
      ↑(Game.succProbability (accessibleEscapeGame (rompelBaseEvalWord g outLen) (fun (k : ℕ) => rompelBaseInLen k (outLen k)) (rompelAccessibleSet c g outLen) A n).eval) ≤ 4 * (↑n + 1) ^ c * ↑(Game.succProbability (inversionGame g (rompelBaseInverter g outLen A) n).eval)

      [HHRVW2020], Section 4.2, Claim 4.6 (pp. 21–22): for any fixed-output-length function g ((g w).length = outLen n on n-bit inputs), any polynomial light-image threshold exponent c, and any adversary A, escaping rompelAccessibleSet c with a fixed-width colliding preimage occurs with probability at most 4 * (n + 1) ^ c times the inversion success of rompelBaseInverter g outLen A.

      Sibling isolation via 3-wise independence (Claim 4.8) and the entropy gap (Claim 4.7) #

      theorem Cslib.Crypto.rompelBase_heavy_sibling_prob_ge {n m : ℕ} (gFin : BitString n → BitString m) {x xStar : BitString n} {rBits : BitString (rompelTruncWidth n)} (hne : gFin x ≠ gFin xStar) (hfib_le : (fiberSet gFin (gFin x)).card ≤ (fiberSet gFin (gFin xStar)).card) (hstar_le : (fiberSet gFin (gFin xStar)).card ≤ 2 ^ (n - BitString.boundedBinaryValue n (List.ofFn rBits))) :
      (2 ^ n)⁻¹ / 8 ≤ ∑ s : (Fin n → BitString m) × BitString n, ((Probability.PMF.uniformOfFintype ((Fin n → BitString m) × BitString n)) s).toReal * ((if { preimage := xStar, hashRows := s.1, hashShift := s.2, truncBits := rBits } ∈ fiberSet (rompelBaseHashFin gFin) (rompelBaseHashFin gFin { preimage := x, hashRows := s.1, hashShift := s.2, truncBits := rBits }) then 1 else 0) / ↑(fiberSet (rompelBaseHashFin gFin) (rompelBaseHashFin gFin { preimage := x, hashRows := s.1, hashShift := s.2, truncBits := rBits })).card)

      [HHRVW2020], Section 4.2, Claim 4.8 (p. 23): for distinct images gFin x ≠ gFin xStar with #(fiberSet gFin (gFin x)) ≤ #(fiberSet gFin (gFin xStar)) ≤ 2 ^ (n - r) (r ≤ n), uniformly sampling an affine seed s and then a uniform preimage from the F₀-fiber of (x, s, rBits) (at truncation index r) yields (xStar, s, rBits) with probability at least ((2 : ℝ) ^ n)⁻¹ / 8.

      [HHRVW2020], Section 4.2, Claim 4.7 (pp. 21, 23–25): unconditional finite-n lower bound on the entropy gap between PMF.conditionalEntropy of rompelBaseHashFin gFin and accessibleSetExpectation (rompelAccessibleInputSet c gFin).

      theorem Cslib.Crypto.rompelBase_accessible_le_conditionalEntropy_sub (c : ℕ) (g : List Bool → List Bool) (outLen : ℕ → ℕ) (n : ℕ) (ht : c * Nat.log 2 n ≤ n) (hlen : ∀ (w : List Bool), w.length = n → (g w).length = outLen n) (hcoll : (4 * 2 ^ (c * Nat.log 2 n) - 3) * Probability.PMF.collisionProbability (PMF.map g (BitString.uniformList n)) ≤ 1 / 2) :
      accessibleSetExpectation (rompelAccessibleSet c g outLen n) ≤ Probability.PMF.conditionalEntropy (PMF.map (fun (b : BitString (rompelBaseInLen n (outLen n))) => (wordToFinMap (rompelBaseInLen n (outLen n)) (rompelBaseOutLen n (outLen n)) (rompelBaseEvalWord g outLen n) b, b)) (Probability.PMF.uniformOfFintype (BitString (rompelBaseInLen n (outLen n))))) - (↑c * ↑(Nat.log 2 n) + 1) / (64 * (↑n + 1))

      Bit-string transport of rompelBase_accessibleInput_le_conditionalEntropy_sub ([HHRVW2020], Section 4.2, Claim 4.7, pp. 21, 23–25): when c * Nat.log 2 n ≤ n and the weighted output collision probability (4 * 2 ^ (c * Nat.log 2 n) - 3) * collisionProbability of g on n-bit inputs is at most 1 / 2, the entropy gap on BitString (rompelBaseInLen n (outLen n)) is at least (c * Nat.log 2 n + 1) / (64 * (n + 1)).

      Theorem 4.5: logarithmic entropy gap from any one-way function #

      theorem Cslib.Crypto.inv_rompelGapDenom_le (c n : ℕ) :
      1 / ↑(rompelGapDenom c n) ≤ (↑c * ↑(Nat.log 2 n) + 1) / (64 * (↑n + 1))
      theorem Cslib.Crypto.logGap_le_inv_rompelGapDenom {d : ℝ} (hd : 0 < d) {c n : ℕ} (hc : 256 * d ≤ ↑c) (hn : 2 ≤ n) (ht : c * Nat.log 2 n ≤ n) :
      d * Real.logb 2 ↑n / ↑n ≤ 1 / ↑(rompelGapDenom c n)

      Construct an InaccessibleEntropyFamily at polynomial light-image threshold exponent c from any fixed-output-length OneWay function g. Note that inLen, outLen, and evalWord are independent of c.

      theorem Cslib.Crypto.OneWay.rompelBase_logGap {g : List Bool → List Bool} {outLen : ℕ → ℕ} (hg : OneWay g) (hlen : ∀ (w : List Bool), (g w).length = outLen w.length) (houtLen : Turing.MultiTapeTM.ComputableInPolyTime outLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary) {d : ℝ} (hd : 0 < d) :
      have c := ⌈256 * d⌉₊ + 1; (∃ (N₀ : ℕ), ∀ (n : ℕ), N₀ ≤ n → accessibleSetExpectation (rompelAccessibleSet c g outLen n) ≤ Probability.PMF.conditionalEntropy (PMF.map (fun (b : BitString (rompelBaseInLen n (outLen n))) => (wordToFinMap (rompelBaseInLen n (outLen n)) (rompelBaseOutLen n (outLen n)) (rompelBaseEvalWord g outLen n) b, b)) (Probability.PMF.uniformOfFintype (BitString (rompelBaseInLen n (outLen n))))) - d * Real.logb 2 ↑n / ↑n) ∧ ∀ (A : ℕ → List Bool → ProbComp (List Bool)), Probability.IsPPT Turing.MultiTapeTM.encBits A → Negligible fun (n : ℕ) => Game.succProbability (accessibleEscapeGame (rompelBaseEvalWord g outLen) (fun (k : ℕ) => rompelBaseInLen k (outLen k)) (rompelAccessibleSet c g outLen) A n).eval

      [HHRVW2020], Section 4.2, Theorem 4.5 (p. 21) for the concrete family rompelBaseEvalWord g outLen. Take a uniform OneWay function g with output length outLen n on n-bit inputs, a constant d > 0, and the light-image threshold exponent c = Nat.ceil (256 * d) + 1. The accessible-set family rompelAccessibleSet c g outLen then has average max-entropy eventually at most conditionalEntropy - d * Real.logb 2 n / n, and every uniform strict-PPT adversary escapes it with negligible probability.

      The function differs from the source's $F(x, g, i) = (g(f(x))_{1, \dots, i}, g, i)$ in three ways:

      • The hash is the affine family affineHash with an n * outLen n + n-bit seed, so the input width is rompelBaseInLen n (outLen n) = n + (n * outLen n + n) + (Nat.log 2 n + 1). The source instead gets an O(n) width, using a family with O(n)-bit descriptions (Theorem 5.2, p. 26).
      • The prefix length is min r n for a uniform (Nat.log 2 n + 1)-bit r, instead of uniform i ∈ [n].
      • g has a fixed output length outLen n rather than being length-preserving.
      theorem Cslib.Crypto.OneWay.exists_rompelBase_logGap {f : List Bool → List Bool} (hf : OneWay f) :
      ∃ (inLen : ℕ → ℕ) (outLen : ℕ → ℕ) (evalWord : ℕ → List Bool → List Bool), Turing.MultiTapeTM.ComputableInPolyTime inLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary ∧ Turing.MultiTapeTM.ComputableInPolyTime outLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary ∧ Turing.MultiTapeTM.ComputableInPolyTime (fun (p : ℕ × List Bool) => evalWord p.1 p.2) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits ∧ (∀ (n : ℕ) (z : List Bool), z.length = inLen n → (evalWord n z).length = outLen n) ∧ ∀ (d : ℝ), 0 < d → ∃ (accSet : (n : ℕ) → BitString (inLen n) → Finset (BitString (inLen n))), (∀ (n : ℕ) (z : BitString (inLen n)), z ∈ accSet n z) ∧ (∀ (n : ℕ) (z : BitString (inLen n)), accSet n z ⊆ fiberSet (wordToFinMap (inLen n) (outLen n) (evalWord n)) (wordToFinMap (inLen n) (outLen n) (evalWord n) z)) ∧ (∃ (N₀ : ℕ), ∀ (n : ℕ), N₀ ≤ n → accessibleSetExpectation (accSet n) ≤ Probability.PMF.conditionalEntropy (PMF.map (fun (z : BitString (inLen n)) => (wordToFinMap (inLen n) (outLen n) (evalWord n) z, z)) (Probability.PMF.uniformOfFintype (BitString (inLen n)))) - d * Real.logb 2 ↑n / ↑n) ∧ ∀ (A : ℕ → List Bool → ProbComp (List Bool)), Probability.IsPPT Turing.MultiTapeTM.encBits A → Negligible fun (n : ℕ) => Game.succProbability (accessibleEscapeGame evalWord inLen accSet A n).eval

      OneWay.rompelBase_logGap applied to an arbitrary uniform OneWay function f, after OneWay.exists_fixedOutputLength normalizes its output length. The result is a single uniform polynomial-time fixed-width function family (inLen, outLen, evalWord). For every constant d > 0, it has a family of fiber-contained accessible preimage sets with an eventual d * Real.logb 2 n / n entropy gap against all uniform strict-PPT adversaries.

      The conclusion does not bound the input width inLen n, so its gap, stated in the security parameter n, is not the quantitative content of Theorem 4.5. That content is OneWay.rompelBase_logGap, whose statement names the width n + (n * m(n) + n) + (Nat.log 2 n + 1) for the normalized output length m(n). That length is internal to OneWay.exists_fixedOutputLength, so this statement cannot name the width.

      Every uniform OneWay function yields a uniform polynomial-time InaccessibleEntropyFamily: OneWay.rompelFamily for its fixed-output-length normalization.