Length-preserving one-way functions #
If one-way functions exist, then length-preserving one-way functions exist
Goldreich, Exercise 7.1: some one-way function f' has |f'(x)| = |x| for
every x (Cslib.Crypto.OneWay.exists_lengthPreserving).
The construction follows the guideline of the exercise. Normalize the output length of a one-way
function g to L(|x|) (Cslib.Crypto.OneWay.exists_fixedOutputLength), and choose the
input-length schedule m(n) = 4 n + 2 L(n) + 3. On an input z, let n be the greatest parameter
with m(n) ≤ |z| and evaluate g on the n-bit prefix of z, pairing the image with n
(Cslib.Crypto.OneWayReindex.reindex). The result has 2 n + 1 + L(n) bits, so its
self-delimiting padding fits into |z| bits (Cslib.Crypto.OneWayLengthPreserving.fit). The
guideline pads f(x) by 0 1 ^ (|z| - |f(x)| - 1) and inverts the schedule n ↦ p(n); here the
padding is the library's self-delimiting padWord, and the image also records n, so that images
of different parameters are disjoint and the reindexing reduction of
Cslib.Crypto.OneWayReindex.oneWay applies to any polynomial-time schedule.
Main definitions #
Cslib.Crypto.OneWayLengthPreserving.fit: the firstkbits of the self-delimiting padding.Cslib.Crypto.OneWayLengthPreserving.lengthPreserving: the length-preserving function built from a function with output lengthL(|x|).
Main results #
Cslib.Crypto.OneWayLengthPreserving.inversion_le: an inverter for the length-preserving function yields an inverter for the reindexed function at every lengthM ≥ m(0).Cslib.Crypto.OneWayLengthPreserving.oneWay: the construction is one-way.Cslib.Crypto.OneWay.exists_lengthPreserving: Goldreich, Exercise 7.1.
References #
- O. Goldreich, Computational Complexity: A Conceptual Perspective, draft
r4.pdfof March 2007, Exercise 7.1 (printed page 305, PDF page 41).
Fitting a word into a fixed number of bits #
The first k bits of the self-delimiting padding of word (Cslib.BitString.padWord). A word
with 2 |word| + 1 ≤ k can be read back from the result (word_eq_of_fit_eq).
The construction #
From length m(0) on, the reindexed image fits: twice its length plus one is at most the
input length.
Inversion reduction. At every length M ≥ m(0), an inverter for the length-preserving
function inverts the reindexed function at least as well once its challenge is fitted into M
bits: a successful candidate has length M, and fitting is injective on the images that occur.
The length-preserving construction is one-way. If g is one-way with output length
L(|x|), computable in unary polynomial time, then lengthPreserving g L is one-way.
Goldreich, Exercise 7.1: if one-way functions exist, then
length-preserving one-way functions exist. From any one-way function f we obtain a one-way
function f' with |f'(x)| = |x| for every x. One-wayness is Cslib.Crypto.OneWay: polynomial
time evaluation, and negligible inversion probability against uniform strict PPT inverters.