Forgery experiments with verification queries #
In [BS23], Section 6.2 (Attack Game 6.2, p. 221), an adversary against a message
authentication code interleaves signing queries m with verification queries (m̂, t̂) and wins as
soon as the challenger accepts a verification query not among the previously answered (m_i, t_i)
pairs. Unlike Attack Game 6.1 (forgeExperiment), the adversary produces no final candidate; a
traditional Attack Game 6.1 forger is the special case making one verification query at the end
(forgerToVq).
This module develops the finite query-bounded steps of Theorem 6.1 ([BS23], pp. 221–223)
and Exercise 6.2 ([BS23], p. 246), where adversaries carry structural query budgets
(IsSigningQueryBounded, IsVerificationQueryBounded) without machine running-time certificates.
The full computational theorems with IsOraclePPT reduction certificates on MACScheme live in
CslibFrontier.Crypto.Computational.MAC.VerificationQueries.
Design notes #
- Total verification oracle on repeated pairs. Attack Game 6.2 syntactically forbids submitting
a previously signed pair
(m, σ) ∈ logto the verification oracle. HerevqOracleis total onM × Sig: it answers every verification query(m, σ)withverify pk sk m σand latcheswononly whenverify pk sk m σ && freshPair m σ logholds. An adversary that never submits a pair fromlogsees the exact Attack Game 6.2 oracle, while an adversary that replays(m, σ) ∈ logreceivestrue(when honest signatures verify) without winning. - Why
freshPairworks for randomized MACs withoutsk. Suppose every signature produced bysignerverifies (hsign). Before the first winning fresh verification query occurs, any verification query(m, σ)satisfies(verify pk sk m σ && freshPair m σ log) = false: if(m, σ) ∈ logthenverify pk sk m σ = true, and if(m, σ) ∉ logthenverify pk sk m σ = false. In both cases the challenger's answer equalsdecide ((m, σ) ∈ log), which the reductionvqToForgerOncomputes from its local signing log without knowingsk, even whensigneris randomized and messages have multiple valid tags. (Under existential freshnessfreshMessage, a second valid tag(m, σ')on a previously signedmwould not win yet would require answeringtrue, which cannot be simulated withoutsk.) - Policy admissibility. Under
ProbOracleComp.runLogWith, a refused signing query (signer sk log m = none, as inSigner.restrictorSigner.oneTime) returnsdefaultwithout appending tolog.vqToForgerOntakes a public predicateadmit : List (M × Sig) → M → Boolcharacterizing(signer sk log m).isSomeso its local log matches the challenger's log; for an unrestricted signer (Signer.ofSign),vqToForgerfixesadmit := fun _ _ => true. - PRF MAC without the
Q_vfactor on PRF advantage (Exercise 6.2). For a deterministic keyed functionF : Key → D → R,vqMacToPrfAdversaryforwards signing queries and fresh verification queries directly to the function oracle (≤ Q_s + Q_vcalls in total) without guessing an index. In the ideal random-function world, the finite Theorem 6.1 step bounds theQ_v-verification success probability byQ_vtimes the Attack Game 6.1 random-function forgery probability (≤ 1 / |R|), yieldingPRF.advantage F (vqMacToPrfAdversary A) + Q_v / |R|.
Main definitions #
Cslib.Crypto.forgeVqSpec: disjoint sum(fun _ : M => Sig) ⊕ₒ (fun _ : M × Sig => Bool)of the signing and verification oracle interfaces.Cslib.Crypto.IsSigningQueryBounded,Cslib.Crypto.IsVerificationQueryBounded: separate pathwise signing and verification query budgets.Cslib.Crypto.vqOracle,Cslib.Crypto.vqForgeExperiment: stateful challenger and experiment of Attack Game 6.2.Cslib.Crypto.forgerToVq: embeds an Attack Game 6.1 forger as a 1-verification-query adversary.Cslib.Crypto.vqToForgerOn,Cslib.Crypto.vqToForger: planted-query guessing reduction fromvqForgeExperimenttoforgeExperimentwithfreshPair.Cslib.Crypto.vqMacToPrfAdversary: direct reduction fromvqForgeExperimenton a deterministic keyed functionFtoPRF.Adversary.
Main results #
Cslib.Crypto.eval_vqForgeExperiment_forgerToVq:forgerToVq Ahas the exact law offorgeExperiment ... freshPair A.Cslib.Crypto.succProbability_vqForgeExperiment_zero:0verification queries give0winning probability.Cslib.Crypto.eval_vqForgeExperiment_le_mul_add_of_index: general index-sampler guessing step.Cslib.Crypto.succProbability_vqForgeExperiment_le_mul,Cslib.Crypto.succProbability_vqForgeExperiment_ofSign_le_mul: finite query-bounded step of Theorem 6.1 (≤ Q_v * succProbability (forgeExperiment ...)).Cslib.Crypto.eval_vqForgeExperiment_le_mul_sampleModIndex_add,Cslib.Crypto.eval_vqForgeExperiment_le_mul_sampleModIndex_of_dvd: fair-coinsampleModIndexforms of the finite Theorem 6.1 step (with+ Q_v / 2 ^ width, and exact whenQ_v = 0 ∨ Q_v ∣ 2 ^ width).Cslib.Crypto.succProbability_vqForgeExperiment_prf_le: finite query-bounded step of Exercise 6.2 (≤ PRF.advantage F (vqMacToPrfAdversary A) + Q_v / Fintype.card R).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 6.2 (Attack Game 6.2 and Theorem 6.1, pp. 220–223) and Section 6.14 (Exercise 6.2, p. 246).
Oracle interface, budgets, and Attack Game 6.2 #
Combined signing and verification oracle interface for Attack Game 6.2: left queries .inl m
request a signature in Sig, and right queries .inr (m, σ) request a Boolean verification
verdict.
Pathwise budget of at most Q_s signing queries (.inl m), leaving private coin flips and
verification queries unconstrained.
Pathwise budget of at most Q_v verification queries (.inr (m, σ)), leaving private coin
flips and signing queries unconstrained.
One signing query costs 1 signing query.
One verification query costs 0 signing queries.
One signing query costs 0 verification queries.
One verification query costs 1 verification query.
A total external query budget bounds the number of signing queries.
A total external query budget bounds the number of verification queries.
Separate signing and verification query budgets yield a total external query budget of
Q_s + Q_v.
Challenger state for Attack Game 6.2: the chronological log of answered signing pairs and
whether some fresh verification query has already verified (won).
Answered
(message, signature)pairs in the order answered bysigner.- won : Bool
Latches
trueas soon as a verification query(m, σ)verifies and satisfiesfreshPair.
Instances For
Stateful challenger oracle for Attack Game 6.2 ([BS23], p. 221):
Forgery experiment with verification queries ([BS23], Section 6.2, Attack Game 6.2,
p. 221): draw (pk, sk) from keyGen, run A pk against vqOracle signer verify pk sk from the
empty log with won = false, and accept iff won latched true on some fresh valid verification
query.
Embedding Attack Game 6.1 into Attack Game 6.2 #
Embed a standard Attack Game 6.1 forger A into Attack Game 6.2 by forwarding all signing
queries to .inl and submitting A's final output (m, σ) as a single .inr (m, σ) verification
query.
forgerToVq A in vqForgeExperiment has the exact Boolean law of A in forgeExperiment with
strong freshness (freshPair).
forgerToVq A preserves the signing query bound of A.
forgerToVq A makes at most 1 verification query.
Finite Theorem 6.1: planted-query guessing reduction to Attack Game 6.1 #
An adversary with verification-query budget 0 has succProbability = 0 in
vqForgeExperiment.
Stateful handler of the planted-query guessing reduction ([BS23], Theorem 6.1, pp. 221–223):
- once
st.planted.hasCaptured = true, returns(default, st)on.inland(false, st)on.inrwithout querying the external signing oracle; - while
st.planted.hasCaptured = false:- on
.inl m, ifadmit st.oracleState mholds, queriesmon the external signing oracle and appends(m, σ)tost.oracleState, and otherwise returns(default, st)locally; - on
.inr p, capturespwith replyfalsewhenst.planted.rem == 0, and otherwise answersdecide (p ∈ st.oracleState)while decrementingst.planted.rem.
- on
Policy-aware planted-query reduction ([BS23], Theorem 6.1, pp. 221–223): draw a
target verification-query index j from index, simulate A pk through vqToForgerHandler admit
starting at PlantedOracleState.init j default [], and output the captured candidate pair
st.planted.candidate.
Planted-query reduction for unrestricted signing policies (admit := fun _ _ => true), as in
Signer.ofSign.
vqToForgerOn makes at most Q_s signing queries whenever A pk makes at most Q_s signing
queries.
Finite index-sampler guessing step toward [BS23], Section 6.2, Theorem 6.1
(pp. 221–223), without machine running-time certificates (not the computational result; see
Cslib.Crypto.MACScheme.succProbability_sufCmaVqGame_le_mul_add and
Cslib.Crypto.MACScheme.sufCmaVq_iff_sufCma): suppose every signature produced by signer verifies
(hsign), admit characterizes when signer accepts (hadmit), A pk makes at most Q_v
verification queries (hA), and index hits every j < Q_v according to
1 ≤ c * Pr[index = j] + ε (hindex). Then vqForgeExperiment accepts with probability at most
c times that of forgeExperiment with freshPair on vqToForgerOn admit index A, plus ε.
Finite query-bounded step toward [BS23], Section 6.2, Theorem 6.1 (pp. 221–223),
without machine running-time certificates (not the cited computational result; see
Cslib.Crypto.MACScheme.succProbability_sufCmaVqGame_le_mul_add and
Cslib.Crypto.MACScheme.sufCmaVq_iff_sufCma): when every signature produced by signer verifies
and admit characterizes when signer accepts, an adversary making at most Q_v verification
queries wins vqForgeExperiment with probability at most Q_v times the success probability of
vqToForgerOn admit (Fin.val <$> ProbComp.unifFin (Q_v - 1)) A in forgeExperiment with
freshPair. Holds for every Q_v : ℕ, including Q_v = 0.
Finite query-bounded step toward [BS23], Section 6.2, Theorem 6.1 (pp. 221–223) for
unrestricted signers (Signer.ofSign), without machine running-time certificates (not the cited
computational result; see Cslib.Crypto.MACScheme.sufCmaVq_iff_sufCma): when every signature in the
support of sign sk m verifies, vqForgeExperiment success probability for any
Q_v-verification-query adversary is at most Q_v times the freshPair forgeExperiment success
probability of vqToForger (Fin.val <$> ProbComp.unifFin (Q_v - 1)) A.
Finite query-bounded fair-coin sampleModIndex step toward [BS23], Section 6.2,
Theorem 6.1 (pp. 221–223), without machine running-time certificates (not the cited computational
result; see Cslib.Crypto.MACScheme.succProbability_sufCmaVqGame_le_mul_add): drawing the planted
verification-query index via ProbComp.sampleModIndex width Q_v from width fair coins gives the
factor Q_v plus the dyadic bias Q_v / 2 ^ width, for every width and Q_v (including
Q_v = 0).
Finite query-bounded exact dyadic sampleModIndex step toward [BS23], Section 6.2,
Theorem 6.1 (pp. 221–223), without machine running-time certificates (not the cited computational
result; see Cslib.Crypto.MACScheme.succProbability_sufCmaVqGame_le_mul): proves the exact
factor-Q_v bound with no additive error term when Q_v = 0 (where vqForgeExperiment accepts
with probability 0 via eval_vqForgeExperiment_zero) or when Q_v divides 2 ^ width (where
0 < Q_v and ProbComp.sampleModIndex width Q_v is uniform below Q_v).
Finite Exercise 6.2: PRF-based MAC with verification queries #
Stateful handler for vqMacToPrfAdversary:
.inl mqueriesmon the external function oracle, appends(m, σ)tost.log, and returnsσ;.inr (m, σ)returnstruelocally when(m, σ) ∈ st.log(avoiding a redundant oracle call), and otherwise queriesmon the external function oracle, setsok := decide (τ = σ), latchesst.won || ok, and returnsok.
Direct reduction from vqForgeExperiment on a deterministic keyed function F : Key → D → R
to PRF.Adversary D R ([BS23], Exercise 6.2, p. 246): simulate A () via
vqMacToPrfHandler and output st.won. Unlike vqToForger, this reduction guesses no index and
forwards both signing and fresh verification queries directly to the PRF oracle.
vqMacToPrfAdversary A makes at most Q_s + Q_v function queries when A () makes at most
Q_s signing queries and at most Q_v verification queries.
Running vqMacToPrfAdversary A in PRF.realExperiment F has the exact Boolean law of
vqForgeExperiment against the deterministic MAC (k, m) ↦ F k m.
Finite query-bounded step toward [BS23], Section 6.14, Exercise 6.2 (p. 246),
without machine running-time certificates (not the cited computational result; see
Cslib.Crypto.succProbability_sufCmaVqGame_prfMAC_le and
Cslib.Crypto.PseudorandomFunction.sufCmaVq_prfMAC): for any finite keyed function
F : Key → D → R and any adversary A making at most Q_v verification queries, the success
probability of A in vqForgeExperiment against the deterministic MAC (k, m) ↦ F k m is at most
PRF.advantage F (vqMacToPrfAdversary A) + Q_v / Fintype.card R (without a Q_v factor on the PRF
advantage). When A () also makes at most Q_s signing queries, vqMacToPrfAdversary A makes at
most Q_s + Q_v PRF queries (isQueryBounded_vqMacToPrfAdversary).