One-way functions and permutations #
A polynomial-time function on binary words is one-way when, given its value on a uniform
n-bit input and the unary parameter n, every uniform PPT inverter has negligible probability
of finding any preimage. Recovering the sampled input is not required, and the inverter's
answer is not restricted to the sampled input's length.
OneWayPermutation additionally requires a length-preserving bijection. Its inverse exists as a
mathematical function; no efficiency of that inverse is assumed. Such a permutation preserves
the uniform distribution at every input length. These are definitions, not assertions that
one-way functions or permutations exist.
OneWayOn f valid is one-wayness on a declared domain, as in [BS23], Definition 8.6,
where the inverter must output a preimage in the message space: an answer x' wins only when
valid n x'. With valid n w = decide (w.length = n) it is Definition 8.6 on M = {0,1}ⁿ.
OneWay is the case valid := fun _ _ => true (oneWayOn_true_iff), so it implies OneWayOn on
every domain (OneWay.oneWayOn); for an injective function the two agree
(OneWayOn.oneWay_of_injective).
Main definitions #
Cslib.Crypto.inversionGame: the inversion experiment on uniformn-bit inputs.Cslib.Crypto.OneWay,Cslib.Crypto.OneWayPermutation: uniform computational assumptions.Cslib.Crypto.inversionGameOn,Cslib.Crypto.OneWayOn: the inversion game and one-wayness with answers restricted to a declared domain.
Main results #
Cslib.Crypto.isPPT_inversionGame: the inversion experiment is uniformly strict PPT.Cslib.Crypto.OneWay.inversion_negligible: negligible success for each efficient inverter.Cslib.Crypto.OneWayPermutation.uniformList_append_bit: the ideal one-bit extension is uniform.Cslib.Crypto.not_oneWay_of_le_succProbability: inverting with probability bounded away from zero at every length refutes one-wayness.Cslib.Crypto.not_oneWay_of_inverse,not_oneWay_const: efficient preimages refute one-wayness.Cslib.Crypto.oneWayOn_true_iff,Cslib.Crypto.OneWay.oneWayOn,Cslib.Crypto.OneWayOn.oneWay_of_injective: howOneWayOnrelates toOneWay.
References #
- S. Arora, B. Barak, Computational Complexity: A Modern Approach, Section 9.2.
- D. Boneh and V. Shoup, A Graduate Course in Applied Cryptography, Section 8.11.1, Definition 8.6, p. 336.
Adapted from Crypto/Computational/OneWay.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8, using finite fair-bit programs, tidy deterministic
certificates and the upstream nonnegative game API.
An inverter receives the unary parameter and the image of the sampled input.
Run the complete inversion experiment on its unary parameter.
The inversion experiment is uniformly PPT, independently of the unused auxiliary input.
One plain polynomial-time algorithm evaluates the function. Every uniform strict PPT inverter has negligible success over the uniform input and its own independent random coins.
This is strong one-wayness, [Gol98], Definition 2.2.1, p. 29: the inverter
receives f x for a uniform n-bit x together with n in unary, and succeeds when it outputs
any preimage of f x, of any length.
- polyTime : Turing.MultiTapeTM.ComputableInPolyTime f Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits
A deterministic polynomial-time algorithm evaluates the function.
- secure : Game.Indistinguishable (fun (adversary : Inverter) (n : ℕ) => (inversionGame f adversary n).eval) (fun (x : Inverter) (x_1 : ℕ) => PMF.pure false) (Probability.IsPPT Turing.MultiTapeTM.encBits)
Inversion is indistinguishable from certain failure in the common game calculus.
The shared game definition gives the usual negligible inversion probability.
Establish one-wayness by bounding every efficient inverter's success probability.
A length-preserving permutation that is one-way against every uniform PPT inverter: a
length-preserving one-to-one function that is OneWay, which is how [Gol98],
Section 3.4.1, p. 91, describes one-way permutations. Being one-to-one and length-preserving, such
a function permutes the words of each length, so bijective adds nothing to injectivity.
- oneWay : OneWay f
Evaluation is polynomial time, and inversion has negligible success.
The permutation acts separately on words of each length.
- bijective : Function.Bijective f
Every word has exactly one preimage; finding it need not be efficient.
A one-way permutation preserves the uniform distribution at each input length.
A permuted uniform seed followed by an independent fair bit is exactly uniform at the expanded length. Security is needed when replacing the independent bit by a hard-core predicate.
For an injective function, accepting any preimage is equivalent to recovering the sampled input. The general inversion experiment does not make this assumption.
Inverting with probability bounded away from zero refutes one-wayness: an efficient
inverter whose success probability is at least a fixed c > 0 at every length.
Efficiently finding any preimage, told the input length, contradicts one-wayness.
One-wayness on a declared domain #
The inversion game on a declared domain at length n ([BS23], Section 8.11.1,
Definition 8.6, p. 336): draw x ← BitString.sampleList n, give the inverter n and f x, and
accept its answer x' when valid n x' and f x' = f x. With valid n w = decide (w.length = n)
this is the one-wayness game of Definition 8.6 on M = {0,1}ⁿ.
One plain polynomial-time algorithm evaluates the function, and every uniform strict PPT
inverter has negligible success in inversionGameOn f valid over the uniform n-bit input and its
own independent random coins.
This is one-wayness as [BS23], Section 8.11.1, Definition 8.6, p. 336, defines it: the
challenger sends t := H(m) for a random m ∈ M, and the adversary wins by outputting m' ∈ M
with H(m') = t. The inverter also receives n in unary. With
valid n w = decide (w.length = n) this is Definition 8.6 on M = {0,1}ⁿ; a wider valid
accepts more answers and gives a stronger assumption. OneWay, after Goldreich, accepts a
preimage of any length: it is OneWayOn f (fun _ _ => true) (oneWayOn_true_iff).
- polyTime : Turing.MultiTapeTM.ComputableInPolyTime f Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits
A deterministic polynomial-time algorithm evaluates the function.
- secure : Game.Indistinguishable (fun (adversary : Inverter) (n : ℕ) => (inversionGameOn f valid adversary n).eval) (fun (x : Inverter) (x_1 : ℕ) => PMF.pure false) (Probability.IsPPT Turing.MultiTapeTM.encBits)
Inversion within the domain is indistinguishable from certain failure in the common game calculus.
One-wayness on valid gives every uniform strict PPT inverter negligible success in
inversionGameOn f valid.
Establish one-wayness on valid by bounding every efficient inverter's success
probability.
Compare two domain games for the same inverter when every answer that wins the first, a
preimage of an n-bit input, is also accepted by the second domain.
For an injective function the only preimage of f x is x, so one-wayness on a domain that
contains every n-bit word is OneWay.