Documentation

CslibFrontier.Crypto.Computational.OneWay.IterateCounterexample

A one-way function whose iterates are not one-way #

If one-way functions exist, then some one-way function f has iterates x ↦ f^[k |x|] x that are not one-way, for every count k with k n ≥ 2 for all large n ([AB07], Chapter 10, Exercise 4). In particular this holds for k n = ⌈n ^ c⌉ with any real c > 0. By contrast, iterating a one-way permutation by an efficiently computable count that is eventually positive gives a one-way permutation; a count of zero gives the identity.

The construction starts from a one-way function g whose output length depends only on the input length (OneWay.exists_fixedOutputLength). Call a word low-zero when its first ⌊|w| / 2⌋ bits are all false. Then

Both branches have length |x| + 2 |g x| + 1, so f has a single output length m n at each input length n, as in the family of Definition 10.1. Every image of f is low-zero, so f (f x) is the all-zero word whose length depends only on |x|. All inputs of one length therefore share their second image, and every later iterate. The inverter for any iterate with at least two steps simply answers 0^n. Inverting f itself still means inverting g, except on low-zero inputs, which have probability at most 2^-(n / 2). The marker bit 1 makes the challenge determine g x.

Main definitions #

Main results #

References #

A word is low-zero when its first ⌊|w| / 2⌋ bits are all false.

The marked image of a value w at input length n: n + |w| zeros, a true marker, then w.

The one-way function whose iterates collapse: on a low-zero input x, the all-zero word of the marked image's length |x| + 2 |g x| + 1; otherwise the marked image of g x.

Both branches of collapse g have length |x| + 2 |g x| + 1. With g of fixed output length, collapse g therefore has fixed output length too.

theorem Cslib.Crypto.IterateCounterexample.iterate_collapse_eq {g : List Bool → List Bool} {length : ℕ → ℕ} (hlen : ∀ (input : List Bool), (g input).length = length input.length) (j : ℕ) {x y : List Bool} (hxy : x.length = y.length) :
(collapse g)^[j + 2] x = (collapse g)^[j + 2] y

Second images coincide. If g has fixed output length, then at least two steps of collapse g send all inputs of the same length to the same word.

theorem Cslib.Crypto.IterateCounterexample.not_oneWay_iterate_collapse {g : List Bool → List Bool} {length : ℕ → ℕ} (hlen : ∀ (input : List Bool), (g input).length = length input.length) {k : ℕ → ℕ} (hk : ∀ᶠ (n : ℕ) in Filter.atTop, 2 ≤ k n) :
¬OneWay fun (x : List Bool) => (collapse g)^[k x.length] x

Iterates of collapse g are not one-way. For g of fixed output length and a count k with k n ≥ 2 for all large n, the constant inverter answering 0^n inverts x ↦ (collapse g)^[k |x|] x with probability one at every such length.

The inverter for g built from an inverter for collapse g: mark the challenge.

Inverting collapse g succeeds at most as often as inverting g with the marked challenge, plus the probability 2^-(n / 2) of a low-zero input.

collapse g is one-way when g is one-way.

Iterates of one-way functions need not be one-way ([AB07], Chapter 10, Exercise 4). If a one-way function exists, then some one-way function f has a single output length m n for all inputs of length n (with m polynomial-time in unary), as in the family of Definition 10.1, and x ↦ f^[k |x|] x is not one-way for every count k with k n ≥ 2 for all large n.

The exercise's counts ([AB07], Chapter 10, Exercise 4): if a one-way function exists, then some one-way function f with polynomial-time fixed output length has x ↦ f^[⌈|x| ^ c⌉] x not one-way for every real c > 0.