Naor's bit commitment scheme from pseudorandom generators #
Naor's statistically binding, computationally hiding bit commitment scheme [Nao91] commits to a
bit b : Bool under a receiver string r : List Bool and a uniform seed seed : List Bool of
length n using a pseudorandom generator generator:
naorCommit generator r b seed outputs generator seed when b = false, and
BitString.listXor (generator seed).length [generator seed, r] when b = true.
The general public-parameter interface is in Commitment/Basic. For the uniform single-bit
guessing and binding theorem and the auxiliary-input prediction comparison, see
Commitment/Guessing.
Main definitions #
Cslib.Crypto.naorCommit: commit to a single bit using a generator, receiver string, and seed.Cslib.Crypto.naorCommitEnsemble: the commitment distribution for a family of receiver strings and bits.Cslib.Crypto.CommitmentReceiver,Cslib.Crypto.CommitmentReceiver.IsPPT: a two-stage randomized stateful PPT receiver that outputs((r, (b₀, b₁)), state)in the first stage and distinguishes(state, c)in the second stage.Cslib.Crypto.commitmentHidingGame,Cslib.Crypto.GenerableStatefulHiding,Cslib.Crypto.StatefulHiding: the two-stage commitment hiding game and computational hiding against randomized stateful PPT receivers, separating deterministic polynomial-time auxiliary input (GenerableStatefulHiding) from arbitrary polynomially bounded auxiliary input (StatefulHiding).Cslib.Crypto.naorReceiverDistinguisher: advised PRG distinguisher induced by a stateful commitment receiver.Cslib.Crypto.NaorBinding: statistical binding at seed lengthnfor receiver stringr, requiring that no two seeds of lengthnopen tofalseandtruewith the same commitment.Cslib.Crypto.naorBindingProb,Cslib.Crypto.naorBindingError: the probability over a uniform receiver stringrof lengthlength nthatNaorBinding generator n rfails.Cslib.Crypto.encBitOpening: the encoding of a bit-commitment opening(b, seed).Cslib.Crypto.GenerableBitCommitmentScheme,Cslib.Crypto.BitCommitmentScheme: two-message statistically binding, computationally hiding bit commitment schemes with poly-time-generable (GenerableStatefulHiding) or arbitrary polynomially bounded (StatefulHiding) auxiliary-input hiding.
Main results #
Cslib.Crypto.OneWay.exists_pseudorandomGenerator_three_mul: any one-way function yields a pseudorandom generator with expansionfun n => 3 * n + 1.Cslib.Crypto.uniformList_map_naorCommit_id: replacing the generator output with a uniform word of lengthmmakes the commitment distribution exactlyBitString.uniformList mfor every receiver stringrand committed bitb.Cslib.Crypto.PseudorandomGenerator.naorCommit_indistinguishable_uniform,Cslib.Crypto.PseudorandomGenerator.naorCommit_hiding: computational hiding of Naor commitments for deterministic polynomial-time families of receiver stringsr : ℕ → List Booland bit familiesb₀ b₁ : ℕ → Bool.Cslib.Crypto.StatefulHiding.generable: arbitrary polynomially bounded auxiliary-input hiding implies hiding for polynomial-time-generable auxiliary input.Cslib.Crypto.advantage_commitmentHidingGame_naorCommit_le,Cslib.Crypto.PseudorandomGenerator.naorGenerableStatefulHiding,Cslib.Crypto.NonuniformPRG.naorStatefulHiding: quantitative and asymptotic hiding of Naor commitments against randomized stateful PPT receivers (uniform/generable from a uniform PRG, and full auxiliary-input hiding from aNonuniformPRG), together withCslib.Crypto.GenerableStatefulHiding.computational_hidingandCslib.Crypto.StatefulHiding.computational_hiding.Cslib.Crypto.naorBindingProb_lt_of_three_mul,Cslib.Crypto.naorBindingProb_le_of_three_mul_add_one,Cslib.Crypto.negligible_naorBindingError: statistical binding when3 * n ≤ length n.Cslib.Crypto.PseudorandomGenerator.naorGenerableBitCommitment,Cslib.Crypto.OneWay.exists_generableBitCommitmentScheme: packaged Naor scheme withGenerableStatefulHidingfrom a uniform pseudorandom generator or one-way function.Cslib.Crypto.NonuniformPRG.naorBitCommitment,Cslib.Crypto.NonuniformOneWay.exists_bitCommitmentScheme: packaged NaorBitCommitmentSchemewith fullStatefulHidingfrom a nonuniform pseudorandom generator or one-way function.
References #
- M. Naor, Bit Commitment Using Pseudorandomness
- J. Håstad, R. Impagliazzo, L. Levin, M. Luby, A Pseudorandom Generator from Any One-Way Function
- O. Goldreich, Foundations of Cryptography: Volume 1, Basic Tools, Section 4.4.1.
- O. Goldreich, Foundations of Cryptography (Fragments of a Book – Version 2.03), 1998 draft, Section 1.3.3 (pp. 18–20, non-uniform advice vs. polynomial-size circuits) and Section 4.3.3, Definition 4.3.8 (printed pp. 151–152, unbounded auxiliary input and clocks).
Stretching a one-way function to 3 * n + 1 bits #
Naor bit commitment #
naorCommit factors through the identity generator naorCommit id r b.
Naor commitment is computable in plain polynomial time when its inputs are.
Algebraic and distributional laws #
Applying naorCommit id r b to a uniform m-bit word yields a uniform m-bit word for
every receiver string r and bit b.
Computational hiding #
For any polynomial-time receiver family r and bit family b, the Naor commitment ensemble
is computationally indistinguishable from uniform words of length length n.
Computational hiding of Naor bit commitment (deterministic-family formulation).
Commitments to any two deterministic polynomial-time bit families b₀ and b₁ under any
deterministic polynomial-time receiver string family r : ℕ → List Bool are computationally
indistinguishable against uniform strict PPT distinguishers. See
PseudorandomGenerator.naorGenerableStatefulHiding and NonuniformPRG.naorStatefulHiding below
for hiding against a randomized stateful PPT receiver.
Stateful-receiver commitment hiding #
A two-stage randomized stateful receiver for a bit commitment scheme [Naor1991, Goldreich2001].
In the first stage, choose n aux receives the unary security parameter n and auxiliary input
aux, and outputs a receiver challenge string r, two challenge bits (b₀, b₁), and an internal
state passed to the second stage. In the second stage, guess n state c receives the security
parameter n, the saved state, and the commitment c, and outputs a distinguishing bit.
First stage: output
((r, (b₀, b₁)), state).Second stage: distinguish the commitment
cusing the savedstate.
A commitment receiver is strict PPT if both stages run in polynomial time in their full encoded
inputs (charging for the auxiliary input aux in choose and for the saved state and commitment
c in guess).
- choose : Probability.IsPPT (Turing.MultiTapeTM.encPair (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBool Turing.MultiTapeTM.encBool)) Turing.MultiTapeTM.encBits) receiver.choose
The first stage is a strict PPT family from
(n, aux)to((r, (b₀, b₁)), state). - guess : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits)) Turing.MultiTapeTM.encBool fun (x : ℕ × List Bool × List Bool) => match x with | (n, state, c) => receiver.guess n state c
The second stage is strict PPT on
(n, state, c).
The two-stage commitment-hiding experiment against a stateful receiver receiver with
auxiliary input aux and hidden bit selector bit : Bool at security parameter n.
The receiver outputs ((r, (b₀, b₁)), state) ← receiver.choose n aux, the challenger samples a
uniform n-bit seed seed ← BitString.sampleList n and commits to b₁ (when bit = true) or
b₀ (when bit = false) under r, and receiver.guess n state c outputs a guess bit.
Opening (b, seed) of a bit commitment: the committed bit b, then the commitment seed as a
bit word. The bit is framed. A committer takes it after the receiver string r, as
encPair encBits encBitOpening, and a verifier after (1ⁿ, r, c).
The commitment-hiding experiment runs in strict PPT on (n, aux, bit) whenever commit is
computable in plain polynomial time and receiver is strict PPT.
For any fixed challenge selector bit, the commitment-hiding experiment is a strict PPT
indexed family on (n, aux).
For any polynomial-time auxiliary family aux, the commitment-hiding experiment is strict PPT
in the unary security parameter n.
Uniform stateful-receiver computational hiding with deterministic polynomial-time-generable
auxiliary input: for every deterministic polynomial-time auxiliary family aux : ℕ → List Bool
(ComputableInPolyTime aux encUnary encBits), no strict PPT CommitmentReceiver can distinguish
commitments to its first chosen bit (bit = false) from commitments to its second chosen bit
(bit = true) with non-negligible advantage.
This is the uniform restriction of the secrecy condition of [Nao91], Section 2, pp. 3–4 (of the
author's copy), for a commitment whose commit stage is the receiver's string r followed by
commit r b seed on a uniform n-bit seed, specialized from commitments to many bits to one bit.
A distinguishing advantage replaces the source's guessing probability 1/2 + 1/p(n); the two
differ by a factor of two. Because aux is restricted to deterministic polynomial-time-computable
families (which a uniform receiver could compute from 1^n itself), this notion is weaker than
StatefulHiding, which quantifies over arbitrary polynomially bounded auxiliary inputs as in
the source's auxiliary-input remark (StatefulHiding.generable). As in StatefulHiding, commit
is arbitrary here with no ComputableInPolyTime bound bundled, so CommitmentReceiver.IsPPT.guess
is clocked polynomial in n + state.length + c.length (GenerableBitCommitmentScheme bounds
c.length polynomially via polyTime_commit).
Computational hiding against a randomized stateful PPT receiver with arbitrary polynomially
bounded auxiliary input: for every family aux : ℕ → List Bool with
PolynomiallyBounded (fun n => (aux n).length) (not required to be computable), no strict PPT
CommitmentReceiver can distinguish commitments to its first chosen bit (bit = false) from
commitments to its second chosen bit (bit = true) with non-negligible advantage.
This specializes the receiver-chosen pair in [Nao91], Section 2, pp. 3–4 of the author's copy,
to two bits. The receiver sends r and receives commit r b seed on a uniform n-bit seed.
The distinguishing gap is twice the excess success probability of a uniform-bit guesser.
Both worlds use the same aux n. For the source's comparison with a predictor given only prior
information correlated with the bit, see StatefulHiding.exists_priorPredictor in
Commitment/Guessing.
Clock convention. CommitmentReceiver.IsPPT clocks receiver.choose polynomial in the length
of its full encoded input (1^n, aux n), i.e., poly(n + (aux n).length), and clocks
receiver.guess polynomial in n + state.length + c.length (commit is arbitrary here, with no
ComputableInPolyTime bound bundled; BitCommitmentScheme bounds c.length polynomially via
polyTime_commit). Restricting aux to polynomially bounded length matches the uniform PPT
with polynomial advice class corresponding to polynomial-size circuit families
([Gol98], Section 1.3.3, pp. 18–20) and ensures the receiver's first stage runs
in time polynomial in n (without it, an exponentially long aux n would grant exponential time
to brute-force every n-bit seed). By contrast, an adversary clocked in poly(n) alone with an
unbounded auxiliary input can inspect only a poly(n)-bit prefix ([Gol98],
Section 4.3.3, Definition 4.3.8, printed pp. 151–152); unlike
CslibFrontier.Crypto.Computational.ZeroKnowledge.AuxClock (IsPPTWithAux), this module does not
formalize a prefix-clock unbounded-auxiliary-input bridge.
Auxiliary-input StatefulHiding implies the restricted uniform notion
GenerableStatefulHiding: every deterministic polynomial-time-computable auxiliary family has
polynomially bounded length.
Specialization of GenerableStatefulHiding to the empty auxiliary string [].
Specialization of StatefulHiding to the empty auxiliary string [].
Package deterministic families (r, b₀, b₁) and a distinguisher D as a stateless
CommitmentReceiver.
CommitmentReceiver.ofDeterministic r b₀ b₁ D is strict PPT whenever r, b₀, b₁ are
computable in plain polynomial time and D is a strict PPT distinguisher.
Uniform stateful-receiver hiding implies the deterministic-family hiding interface: any
commitment function satisfying GenerableStatefulHiding hides commitments for all deterministic
polynomial-time families r : ℕ → List Bool and b₀ b₁ : ℕ → Bool.
Stateful-receiver hiding implies the deterministic-family hiding interface: any commitment
function satisfying StatefulHiding hides commitments for all deterministic polynomial-time
families r : ℕ → List Bool and b₀ b₁ : ℕ → Bool.
Advised PRG distinguisher induced by a stateful commitment receiver receiver and hidden bit
selector bit. On input ((n, aux), pad), it runs choice ← receiver.choose n aux, forms the
commitment naorCommit id r b_bit pad, and runs receiver.guess n state c.
naorReceiverDistinguisher receiver bit is a uniform strict PPT advised distinguisher on
encAdvisedInput whenever receiver is strict PPT.
Specializing naorReceiverDistinguisher receiver bit to a deterministic polynomial-time
auxiliary input family aux yields a strict PPT uniform distinguisher.
Running commitmentHidingGame (naorCommit generator) against receiver coincides with running
naorReceiverDistinguisher receiver bit against the PRG output generatorEnsemble generator n.
On a truly uniform m-bit pad, naorReceiverDistinguisher receiver bit ((n, aux), ·) presents
an independent uniform m-bit commitment to receiver.guess regardless of the receiver's chosen
challenge string r and bit selector bit.
Under a truly uniform m-bit pad, the false and true commitment-hiding experiments are
identically distributed for every stateful receiver receiver.
Quantitative stateful-receiver hiding bound for Naor's bit commitment scheme: the
commitment-hiding advantage of any stateful receiver receiver with auxiliary word aux at
security parameter n is bounded by the sum of the PRG distinguishing advantages of
naorReceiverDistinguisher receiver false and naorReceiverDistinguisher receiver true against
BitString.uniformList m.
Uniform stateful-receiver computational hiding of Naor bit commitment with
poly-time-generable auxiliary input (GenerableStatefulHiding only; weaker than the arbitrary
auxiliary-input notion of [Nao91], Section 2, pp. 3–4): for any uniform pseudorandom generator
generator, naorCommit generator satisfies GenerableStatefulHiding. See
NonuniformPRG.naorStatefulHiding for arbitrary polynomially bounded auxiliary input.
Step toward Naor's PRG-based bit commitment secrecy proof (after [Nao91]), not the cited
result: for any nonuniform pseudorandom generator (NonuniformPRG), naorCommit generator
satisfies StatefulHiding against randomized stateful PPT receivers given any polynomially bounded
auxiliary input family aux : ℕ → List Bool. Both games use the same advice.
For Section 2's comparison of prediction before and after commitment with a joint law on the
bit and prior information, apply StatefulHiding.exists_priorPredictor in Commitment/Guessing.
Statistical binding #
Equivalence between NaorBinding on lists of length n and on BitString n.
If a commitment opened as false with s₀ equals a commitment opened as true with s₁,
then s₀ and s₁ must open to the same bit whenever NaorBinding holds.
If NaorBinding generator n r fails, then ofList (length n) r is the XOR of two generator
outputs on n-bit seeds.
Strict binding bound for positive seed length, the single-bit binding step of
[Nao91], Section 3, Theorem 3.1(2), p. 6 of the author's copy. Each pair of equal seeds
produces the same zero shift, so the count in Claim 3.1 strictly overestimates the number
of bad challenges. The single-bit protocol combines this bound with uniform guessing security
in PseudorandomGenerator.naorCommit_guessing_and_binding in Commitment/Guessing.
When 3 * n + 1 ≤ length n, the binding failure probability is at most (1 / 2) ^ (n + 1).
When 3 * n ≤ length n, the nonnegative real binding failure probability is at most
(1 / 2) ^ n.
Statistical binding of Naor bit commitment. When 3 * n ≤ length n for all n, the
binding failure probability is negligible.
Selective-opening batch commitments #
When the unopened pad is drawn uniformly from BitString.uniformList m, the committed bit at
an unopened coordinate is information-theoretically hidden and may be replaced by
openFlag && b.
When the unopened pads are drawn independently from BitString.sampleList m, the distribution
of naorCommitSplit depends only on the masked bits naorMaskBits openFlags bits.
naorMaskBits distributes over list append when the first segments have equal length.
naorCommitSplit distributes over list append when the first segments have equal length.
naorCommitSplit depends on seeds and pads only through naorSelectPads.
When pads are drawn from generator <$> BitString.sampleList s and seeds from
BitString.sampleList s, the joint law of (naorSelectPads, naorSelectSeeds) is identical to
using seeds at all coordinates (openFlags = List.replicate bits.length true).
Packaged bit commitment scheme #
Naor commitment verification is computable in plain polynomial time when its inputs are.
A two-message statistically binding bit commitment scheme with uniform,
poly-time-generable stateful hiding (GenerableStatefulHiding only; for arbitrary polynomially
bounded auxiliary input [Nao91], see BitCommitmentScheme). At security parameter n, the
receiver sends a uniform challenge string r of length challengeLength n, the committer commits
to b : Bool using a uniform seed seed of length n via commit r b seed of length
commitLength n, and openings are verified by verify n r c b seed.
Length of the receiver's first-round challenge at security parameter
n.Length of the commitment string at security parameter
n.Commitment function taking receiver string
r, bitb, andn-bit seedseed.Verification of an opening
(b, seed)against(n, r, c).- polyTime_challengeLength : Turing.MultiTapeTM.ComputableInPolyTime self.challengeLength Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
challengeLengthis computable in plain polynomial time in unary. - polyTime_commitLength : Turing.MultiTapeTM.ComputableInPolyTime self.commitLength Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
commitLengthis computable in plain polynomial time in unary. - polyTime_commit : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : List Bool × Bool × List Bool) => match x with | (r, b, seed) => self.commit r b seed) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits encBitOpening) Turing.MultiTapeTM.encBits
commitis computable in plain polynomial time. - polyTime_verify : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × List Bool × Bool × List Bool) => match x with | (n, r, c, b, seed) => self.verify n r c b seed) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits encBitOpening))) Turing.MultiTapeTM.encBool
verifyis computable in plain polynomial time. - length_commit (n : ℕ) (r : List Bool) (b : Bool) (seed : List Bool) : seed.length = n → (self.commit r b seed).length = self.commitLength n
Honest commitments have length
commitLength nwhenseed.length = n. - verify_commit (n : ℕ) (r : List Bool) (b : Bool) (seed : List Bool) : seed.length = n → self.verify n r (self.commit r b seed) b seed = true
Correctness: an honest commitment is accepted by
verify. - statistical_binding : Negligible fun (n : ℕ) => ((BitString.uniformList (self.challengeLength n)).toOuterMeasure {r : List Bool | ¬∀ (s₀ s₁ : List Bool), s₀.length = n → s₁.length = n → self.commit r false s₀ ≠ self.commit r true s₁}).toNNReal
Statistical binding: the probability over a uniform receiver challenge
rof lengthchallengeLength nthat twon-bit seeds open tofalseandtruewith the same commitment is negligible inn. - generable_hiding : GenerableStatefulHiding self.commit
Uniform stateful-receiver computational hiding: for every deterministic polynomial-time auxiliary family
aux : ℕ → List Bool, no strict PPTCommitmentReceivercan distinguish commitments to its first chosen bit (bit = false) from commitments to its second chosen bit (bit = true) with non-negligible advantage.
Deterministic-family computational hiding derived from
GenerableBitCommitmentScheme.generable_hiding: for every deterministic polynomial-time family of
receiver strings r : ℕ → List Bool and any two deterministic polynomial-time families of
committed bits b₀ b₁ : ℕ → Bool, the commitment ensembles for b₀ and b₁ are computationally
indistinguishable against uniform strict PPT distinguishers.
A two-message statistically binding, computationally hiding bit commitment scheme [Nao91].
Extends GenerableBitCommitmentScheme with auxiliary-input computational hiding (StatefulHiding)
against any two-stage randomized stateful PPT receiver (CommitmentReceiver) given any
polynomially bounded auxiliary input family aux : ℕ → List Bool.
- polyTime_commit : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : List Bool × Bool × List Bool) => match x with | (r, b, seed) => self.commit r b seed) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits encBitOpening) Turing.MultiTapeTM.encBits
- polyTime_verify : Turing.MultiTapeTM.ComputableInPolyTime (fun (x : ℕ × List Bool × List Bool × Bool × List Bool) => match x with | (n, r, c, b, seed) => self.verify n r c b seed) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits encBitOpening))) Turing.MultiTapeTM.encBool
- statistical_binding : Negligible fun (n : ℕ) => ((BitString.uniformList (self.challengeLength n)).toOuterMeasure {r : List Bool | ¬∀ (s₀ s₁ : List Bool), s₀.length = n → s₁.length = n → self.commit r false s₀ ≠ self.commit r true s₁}).toNNReal
- stateful_hiding : StatefulHiding self.commit
Naor's bit commitment scheme with uniform (GenerableStatefulHiding) hiding, built from any
uniform pseudorandom generator with stretch at least 3 * n (weaker than the arbitrary
auxiliary-input BitCommitmentScheme of [Nao91]; see NonuniformPRG.naorBitCommitment).
Existence of a statistically binding bit commitment scheme with uniform
(GenerableStatefulHiding) hiding from any uniform one-way function, composing the OWF-to-PRG
step (OneWay.exists_pseudorandomGenerator_three_mul, [HILL99]) with
PseudorandomGenerator.naorGenerableBitCommitment (weaker than the arbitrary auxiliary-input
condition of [Nao91], Section 2, pp. 3–4; see NonuniformOneWay.exists_bitCommitmentScheme).
Step toward Naor's PRG-based bit commitment construction (after [Nao91]), not the cited
result: packages naorCommit generator from any nonuniform pseudorandom generator (NonuniformPRG)
with stretch at least 3 * n into a BitCommitmentScheme providing StatefulHiding against
randomized stateful PPT receivers given arbitrary polynomially bounded auxiliary input.
naorBindingProb_lt_of_three_mul gives the strict probability bound for the binding clause.
The hiding game uses advice fixed across its two worlds.
Step toward bit commitments from nonuniform one-way functions (after [Nao91]), not the cited
result: proves Nonempty BitCommitmentScheme (with StatefulHiding against randomized stateful PPT
receivers given arbitrary polynomially bounded auxiliary input) from any nonuniform one-way function
(NonuniformOneWay), composing the nonuniform OWF-to-PRG step
(NonuniformOneWay.exists_nonuniformPRG_three_mul, [HILL99]) with
NonuniformPRG.naorBitCommitment. The latter carries the fixed-advice hiding guarantee.