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.
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.StatefulHiding: the two-stage commitment hiding game and computational hiding against randomized stateful PPT receivers.Cslib.Crypto.naorReceiverDistinguisher: 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.BitCommitmentScheme: a two-message statistically binding, computationally hiding bit commitment scheme.
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.advantage_commitmentHidingGame_naorCommit_le,Cslib.Crypto.PseudorandomGenerator.naorStatefulHiding: computational hiding of Naor commitments against randomized stateful PPT receivers, andCslib.Crypto.StatefulHiding.computational_hidingconnecting stateful-receiver hiding to the deterministic-family interface.Cslib.Crypto.naorBindingProb_le,Cslib.Crypto.naorBindingProb_le_of_three_mul_add_one,Cslib.Crypto.negligible_naorBindingError: statistical binding when3 * n ≤ length n.Cslib.Crypto.PseudorandomGenerator.naorBitCommitment,Cslib.Crypto.OneWay.exists_bitCommitmentScheme: packaged Naor bit commitment scheme from a pseudorandom generator or one-way function.
References #
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 polynomial time when its inputs are.
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.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.
Instances For
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 (p : ℕ × List Bool × List Bool) => receiver.guess p.1 p.2.1 p.2.2
The second stage is strict PPT on
(n, state, c).
Instances For
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.
Instances For
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.
Computational hiding against a randomized stateful PPT receiver: for every polynomial-time
auxiliary family aux : ℕ → List Bool, 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.
Instances For
Specialization of StatefulHiding to the empty auxiliary string [].
Package deterministic families (r, b₀, b₁) and a distinguisher D as a stateless
CommitmentReceiver.
Instances For
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.
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.
PRG distinguisher induced by a stateful commitment receiver receiver, auxiliary input family
aux, and hidden bit selector bit. On security parameter n and candidate pad pad, it runs
choice ← receiver.choose n (aux n), forms the commitment naorCommit id r b_bit pad, and runs
receiver.guess n choice.2 c.
Instances For
naorReceiverDistinguisher receiver aux bit is a strict PPT distinguisher whenever receiver
is strict PPT and aux is computable in plain polynomial time.
Running commitmentHidingGame (naorCommit generator) against receiver coincides with running
naorReceiverDistinguisher receiver aux bit against the PRG output generatorEnsemble generator n.
On a truly uniform m-bit pad, naorReceiverDistinguisher receiver aux bit n 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 at security parameter n is bounded
by the sum of the PRG distinguishing advantages of naorReceiverDistinguisher receiver aux false
and naorReceiverDistinguisher receiver aux true against BitString.uniformList m.
Stateful-receiver computational hiding of Naor bit commitment [Nao91]: for any
pseudorandom generator generator, naorCommit generator satisfies StatefulHiding against all
randomized stateful PPT receivers.
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.
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, computationally hiding bit commitment scheme [Nao91].
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. Hiding (stateful_hiding) holds against any two-stage randomized stateful
PPT receiver (CommitmentReceiver).
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 (p : List Bool × Bool × List Bool) => self.commit p.1 p.2.1 p.2.2) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBool Turing.MultiTapeTM.encBits)) Turing.MultiTapeTM.encBits
commitis computable in plain polynomial time. - polyTime_verify : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : ℕ × List Bool × List Bool × Bool × List Bool) => self.verify p.1 p.2.1 p.2.2.1 p.2.2.2.1 p.2.2.2.2) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBool Turing.MultiTapeTM.encBits)))) 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. - stateful_hiding : StatefulHiding self.commit
Computational hiding against a randomized stateful PPT receiver: for every 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.
Instances For
Deterministic-family computational hiding derived from BitCommitmentScheme.stateful_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.
The equivalent tidy contract used internally by compositional proofs.
The equivalent tidy contract used internally by compositional proofs.
The equivalent tidy contract used internally by compositional proofs.
The equivalent tidy contract used internally by compositional proofs.
The equivalent tidy contract used internally by compositional proofs.
Naor's bit commitment scheme built from any pseudorandom generator with stretch at least
3 * n [Nao91].
Instances For
Existence of bit commitments from one-way functions [Nao91]: if a one-way function
exists, then there exists a statistically binding, computationally hiding bit commitment scheme
(with hiding against randomized stateful PPT receivers, BitCommitmentScheme.stateful_hiding).