Carter–Wegman message authentication codes from Δ-universal hashing #
Wegman and Carter [WC81] observed that an ε-almost-Δ-universal (ε-DUF / ε-AXU)
hash family hash : K → M → Y into a finite additive group Y
(Cslib.Probability.IsDeltaUniversalHash) yields an unconditional message authentication code when
each hash digest hash k m is masked by a uniform one-time pad r ∈ Y:
- Signing (
sign):sign hash k r m = hash k m + r. - Verification (
verify):verify hash k r m t = decide (hash k m + r = t).
For every fixed hash key k and message m, left addition by hash k m is a bijection on Y, so
a uniform pad r ← PMF.uniformOfFintype Y makes the tag t = hash k m + r uniformly distributed
on Y and independent of k, with r = -hash k m + t (map_sign_eq_uniform,
bind_uniform_sign). After seeing (m, t), any forgery attempt (m', t') with m' ≠ m
verifies under r = -hash k m + t if and only if
hash k m' - hash k m = t' - t (verify_neg_add_eq_true_iff).
Since the adversary's view (m, t) is independent of k, IsDeltaUniversalHash seed hash ε
bounds the probability of this difference equation over k ← seed by at most ε
([BS23], Section 7.6, Lemma 7.11 and Theorem 7.12).
This module formalizes:
- Algebraic and resampling properties (
sign,verify,map_sign_eq_uniform,bind_uniform_sign) over any finite additive groupY. - Zero-query forgery (
zeroQueryGame,zeroQueryGame_apply_true): without a signing query, any forgery attempt succeeds with probability at most (and in fact equal to)1 / |Y|. - Adaptive one-time EUF-CMA and SUF-CMA security (
OneTimeForger,oneTimeGame,oneTimeStrongGame,oneTimeStrongGame_eq_oneTimeGame,oneTimeGame_le,oneTimeStrongGame_le): because each(k, r, m)admits a unique valid tag, strong unforgeability ((m', t') ≠ (m, t)) and ordinary unforgeability (m' ≠ m) coincide and are bounded byε([BS23], Section 7.6, Lemma 7.11 and Theorem 7.12). - Adaptive multi-query issued-counter / issued-slot Carter–Wegman MAC (
CounterForger,counterSlotGame,counterGame,counterStrongGame,counterStrongGame_eq_counterSlotGame,counterSlotGame_le,counterGame_le,counterStrongGame_le): when each signing query draws an independent uniform padr_i ← PMF.uniformOfFintype Y(recorded at counter indexi), the entire adaptive query transcript is independent of the hash keyk, so any adaptiveOracleCompforger (making any number of queries) targeting an issued counter indexidx < pads.lengthhas forgery probability at mostεunder issued-slot message freshness (counterSlotGame), issued-counter global message freshness (counterGame), and issued-slot strong pair freshness (counterStrongGame), with zero degradation in the number of queries [WC81]. Unissued counter indices (pads[idx]? = none) are rejected (false), so zero-query success in the issued-counter games is0(whereas the standalonezeroQueryGamehas success1 / |Y|); a fresh-counter experiment that accepts unissued nonces against fresh pads is separate scope. - Arbitrary-pad hybrid decomposition and the one-query, fixed-nonce PRF-pad reduction
(
maskedOneTimeGame,padDistinguisher,maskedOneTimeGame_toReal_le,maskedOneTimeGame_toReal_le_add_advantage,prfPadDist,prfOneTimeGame,prfOneTimeStrongGame,prfPadDistinguisher,prfOneTimeGame_le,prfOneTimeStrongGame_le,prfOneTimeGame_ofProbComp_le,isOraclePPT_prfPadDistinguisher,wordProbPadTest,isPPTOn_wordProbPadTest,isOraclePPT_prfPadDistinguisher_wordProbPadTest,PseudorandomFunction.negligible_prfOneTimeGame,PseudorandomFunction.negligible_prfOneTimeStrongGame,PseudorandomFunction.negligible_prfOneTimeGame_wordProbPadTest,PseudorandomFunction.negligible_prfOneTimeStrongGame_wordProbPadTest): replacing the uniform padr ← PMF.uniformOfFintype Ywith any pad distributionpadDist : PMF Ybounds the real forgery probability byε.toRealplus the distinguishing advantage ofpadDistinguisherbetweenpadDistandPMF.uniformOfFintype Y(after [BS23], Section 7.4). In the one-query, fixed-nonce case whereY = BitString nand the pad is generated by evaluatingfamilyat the fixed nonceList.replicate n falseunder a uniformn-bit key (prfPadDist family n), the single-queryOracleDistinguisheradapterprfPadDistinguisherrealizes the real and ideal pad experiments insideprfRealGameandprfIdealGameat each parametern, is uniformly strict oracle-PPT (IsOraclePPT encBool) whenever the pad test is uniformly strict PPT, and yields negligible forgery probability underPseudorandomFunction familyandNegligible ε. - Multi-query fresh-nonce PRF-masked Carter–Wegman MAC (
counterSeqHandler,maskedCounterSlotGame,maskedCounterGame,maskedCounterStrongGame,counterPadSeqDistinguisher,prfPadSeqDist,prfCounterSlotGame,prfCounterGame,prfCounterStrongGame,prfMultiPadDistinguisher,prfCounterSlotGame_le,prfCounterGame_le,prfCounterStrongGame_le,isOraclePPT_prfMultiPadDistinguisher,PseudorandomFunction.negligible_prfCounterSlotGame,PseudorandomFunction.negligible_prfCounterGame,PseudorandomFunction.negligible_prfCounterStrongGame): when thei-th signing query uses a PRF padBitString.ofList n (prfOracle family n key (nonce n i))at pairwise distinctn-bit noncesnonce n 0, ..., nonce n (Q n - 1), anyQ n-query-bounded adaptiveCounterForgerhas forgery probability at mostε.toRealplus the concreteQ n-query PRF distinguishing advantage ofprfMultiPadDistinguisher Q nonce test, and negligible forgery probability whenfamilyis aPseudorandomFunctionandεisNegligible(after [BS23], Section 7.5, Theorem 7.10). This models the nonce-based Carter–Wegman construction under two restrictions compared to Boneh–Shoup Attack Game 7.4: (a) the signer's counter schedulenonce n ifixes the nonces rather than letting the adversary choose distinct nonces, and (b)checkCounterSlot/checkCounterEUF/checkCounterSUFaccept forgeries only at issued counter slots (pads[idx]? = some r) and reject unissuedidx, which removes the1 / |T|unissued-nonce guessing term. - Full nonce-based Carter–Wegman MAC (
NonceForger,nonceFnHandler,nonceSimHandler,reconstructPadFn,checkNonceSUF,checkNonceEUF,nonceStrongGame,nonceGame,nonceStrongGame_le_max,nonceStrongGame_le,nonceGame_le_max,nonceGame_le,maskedNonceStrongGame,maskedNonceGame,nonceFnDistinguisher,prfFnDist,prfNonceStrongGame,prfNonceGame,prfNonceStrongGame_le_of_distinguisher,prfNonceGame_le_of_distinguisher,PseudorandomFunction.negligible_prfNonceStrongGame,PseudorandomFunction.negligible_prfNonceGame,carterWegmanNonceMAC,cwNonceLogHandler,prfNonceToPrfDistinguisher,isOraclePPT_prfNonceToPrfDistinguisher,eval_prfRealGame_prfNonceToPrfDistinguisher,eval_prfIdealGame_prfNonceToPrfDistinguisher_le,sufCmaGame_carterWegmanNonceMAC_toReal_le,PseudorandomFunction.sufCma_carterWegmanNonceMAC,PseudorandomFunction.eufCma_carterWegmanNonceMAC): models Boneh–Shoup Attack Game 7.4 and Theorem 7.10 ([BS23], Section 7.5.1, p. 274) both information-theoretically and computationally (NonceMACScheme), where the adversary adaptively chooses distinct signing noncesx_i : Nand outputs a candidate forgery((m', x'), t')at any (issued or unissued) noncex', achieving forgery probability at mostmax ε (1 / |Y|) ≤ ε + 1 / |Y|under a random functionrf ← PMF.uniformOfFintype (N → Y), at mostε.toReal + (2 ^ n)⁻¹ + Game.advantage ...under a PRF pad familyprfFnDist family nvia theIsOraclePPT encBoolreduction wrapperprfNonceToPrfDistinguisher, and asymptoticNonceMACScheme.SUFCMAandNonceMACScheme.EUFCMAsecurity underPseudorandomFunction familyandNegligible ε. - Randomized Carter–Wegman MAC (
RandomNonceForger,randomNonceFnHandler,randomNonceSimHandler,checkRandomNonceSUF,checkRandomNonceEUF,randomNonceStrongGame,randomNonceGame,randomNonceStrongGame_le,randomNonceGame_le,maskedRandomNonceStrongGame,maskedRandomNonceGame,randomNonceFnDistinguisher,prfRandomNonceStrongGame,prfRandomNonceGame,prfRandomNonceStrongGame_le_of_distinguisher,prfRandomNonceGame_le_of_distinguisher,PseudorandomFunction.negligible_prfRandomNonceStrongGame,PseudorandomFunction.negligible_prfRandomNonceGame,carterWegmanRandomMAC,cwRandomNonceLogHandler,prfRandomNonceToPrfDistinguisher,isOraclePPT_prfRandomNonceToPrfDistinguisher,eval_prfRealGame_prfRandomNonceToPrfDistinguisher,eval_prfIdealGame_prfRandomNonceToPrfDistinguisher_le,sufCmaGame_carterWegmanRandomMAC_toReal_le,PseudorandomFunction.sufCma_carterWegmanRandomMAC,PseudorandomFunction.eufCma_carterWegmanRandomMAC,PseudorandomFunction.oneTimeEUFCMA_carterWegmanRandomMAC): models Boneh–Shoup Section 7.4, Theorem 7.9 ([BS23], pp. 267–270) both information-theoretically and computationally (MACScheme), where the signer samples a fresh uniform noncex_i ← PMF.uniformOfFintype Non each signing query, bounding anyQ-query adaptive forger's winning probability by((∑ i ∈ Finset.range Q, i : ℕ) : ℝ≥0∞) / |N| + max ε (1 / |Y|) ≤Q ^ 2 / (2 * |N|) + 1 / |Y| + εunder a random function, adding the PRF distinguishing advantage of theIsOraclePPT encBoolreduction wrapperprfRandomNonceToPrfDistinguisherunderprfFnDist family n, and proving asymptoticMACScheme.SUFCMA,MACScheme.EUFCMA, andMACScheme.OneTimeEUFCMAsecurity underPseudorandomFunction familyandNegligible ε. - Concrete instantiations for Carter–Wegman polynomial hashing (
xpolyHash, bound(ℓ + 1) / |F|), Boolean-matrix linear hashing (BitString.LinearHash.hashand computationallinearHashNonceMAC/linearHashRandomMACviaBitString.LinearHash.wordHash, bound2⁻ᵐ), subset-sum hashing (BitString.SubsetSum.hash, bound1 / |G|), and pairwise independent hash families (IsPairwiseIndependentHash, bound1 / |Y|).
Main definitions #
Cslib.Crypto.Protocols.CarterWegman.sign,Cslib.Crypto.Protocols.CarterWegman.verify: Carter–Wegman tag generation and verification.Cslib.Crypto.Protocols.CarterWegman.zeroQueryGame: zero-query forgery experiment.Cslib.Crypto.Protocols.CarterWegman.OneTimeForger,Cslib.Crypto.Protocols.CarterWegman.oneTimeGame,Cslib.Crypto.Protocols.CarterWegman.oneTimeStrongGame: adaptive one-time EUF-CMA and SUF-CMA experiments.Cslib.Crypto.Protocols.CarterWegman.CounterForger,Cslib.Crypto.Protocols.CarterWegman.counterSlotGame,Cslib.Crypto.Protocols.CarterWegman.counterGame,Cslib.Crypto.Protocols.CarterWegman.counterStrongGame: adaptive multi-query issued-counter Carter–Wegman experiments.Cslib.Crypto.Protocols.CarterWegman.maskedOneTimeGame,Cslib.Crypto.Protocols.CarterWegman.padDistinguisher,Cslib.Crypto.Protocols.CarterWegman.probPadTest,Cslib.Crypto.Protocols.CarterWegman.wordProbPadTest: arbitrary-pad one-time Carter–Wegman experiment and its inducedPMFandProbComppad distinguishers.Cslib.Crypto.Protocols.CarterWegman.prfPadDist,Cslib.Crypto.Protocols.CarterWegman.prfOneTimeGame,Cslib.Crypto.Protocols.CarterWegman.prfOneTimeStrongGame,Cslib.Crypto.Protocols.CarterWegman.prfPadDistinguisher: one-query, fixed-nonce PRF-masked Carter–Wegman experiments and the single-queryOracleDistinguisheradapter.Cslib.Crypto.Protocols.CarterWegman.counterSeqHandler,Cslib.Crypto.Protocols.CarterWegman.maskedCounterSlotGame,Cslib.Crypto.Protocols.CarterWegman.maskedCounterGame,Cslib.Crypto.Protocols.CarterWegman.maskedCounterStrongGame,Cslib.Crypto.Protocols.CarterWegman.counterPadSeqDistinguisher,Cslib.Crypto.Protocols.CarterWegman.prfPadSeqDist,Cslib.Crypto.Protocols.CarterWegman.prfCounterSlotGame,Cslib.Crypto.Protocols.CarterWegman.prfCounterGame,Cslib.Crypto.Protocols.CarterWegman.prfCounterStrongGame,Cslib.Crypto.Protocols.CarterWegman.prfMultiPadDistinguisher: multi-query fresh-nonce PRF-masked Carter–Wegman experiments and theQ-queryOracleDistinguisheradapter.Cslib.Crypto.Protocols.CarterWegman.NonceForger,Cslib.Crypto.Protocols.CarterWegman.nonceFnHandler,Cslib.Crypto.Protocols.CarterWegman.nonceSimHandler,Cslib.Crypto.Protocols.CarterWegman.reconstructPadFn,Cslib.Crypto.Protocols.CarterWegman.checkNonceSUF,Cslib.Crypto.Protocols.CarterWegman.checkNonceEUF,Cslib.Crypto.Protocols.CarterWegman.nonceStrongGame,Cslib.Crypto.Protocols.CarterWegman.nonceGame,Cslib.Crypto.Protocols.CarterWegman.maskedNonceStrongGame,Cslib.Crypto.Protocols.CarterWegman.maskedNonceGame,Cslib.Crypto.Protocols.CarterWegman.nonceFnDistinguisher,Cslib.Crypto.Protocols.CarterWegman.prfFnDist,Cslib.Crypto.Protocols.CarterWegman.prfNonceStrongGame,Cslib.Crypto.Protocols.CarterWegman.prfNonceGame,Cslib.Crypto.Protocols.CarterWegman.carterWegmanNonceMAC,Cslib.Crypto.Protocols.CarterWegman.cwNonceLogHandler,Cslib.Crypto.Protocols.CarterWegman.prfNonceToPrfDistinguisher,Cslib.Crypto.Protocols.CarterWegman.linearHashNonceMAC: full nonce-based Carter–Wegman experiments,NonceMACSchemepackaging, andOracleDistinguisherreduction wrapper (Boneh–Shoup Attack Game 7.4 and Theorem 7.10).Cslib.Crypto.Protocols.CarterWegman.RandomNonceForger,Cslib.Crypto.Protocols.CarterWegman.randomNonceFnHandler,Cslib.Crypto.Protocols.CarterWegman.randomNonceSimHandler,Cslib.Crypto.Protocols.CarterWegman.checkRandomNonceSUF,Cslib.Crypto.Protocols.CarterWegman.checkRandomNonceEUF,Cslib.Crypto.Protocols.CarterWegman.randomNonceStrongGame,Cslib.Crypto.Protocols.CarterWegman.randomNonceGame,Cslib.Crypto.Protocols.CarterWegman.maskedRandomNonceStrongGame,Cslib.Crypto.Protocols.CarterWegman.maskedRandomNonceGame,Cslib.Crypto.Protocols.CarterWegman.randomNonceFnDistinguisher,Cslib.Crypto.Protocols.CarterWegman.prfRandomNonceStrongGame,Cslib.Crypto.Protocols.CarterWegman.prfRandomNonceGame,Cslib.Crypto.Protocols.CarterWegman.carterWegmanRandomMAC,Cslib.Crypto.Protocols.CarterWegman.cwRandomNonceLogHandler,Cslib.Crypto.Protocols.CarterWegman.prfRandomNonceToPrfDistinguisher,Cslib.Crypto.Protocols.CarterWegman.linearHashRandomMAC: randomized Carter–Wegman experiments,MACSchemepackaging, andOracleDistinguisherreduction wrapper (Boneh–Shoup Section 7.4, Theorem 7.9, p. 270).
Main results #
Cslib.Crypto.Protocols.CarterWegman.zeroQueryGame_apply_true: exact1 / |Y|zero-query forgery probability.Cslib.Crypto.Protocols.CarterWegman.oneTimeStrongGame_eq_oneTimeGame,Cslib.Crypto.Protocols.CarterWegman.oneTimeGame_le,Cslib.Crypto.Protocols.CarterWegman.oneTimeStrongGame_le: Boneh–Shoup Section 7.6, Lemma 7.11 and Theorem 7.12 (≤ ε).Cslib.Crypto.Protocols.CarterWegman.run_interpret_counterRealHandler: simulation equivalence between real and simulated signing handlers under transcript mapping.Cslib.Crypto.Protocols.CarterWegman.counterStrongGame_eq_counterSlotGame,Cslib.Crypto.Protocols.CarterWegman.counterSlotGame_le,Cslib.Crypto.Protocols.CarterWegman.counterGame_le,Cslib.Crypto.Protocols.CarterWegman.counterStrongGame_le: multi-query issued-counter Carter–Wegman security (≤ ε).Cslib.Crypto.Protocols.CarterWegman.maskedOneTimeGame_toReal_le,Cslib.Crypto.Protocols.CarterWegman.maskedOneTimeGame_toReal_le_add_advantage: arbitrary-pad hybrid bounds.Cslib.Crypto.Protocols.CarterWegman.eval_prfRealGame_prfPadDistinguisher,Cslib.Crypto.Protocols.CarterWegman.eval_prfIdealGame_prfPadDistinguisher,Cslib.Crypto.Protocols.CarterWegman.prfOneTimeGame_le,Cslib.Crypto.Protocols.CarterWegman.prfOneTimeStrongGame_le,Cslib.Crypto.Protocols.CarterWegman.prfOneTimeGame_ofProbComp_le,Cslib.Crypto.Protocols.CarterWegman.isOraclePPT_prfPadDistinguisher,Cslib.Crypto.Protocols.CarterWegman.isPPTOn_wordProbPadTest,Cslib.Crypto.Protocols.CarterWegman.isOraclePPT_prfPadDistinguisher_wordProbPadTest,Cslib.Crypto.PseudorandomFunction.negligible_prfOneTimeGame,Cslib.Crypto.PseudorandomFunction.negligible_prfOneTimeStrongGame,Cslib.Crypto.PseudorandomFunction.negligible_prfOneTimeGame_wordProbPadTest,Cslib.Crypto.PseudorandomFunction.negligible_prfOneTimeStrongGame_wordProbPadTest: single-query PRF-pad reduction,IsOraclePPTadmissibility, and asymptotic security (after Boneh–Shoup Section 7.4).Cslib.Crypto.Protocols.CarterWegman.uniform_bind_run_interpret_counterSeqHandler,Cslib.Crypto.Protocols.CarterWegman.eval_prfRealGame_prfMultiPadDistinguisher,Cslib.Crypto.Protocols.CarterWegman.eval_prfIdealGame_prfMultiPadDistinguisher,Cslib.Crypto.Protocols.CarterWegman.prfCounterSlotGame_le,Cslib.Crypto.Protocols.CarterWegman.prfCounterGame_le,Cslib.Crypto.Protocols.CarterWegman.prfCounterStrongGame_le,Cslib.Crypto.Protocols.CarterWegman.isOraclePPT_prfMultiPadDistinguisher,Cslib.Crypto.PseudorandomFunction.negligible_prfCounterSlotGame,Cslib.Crypto.PseudorandomFunction.negligible_prfCounterGame,Cslib.Crypto.PseudorandomFunction.negligible_prfCounterStrongGame: multi-query fresh-nonce PRF-masked Carter–Wegman security,IsOraclePPTadmissibility, and asymptotic security (after Boneh–Shoup Section 7.5, Theorem 7.10).Cslib.Crypto.Protocols.CarterWegman.uniform_bind_run_interpret_nonceFnHandler,Cslib.Crypto.Protocols.CarterWegman.probOracleComp_uniform_bind_run_interpret_nonceFnHandler,Cslib.Crypto.Protocols.CarterWegman.seed_uniform_checkNonceSUF_le,Cslib.Crypto.Protocols.CarterWegman.nonceStrongGame_le_max,Cslib.Crypto.Protocols.CarterWegman.nonceStrongGame_le,Cslib.Crypto.Protocols.CarterWegman.nonceGame_le_max,Cslib.Crypto.Protocols.CarterWegman.nonceGame_le,Cslib.Crypto.Protocols.CarterWegman.maskedNonceStrongGame_toReal_le_add_advantage,Cslib.Crypto.Protocols.CarterWegman.prfNonceStrongGame_le_of_distinguisher,Cslib.Crypto.Protocols.CarterWegman.prfNonceGame_le_of_distinguisher,Cslib.Crypto.PseudorandomFunction.negligible_prfNonceStrongGame,Cslib.Crypto.PseudorandomFunction.negligible_prfNonceGame,Cslib.Crypto.Protocols.CarterWegman.isOraclePPT_prfNonceToPrfDistinguisher,Cslib.Crypto.Protocols.CarterWegman.eval_prfRealGame_prfNonceToPrfDistinguisher,Cslib.Crypto.Protocols.CarterWegman.eval_prfIdealGame_prfNonceToPrfDistinguisher_le,Cslib.Crypto.Protocols.CarterWegman.sufCmaGame_carterWegmanNonceMAC_toReal_le,Cslib.Crypto.PseudorandomFunction.sufCma_carterWegmanNonceMAC,Cslib.Crypto.PseudorandomFunction.eufCma_carterWegmanNonceMAC: full nonce-based Carter–Wegman security (Boneh–Shoup Attack Game 7.4 and Theorem 7.10).Cslib.Crypto.Protocols.CarterWegman.uniform_bind_run_interpret_randomNonceFnHandler,Cslib.Crypto.Protocols.CarterWegman.probOracleComp_uniform_bind_run_interpret_randomNonceFnHandler(ProbOracleComplift),Cslib.Crypto.Protocols.CarterWegman.randomNonceSimHandler_not_nodup_le,Cslib.Crypto.Protocols.CarterWegman.probOracleComp_randomNonceSimHandler_not_nodup_le,Cslib.Crypto.Protocols.CarterWegman.seed_uniform_probOracleComp_checkRandomNonceSUF_le,Cslib.Crypto.Protocols.CarterWegman.randomNonceStrongGame_le_sum_add_max,Cslib.Crypto.Protocols.CarterWegman.randomNonceStrongGame_le,Cslib.Crypto.Protocols.CarterWegman.randomNonceGame_le,Cslib.Crypto.Protocols.CarterWegman.maskedRandomNonceStrongGame_toReal_le_add_advantage,Cslib.Crypto.Protocols.CarterWegman.prfRandomNonceStrongGame_le_of_distinguisher,Cslib.Crypto.Protocols.CarterWegman.prfRandomNonceGame_le_of_distinguisher,Cslib.Crypto.PseudorandomFunction.negligible_prfRandomNonceStrongGame,Cslib.Crypto.PseudorandomFunction.negligible_prfRandomNonceGame,Cslib.Crypto.Protocols.CarterWegman.isOraclePPT_prfRandomNonceToPrfDistinguisher,Cslib.Crypto.Protocols.CarterWegman.eval_prfRealGame_prfRandomNonceToPrfDistinguisher,Cslib.Crypto.Protocols.CarterWegman.eval_prfIdealGame_prfRandomNonceToPrfDistinguisher_le,Cslib.Crypto.Protocols.CarterWegman.sufCmaGame_carterWegmanRandomMAC_toReal_le,Cslib.Crypto.PseudorandomFunction.sufCma_carterWegmanRandomMAC,Cslib.Crypto.PseudorandomFunction.eufCma_carterWegmanRandomMAC,Cslib.Crypto.PseudorandomFunction.oneTimeEUFCMA_carterWegmanRandomMAC: randomized Carter–Wegman security (Boneh–Shoup Section 7.4, Theorem 7.9, p. 270).Cslib.Crypto.Protocols.CarterWegman.oneTimeGame_xpolyHash_le,Cslib.Crypto.Protocols.CarterWegman.counterGame_xpolyHash_le,Cslib.Crypto.Protocols.CarterWegman.nonceStrongGame_xpolyHash_le,Cslib.Crypto.Protocols.CarterWegman.randomNonceStrongGame_xpolyHash_le,Cslib.Crypto.Protocols.CarterWegman.oneTimeGame_linearHash_le,Cslib.Crypto.Protocols.CarterWegman.counterGame_linearHash_le,Cslib.Crypto.Protocols.CarterWegman.nonceStrongGame_linearHash_le,Cslib.Crypto.Protocols.CarterWegman.randomNonceStrongGame_linearHash_le,Cslib.Crypto.Protocols.CarterWegman.prfOneTimeGame_linearHash_le,Cslib.Crypto.Protocols.CarterWegman.isDeltaUniversalHash_linearHashWordHash,Cslib.Crypto.Protocols.CarterWegman.sufCmaGame_linearHashNonceMAC_toReal_le,Cslib.Crypto.PseudorandomFunction.sufCma_linearHashNonceMAC,Cslib.Crypto.PseudorandomFunction.eufCma_linearHashNonceMAC,Cslib.Crypto.Protocols.CarterWegman.sufCmaGame_linearHashRandomMAC_toReal_le,Cslib.Crypto.PseudorandomFunction.sufCma_linearHashRandomMAC,Cslib.Crypto.PseudorandomFunction.eufCma_linearHashRandomMAC,Cslib.Crypto.PseudorandomFunction.oneTimeEUFCMA_linearHashRandomMAC,Cslib.Crypto.Protocols.CarterWegman.oneTimeGame_subsetSum_le,Cslib.Crypto.Protocols.CarterWegman.counterGame_subsetSum_le,Cslib.Crypto.Protocols.CarterWegman.nonceStrongGame_subsetSum_le,Cslib.Crypto.Protocols.CarterWegman.oneTimeGame_of_isPairwiseIndependentHash_le,Cslib.Crypto.Protocols.CarterWegman.counterGame_of_isPairwiseIndependentHash_le,Cslib.Crypto.Protocols.CarterWegman.nonceStrongGame_of_isPairwiseIndependentHash_le.
References #
Core Carter–Wegman signing, verification, and pad resampling #
Carter–Wegman tag verification: check whether hash k m + r = t.
Instances For
Every valid tag for (k, r, m) equals sign hash k r m.
After observing tag t = hash k m + r (so r = -hash k m + t), a candidate pair (m', t')
verifies if and only if hash k m' - hash k m = t' - t.
Boolean form of verify_neg_add_eq_true_iff.
Because (k, r, m) determines a unique valid tag sign hash k r m, pair freshness
(m', t') ≠ (m, sign hash k r m) and message freshness m' ≠ m agree on all verifying pairs.
For a uniform pad r ← PMF.uniformOfFintype Y, the tag sign hash k r m is uniformly
distributed on Y for every k and m.
Pad-to-tag change of variables: sampling a uniform pad r ← PMF.uniformOfFintype Y and
passing (sign hash k r m, r) to a continuation f is identical to sampling a uniform tag
t ← PMF.uniformOfFintype Y and reconstructing r = -hash k m + t.
Zero-query forgery experiment #
The zero-query forgery experiment: sample k ← seed, r ← PMF.uniformOfFintype Y, and
(m', t') ← forger, and check whether verify hash k r m' t' = true.
Instances For
Without any signing query, every forgery distribution forger : PMF (M × Y) succeeds with
probability exactly 1 / |Y|, regardless of the hash family hash or key distribution
seed.
Adaptive one-time Carter–Wegman EUF-CMA and SUF-CMA (Boneh–Shoup Section 7.6) #
An adaptive one-time forger against a Carter–Wegman MAC:
it chooses a signing query m ← query, receives its tag t = sign hash k r m, and outputs a
candidate forgery (m', t') ← forge m t.
- query : PMF M
Distribution of the single signing query
m. Forgery distribution given the queried message
mand its tagt.
Instances For
The adaptive one-time EUF-CMA experiment ([BS23], Section 7.6, Lemma 7.11 and
Theorem 7.12): the forger wins if m' ≠ m and verify hash k r m' t' = true.
Instances For
The adaptive one-time SUF-CMA (strong unforgeability) experiment:
the forger wins if (m', t') ≠ (m, sign hash k r m) and verify hash k r m' t' = true.
Instances For
Strong unforgeability and ordinary unforgeability coincide for the one-time Carter–Wegman MAC,
because each (k, r, m) admits a unique valid tag.
Reformulation of oneTimeGame via bind_uniform_sign: the queried message m, uniform tag
t, and candidate forgery p = (m', t') are sampled independently of the hash key k, which is
drawn last to test verify hash k (-hash k m + t) m' t'.
One-time Carter–Wegman EUF-CMA security ([BS23], Section 7.6, Lemma 7.11 and
Theorem 7.12; [WC81]): if hash is ε-almost-Δ-universal under seed
(IsDeltaUniversalHash seed hash ε), then every adaptive one-time forger succeeds with
probability at most ε.
One-time Carter–Wegman SUF-CMA security: under IsDeltaUniversalHash seed hash ε, every
adaptive one-time forger has strong-forgery probability at most ε.
Adaptive multi-query issued-counter Carter–Wegman MAC #
An adaptive multi-query forger against an issued-counter Carter–Wegman MAC:
it draws private coins s ← coins, makes any number of adaptive signing queries m : M via
OracleComp (fun _ : M => Y) (receiving t_i = sign hash k r_i m_i under a fresh pad r_i for
the i-th query), and outputs a target issued counter index idx : ℕ, message m' : M, and tag
t' : Y.
- Coins : Type
Type of the forger's private coins.
Distribution of the forger's private coins.
- forge : self.Coins → OracleComp (fun (x : M) => Y) (ℕ × M × Y)
Adaptive oracle program outputting
(idx, m', t').
Instances For
Real counter Carter–Wegman signing handler: on query m, sample a fresh pad
r ← PMF.uniformOfFintype Y, append (m, r) to the pad log, and return sign hash k r m.
Instances For
Simulated key-independent tag handler: on query m, sample a fresh uniform tag
t ← PMF.uniformOfFintype Y, append (m, t) to the message–tag transcript, and return t.
Instances For
Running any adaptive OracleComp program against counterRealHandler hash k from
transcriptToPads hash k tr has the exact distribution of running it against the key-independent
counterSimHandler from tr and applying transcriptToPads hash k to the final transcript.
Issued-slot message-freshness verification predicate on a pad log pads: the target counter
idx was issued (pads[idx]? = some (m_idx, r_idx), returning false on unissued indices),
m' ≠ m_idx, and verify hash k r_idx m' t' = true.
Instances For
Issued-counter global-message-freshness EUF-CMA verification predicate on a pad log pads:
the target counter idx was issued (pads[idx]? = some (_, r_idx), returning false on unissued
indices), m' was never queried in any issued slot (!(pads.map Prod.fst).contains m'), and
verify hash k r_idx m' t' = true.
Instances For
Issued-slot strong SUF-CMA verification predicate on a pad log pads: the target counter idx
was issued (pads[idx]? = some (m_idx, r_idx), returning false on unissued indices), the pair
(m', t') differs from the pair (m_idx, sign hash k r_idx m_idx) issued at counter idx, and
verify hash k r_idx m' t' = true.
Instances For
Issued-slot SUF-CMA and issued-slot EUF-CMA checks are identical on every pad log and output.
Issued-counter global message freshness implies issued-slot message freshness at the target
counter idx.
The issued-slot EUF-CMA experiment for the counter Carter–Wegman MAC (unissued indices idx
are rejected).
Instances For
The issued-counter global-message-freshness EUF-CMA experiment for the counter Carter–Wegman
MAC (unissued indices idx are rejected).
Instances For
The issued-slot strong SUF-CMA experiment for the counter Carter–Wegman MAC (unissued indices
idx are rejected).
Instances For
Issued-slot strong unforgeability (counterStrongGame) and issued-slot EUF-CMA
(counterSlotGame) have identical outcome distributions.
Issued-counter global-message-freshness EUF-CMA success probability is at most issued-slot EUF-CMA success probability.
Multi-query issued-slot Carter–Wegman security ([WC81];
[BS23], Section 7.4): under IsDeltaUniversalHash seed hash ε, every adaptive
multi-query forger succeeds in counterSlotGame with probability at most ε, with zero
degradation in the number of signing queries.
Multi-query issued-counter Carter–Wegman EUF-CMA security: under
IsDeltaUniversalHash seed hash ε, every adaptive multi-query forger has issued-counter EUF-CMA
forgery probability at most ε.
Multi-query issued-slot Carter–Wegman SUF-CMA security: under
IsDeltaUniversalHash seed hash ε, every adaptive multi-query forger has issued-slot SUF-CMA
forgery probability at most ε.
Pseudorandom-pad hybrid decomposition (after Boneh–Shoup Section 7.4) #
The one-time Carter–Wegman experiment with an arbitrary pad distribution padDist : PMF Y
(such as a pseudorandom function output F(k₂, nonce)).
Instances For
The strong one-time Carter–Wegman experiment with an arbitrary pad distribution
padDist : PMF Y.
Instances For
The induced pad distinguisher Y → PMF Bool that samples k ← seed, simulates the one-time
Carter–Wegman experiment using the supplied pad r : Y, and outputs true iff the forger
produces a valid forgery.
Instances For
maskedOneTimeGame is equivalent to sampling r ← padDist and running
padDistinguisher seed hash forger r.
Pseudorandom-pad Carter–Wegman bound (after [BS23], Section 7.4):
if hash is ε-almost-Δ-universal (ε ≠ ⊤), then the real-valued forgery probability under any
pad distribution padDist : PMF Y is bounded by ε.toReal plus the distinguishing gap of
padDistinguisher between padDist and PMF.uniformOfFintype Y.
Game.advantage form of maskedOneTimeGame_toReal_le (after [BS23], Section 7.4):
the real-valued forgery probability under padDist is bounded by ε.toReal plus
Game.advantage between padDist.bind (padDistinguisher seed hash forger) and
(PMF.uniformOfFintype Y).bind (padDistinguisher seed hash forger).
Strong-unforgeability version of maskedOneTimeGame_toReal_le_add_advantage.
Construct a OneTimeForger from ProbComp query and forgery programs.
Instances For
Executable ProbComp simulation of the one-time Carter–Wegman experiment with a supplied pad
r : Y, given ProbComp samplers for the hash key seed, signing query query, and forgery
attempt forge.
Instances For
One-query, fixed-nonce PRF-pad reduction (after Boneh–Shoup Section 7.4) #
The one-time pad distribution on BitString n obtained by sampling a uniform n-bit PRF key
key ← BitString.uniformList n and evaluating family key (List.replicate n false).
Instances For
The one-query, fixed-nonce PRF-masked Carter–Wegman EUF-CMA experiment (after
[BS23], Section 7.4): the pad r : BitString n is generated by evaluating family on a
uniform n-bit PRF key at the fixed nonce List.replicate n false.
Instances For
The one-query, fixed-nonce PRF-masked Carter–Wegman SUF-CMA experiment (after [BS23], Section 7.4).
Instances For
Single-query PRF OracleDistinguisher induced by a family of ProbComp pad tests
test : (k : ℕ) → BitString k → ProbComp Bool: at security parameter n, query the oracle once at
the fixed nonce List.replicate n false and run test n on the n-bit view of the reply.
Instances For
In prfRealGame, prfPadDistinguisher test evaluates test n on a pad drawn from
prfPadDist family n.
In prfIdealGame, prfPadDistinguisher test evaluates test n on a uniform pad
r ← PMF.uniformOfFintype (BitString n).
Exact single-query PRF-pad reduction for an explicit OracleDistinguisher in the
one-query, fixed-nonce case (after [BS23], Section 7.4): if D simulates
padDistinguisher seed hash forger in both prfRealGame and prfIdealGame at parameter n, then
the real-valued one-time forgery probability is at most ε.toReal plus the concrete PRF
distinguishing advantage of D at n.
Exact single-query PRF-pad reduction for prfOneTimeGame in the one-query, fixed-nonce
case (after [BS23], Section 7.4): replacing the uniform pad
r ← PMF.uniformOfFintype (BitString n) with the fixed-nonce PRF pad prfPadDist family n bounds
the real-valued one-time forgery probability at parameter n by ε.toReal plus the concrete PRF
distinguishing advantage of prfPadDistinguisher test between prfRealGame and prfIdealGame.
Admissibility (IsOraclePPT encBool) and the asymptotic corollary from
PseudorandomFunction family are not asserted here.
Exact single-query PRF-pad reduction for prfOneTimeStrongGame in the one-query,
fixed-nonce case (after [BS23], Section 7.4); admissibility (IsOraclePPT encBool) and
the asymptotic PseudorandomFunction corollary are not asserted here.
Exact single-query PRF-pad reduction for ProbComp samplers and forgers in the one-query,
fixed-nonce case (after [BS23], Section 7.4): at parameter n, any ProbComp hash-key
sampler seed, query program query, and forgery program forge induce the single-query PRF
distinguisher via probPadTest, without asserting IsOraclePPT encBool admissibility or an
asymptotic PseudorandomFunction corollary.
Strong-unforgeability version of prfOneTimeGame_ofProbComp_le.
prfPadDistinguisher test is uniformly strict oracle-PPT (IsOraclePPT encBool) whenever
running test n on the n-bit view of a raw pad word is uniformly strict PPT in (n, word).
Executable ProbComp one-time pad test induced by a uniform word-level hash-key sampler seed,
hash evaluator hash, signing query query, and forgery program forge: at security parameter n
and pad r : BitString n, it runs probPadTest with digest BitString.ofList n (hash n k m) and
candidate tag BitString.ofList n p.2.
Instances For
If seed, hash, query, and forge are uniformly polynomial-time / strict PPT in their
encoded inputs, then wordProbPadTest on the n-bit view of a raw pad word is uniformly strict
PPT.
prfPadDistinguisher (wordProbPadTest seed hash query forge) is uniformly strict oracle-PPT
(IsOraclePPT encBool) for any uniform polynomial-time / strict-PPT family (seed, hash, query, forge).
Asymptotic one-query fixed-nonce PRF-masked Carter–Wegman EUF-CMA security
(after [BS23], Section 7.4): if family is a PseudorandomFunction, each
(seed n, hash n) is (ε n)-almost-Δ-universal with Negligible ε, and test is a uniformly
strict-PPT pad test realizing padDistinguisher (seed n) (hash n) (forger n) at every n, then the
one-time forgery probability Game.succProbability (prfOneTimeGame ...) is Negligible.
Asymptotic one-query fixed-nonce PRF-masked Carter–Wegman SUF-CMA security (after [BS23], Section 7.4).
Asymptotic one-query fixed-nonce PRF-masked Carter–Wegman EUF-CMA security for uniform word-level families (after [BS23], Section 7.4).
Asymptotic one-query fixed-nonce PRF-masked Carter–Wegman SUF-CMA security for uniform word-level families (after [BS23], Section 7.4).
Multi-query fresh-nonce PRF-masked Carter–Wegman MAC (after Boneh–Shoup Section 7.5) #
Counter Carter–Wegman signing handler driven by a deterministic pad sequence padSeq : ℕ → Y:
on the i-th query m (i = pads.length), it uses the pad r = padSeq pads.length, appends
(m, r) to the pad log, and returns sign hash k r m.
Instances For
If prog makes at most Q queries, then running prog against counterSeqHandler from pads
depends only on the pads padSeq i for i ∈ [pads.length, pads.length + Q).
When table ← PMF.uniformOfFintype (ι → Y) is a uniformly random function and nonce : ℕ → ι
is injective on [pads.length, pads.length + Q), running any Q-query-bounded program prog
against counterSeqHandler hash k (fun i => table (nonce i)) from pads has the exact same
distribution as running prog against counterRealHandler hash k from pads.
The issued-slot EUF-CMA experiment for the counter Carter–Wegman MAC under an arbitrary
pad-sequence distribution padSeqDist : PMF (ℕ → Y).
Instances For
The issued-counter global-message-freshness EUF-CMA experiment under an arbitrary
pad-sequence distribution padSeqDist : PMF (ℕ → Y).
Instances For
The issued-slot strong SUF-CMA experiment under an arbitrary pad-sequence distribution
padSeqDist : PMF (ℕ → Y).
Instances For
The induced multi-query pad-sequence distinguisher (ℕ → Y) → PMF Bool that samples k ← seed
and s ← forger.coins, simulates forger.forge s using counterSeqHandler hash k padSeq, and
evaluates checkCounterSlot hash k.
Instances For
If forger makes at most Q signing queries, then counterPadSeqDistinguisher depends only on
the first Q pads padSeq 0, ..., padSeq (Q - 1).
When table ← PMF.uniformOfFintype (ι → Y) and nonce : ℕ → ι is injective on
{0, ..., Q - 1}, sampling table and running counterPadSeqDistinguisher on
fun i => table (nonce i) has the exact same distribution as counterSlotGame seed hash forger.
The multi-query pad-sequence distribution on ℕ → BitString n obtained by sampling a uniform
n-bit PRF key key ← BitString.uniformList n and evaluating prfOracle family n key (nonce i) at
each counter index i.
Instances For
The multi-query fresh-nonce PRF-masked Carter–Wegman issued-slot EUF-CMA experiment
(after [BS23], Section 7.5, Theorem 7.10), where the signer's counter schedule nonce
fixes the nonces and checkCounterSlot accepts only issued counter indices (pads[idx]? = some r),
rejecting unissued idx.
Instances For
The multi-query fresh-nonce PRF-masked Carter–Wegman issued-counter EUF-CMA experiment
(after [BS23], Section 7.5, Theorem 7.10), where the signer's counter schedule nonce
fixes the nonces and checkCounterGlobal accepts only issued counter indices
(pads[idx]? = some r), rejecting unissued idx.
Instances For
The multi-query fresh-nonce PRF-masked Carter–Wegman issued-slot strong SUF-CMA experiment
(after [BS23], Section 7.5, Theorem 7.10), where the signer's counter schedule nonce
fixes the nonces and checkCounterStrong accepts only issued counter indices
(pads[idx]? = some r), rejecting unissued idx.
Instances For
One step of multi-pad collection at security parameter n under nonce schedule nonce:
query the external oracle at nonce n pads.length, take at most n reply bits, and append the
reply to pads.
Instances For
Multi-query PRF OracleDistinguisher for a query budget Q : ℕ → ℕ, nonce schedule
nonce : ℕ → ℕ → List Bool, and pad-sequence test
test : (k : ℕ) → (ℕ → BitString k) → ProbComp Bool: at security parameter n, collect Q n
oracle replies at nonce n 0, ..., nonce n (Q n - 1) and run test n on the n-bit views of the
collected replies.
Instances For
In prfRealGame, when forger makes at most Q n signing queries and test n realizes
counterPadSeqDistinguisher seed hash forger, prfMultiPadDistinguisher Q nonce test has the exact
outcome distribution of prfCounterSlotGame seed family n (nonce n) hash forger.
In prfIdealGame, when forger makes at most Q n signing queries, each nonce n i
(i < Q n) has length n, the Q n nonces are pairwise distinct on {0, ..., Q n - 1}, and
test n realizes counterPadSeqDistinguisher seed hash forger,
prfMultiPadDistinguisher Q nonce test has the exact outcome distribution of the ideal
counterSlotGame seed hash forger.
Multi-query fresh-nonce PRF-masked Carter–Wegman issued-slot reduction
(after [BS23], Section 7.5, Theorem 7.10): when hash is ε-almost-Δ-universal
(ε ≠ ⊤), forger makes at most Q n signing queries, and nonce n 0, ..., nonce n (Q n - 1)
are pairwise distinct n-bit nonces fixed by the signer's counter schedule, the real-valued
issued-slot forgery probability in prfCounterSlotGame is at most ε.toReal plus the concrete PRF
distinguishing advantage of prfMultiPadDistinguisher Q nonce test at parameter n (with
unissued counter indices rejected by checkCounterSlot).
Multi-query fresh-nonce PRF-masked Carter–Wegman issued-counter EUF-CMA reduction (after [BS23], Section 7.5, Theorem 7.10).
Multi-query fresh-nonce PRF-masked Carter–Wegman issued-slot SUF-CMA reduction (after [BS23], Section 7.5, Theorem 7.10).
prfMultiPadDistinguisher Q nonce test is uniformly strict oracle-PPT (IsOraclePPT encBool)
whenever the query budget Q, the nonce schedule nonce, and the pad-list test test are
uniformly polynomial-time / strict PPT.
Asymptotic multi-query fresh-nonce PRF-masked Carter–Wegman issued-slot security
(after [BS23], Section 7.5, Theorem 7.10). The query bound hforger and nonce
conditions hnonce_len, hnonce_inj are required only eventually (∀ᶠ n in Filter.atTop), so
any polynomial query budget Q n (where Q n ≤ 2 ^ n holds for all sufficiently large n) is
covered without patching small n.
Asymptotic multi-query fresh-nonce PRF-masked Carter–Wegman issued-counter EUF-CMA security (after [BS23], Section 7.5, Theorem 7.10).
Asymptotic multi-query fresh-nonce PRF-masked Carter–Wegman issued-slot SUF-CMA security (after [BS23], Section 7.5, Theorem 7.10).
Full nonce-based Carter–Wegman MAC (Boneh–Shoup Attack Game 7.4 and Theorem 7.10) #
An adaptive multi-query forger in the nonce-based MAC game ([BS23], Section 7.5.1,
Attack Game 7.4, p. 274): it draws private coins s ← coins, makes adaptive signing queries
(m, x) : M × N (receiving tag t : Y), and outputs a candidate forgery
((m', x'), t') : (M × N) × Y.
- Coins : Type
Type of the forger's private coins.
Distribution of the forger's private coins.
- forge : self.Coins → OracleComp (fun (x : M × N) => Y) ((M × N) × Y)
Adaptive oracle program making signing queries
(m, x) : M × Nand outputting a candidate forgery((m', x'), t') : (M × N) × Y.
Instances For
Nonce-based Carter–Wegman signing handler driven by a pad function padFn : N → Y:
on signing query q = (m, x), compute t = sign hash k (padFn x) m, append (q, t) to the
query–tag transcript tr, and return t.
Instances For
Simulated key-independent nonce signing handler: on query q = (m, x), sample a uniform tag
t ← PMF.uniformOfFintype Y, append (q, t) to the query–tag transcript tr, and return t.
Instances For
Reconstruct a pad function N → Y from a query–tag transcript tr : List ((M × N) × Y) and a
background table table : N → Y, setting the pad at each queried nonce x_i to
-hash k m_i + t_i while retaining table x at all unqueried nonces x.
Instances For
At any nonce x not appearing in tr, reconstructPadFn hash k tr table x = table x.
If table₁ and table₂ agree away from x, then so do reconstructPadFn hash k tr table₁
and reconstructPadFn hash k tr table₂.
Updating table at x before folding tr ++ [((m, x), t)] is overwritten by the final update
at x.
When x ∉ tr.map (fun e => e.1.2), appending ((m, x), sign hash k (table x) m) leaves
reconstructPadFn hash k tr table unchanged.
For any entry e ∈ tr in a transcript with distinct nonces (tr.map (fun e => e.1.2)).Nodup,
reconstructPadFn evaluates at e.1.2 to -hash k e.1.1 + e.2.
Single-step pad-to-tag resampling identity for a fresh nonce x ∉ tr.map (fun e => e.1.2):
sampling table ← PMF.uniformOfFintype (N → Y) and signing m at x under
reconstructPadFn hash k tr table is identical to sampling a uniform tag
t ← PMF.uniformOfFintype Y and reconstructing
reconstructPadFn hash k (tr ++ [((m, x), t)]) table.
Multi-query simulation equivalence for nonceFnHandler under a random function:
for any post-processing post that collapses to a constant distribution c whenever the transcript
has a repeated nonce (¬ (tr'.map (fun e => e.1.2)).Nodup), running prog against
nonceFnHandler hash k (reconstructPadFn hash k tr table) over
table ← PMF.uniformOfFintype (N → Y) has the exact same distribution as running prog against the
key-independent nonceSimHandler and reconstructing reconstructPadFn hash k res.2 table at the
end.
Multi-query simulation equivalence for nonceFnHandler on ProbOracleComp:
lifting uniform_bind_run_interpret_nonceFnHandler to programs with private coin flips
(ProbOracleComp (fun _ : M × N => Y) α).
Nonce-based SUF-CMA verification predicate on a query–tag transcript tr and pad function
padFn ([BS23], Section 7.5.1, Attack Game 7.4, p. 274): all signing queries in tr used
distinct nonces ((tr.map (fun e => e.1.2)).Nodup), the candidate out = ((m', x'), t') was not
returned by any signing query (!tr.contains out), and verify hash k (padFn x') m' t' = true.
Instances For
Nonce-based EUF-CMA (message-freshness) verification predicate on a query–tag transcript tr
and pad function padFn: all signing queries in tr used distinct nonces, the message
m' = out.1.1 was never queried (!(tr.map (fun e => e.1.1)).contains out.1.1), and
verify hash k (padFn x') m' t' = true.
Instances For
Global message freshness (checkNonceEUF) implies pair freshness (checkNonceSUF).
The nonce-based Carter–Wegman SUF-CMA experiment under an arbitrary pad-function distribution
rfDist : PMF (N → Y).
Instances For
The nonce-based Carter–Wegman EUF-CMA (message-freshness) experiment under an arbitrary
pad-function distribution rfDist : PMF (N → Y).
Instances For
Monotonicity from message-freshness (maskedNonceGame) to triple-freshness
(maskedNonceStrongGame).
The induced pad-function distinguisher (N → Y) → PMF Bool for maskedNonceStrongGame.
Instances For
Under IsDeltaUniversalHash seed hash ε, for any fixed transcript tr and candidate forgery
out = ((m', x'), t'), the probability over k ← seed and table ← PMF.uniformOfFintype (N → Y)
that checkNonceSUF hash k (reconstructPadFn hash k tr table) tr out = true is at most
max ε (Fintype.card Y : ℝ≥0∞)⁻¹: at most ε when x' is an issued nonce in tr, and at most
(Fintype.card Y : ℝ≥0∞)⁻¹ when x' is an unissued nonce.
The ideal nonce-based Carter–Wegman SUF-CMA experiment ([BS23], Section 7.5.1,
Attack Game 7.4 and Theorem 7.10, p. 274) under a truly random function
rf ← PMF.uniformOfFintype (N → Y).
Instances For
The ideal nonce-based Carter–Wegman EUF-CMA (message-freshness) experiment implied by the SUF
game (nonceStrongGame) under a truly random function rf ← PMF.uniformOfFintype (N → Y).
Instances For
Monotonicity from the message-freshness variant (nonceGame) to nonceStrongGame.
Ideal nonce-based Carter–Wegman SUF-CMA security (max bound) ([BS23],
Section 7.5.1, Theorem 7.10, p. 274): under IsDeltaUniversalHash seed hash ε, every adaptive
NonceForger wins nonceStrongGame with probability at most max ε (Fintype.card Y : ℝ≥0∞)⁻¹.
Ideal nonce-based Carter–Wegman SUF-CMA security (+ bound) ([BS23],
Section 7.5.1, Theorem 7.10, p. 274): winning probability is at most
ε + (Fintype.card Y : ℝ≥0∞)⁻¹.
Ideal nonce-based Carter–Wegman EUF-CMA (message-freshness) security (max bound).
Ideal nonce-based Carter–Wegman EUF-CMA (message-freshness) security (+ bound).
Hybrid bound for maskedNonceStrongGame ([BS23], Section 7.5.1, Theorem 7.10,
p. 274): under IsDeltaUniversalHash seed hash ε (ε ≠ ⊤), the real-valued SUF-CMA forgery
probability under rfDist is at most ε.toReal + ((Fintype.card Y : ℝ≥0∞)⁻¹).toReal plus the
distinguishing advantage of nonceFnDistinguisher between rfDist and
PMF.uniformOfFintype (N → Y).
The PRF-masked nonce-based Carter–Wegman SUF-CMA experiment ([BS23], Section 7.5.1, Attack Game 7.4 and Theorem 7.10, p. 274).
Instances For
The PRF-masked nonce-based Carter–Wegman EUF-CMA (message-freshness) experiment implied by
prfNonceStrongGame.
Instances For
Nonce-based Carter–Wegman SUF-CMA reduction ([BS23], Section 7.5.1, Theorem 7.10,
p. 274): if D simulates nonceFnDistinguisher seed hash forger in prfRealGame and
prfIdealGame, then the real-valued SUF-CMA forgery probability in prfNonceStrongGame is bounded
by ε.toReal + (2 ^ n)⁻¹ plus the PRF distinguishing advantage of D.
Nonce-based Carter–Wegman EUF-CMA (message-freshness) reduction implied by
prfNonceStrongGame_le_of_distinguisher.
Asymptotic nonce-based Carter–Wegman SUF-CMA security ([BS23], Section 7.5.1,
Theorem 7.10, p. 274): given an OracleDistinguisher D satisfying IsOraclePPT encBool D
together with hypotheses hreal and hideal asserting that D simulates
nonceFnDistinguisher (seed n) (hash n) (forger n) in prfRealGame and prfIdealGame (forger
itself carries no efficiency assumption), prfNonceStrongGame has negligible success probability
under PseudorandomFunction family and a statistical IsDeltaUniversalHash family with negligible
ε.
Asymptotic nonce-based Carter–Wegman EUF-CMA (message-freshness) security implied by
negligible_prfNonceStrongGame; as there, D, hreal, and hideal assume the PRF reduction
wrapper while forger carries no efficiency assumption.
Computational nonce-based Carter–Wegman MAC (NonceMACScheme)
([BS23], Section 7.5.1, Attack Game 7.4 and Theorem 7.10, p. 274):
given a polynomial-time message-length schedule msgLen : ℕ → ℕ, a strict-PPT hash-key sampler
seed : ℕ → ProbComp (List Bool), a polynomial-time hash evaluator
hash : ℕ → List Bool → List Bool → List Bool, and a polynomial-time PRF family
family : List Bool → List Bool → List Bool:
keyGen nsamplesk ← seed nandprfKey ← BitString.sampleList n, returning the framed pairencPair encBits encBits (k, prfKey).sign sk msg noncerecoversk := unframe sk,prfKey := dropFrame sk, andn := prfKey.length; ifmsg.length == msgLen nandnonce.length == n, it returns then-bit Carter–Wegman tagBitString.listXor n [hash n k msg, (prfOracle family n prfKey nonce).take n], and otherwise[].verify sk msg nonce tagchecksmsg.length == msgLen n,nonce.length == n, andBitString.listXor n [hash n k msg, (prfOracle family n prfKey nonce).take n] == tag.
Instances For
Open stateful handler for the nonce-based Carter–Wegman PRF reduction
([BS23], Section 7.5.1, Theorem 7.10, p. 274): given the hash key k and a framed
signing request request.2, it decodes msg := unframe request.2 and
nonce := dropFrame request.2. When msg.length == msgLen n and nonce.length == n, it queries
the external oracle on ((), nonce) (reading n bits pad), computes
tag := BitString.listXor n [hash n k msg, pad], and prepends ((msg, nonce), tag) to
queriedTriples; otherwise it returns [] and prepends ((msg, nonce), []) without querying the
external oracle.
Instances For
Oracle reduction turning an adaptive word-level NonceMACForger into an OracleDistinguisher
for the PRF security game ([BS23], Section 7.5.1, Theorem 7.10, p. 274):
- Sample
k ← seed n. - Run
adversary n [], answering each signing query viacwNonceLogHandler msgLen hash n k. - Query the external oracle on the candidate nonce
out.1.1.2(readingnbitspad), and accept iffmsg.length == msgLen n,nonce.length == n, all queried nonces were pairwise distinct, the candidate((msg, nonce), tag)triple was not returned by the signing oracle, andBitString.listXor n [hash n k msg, pad] == tag.
Instances For
prfNonceToPrfDistinguisher is uniformly strict oracle-PPT (IsOraclePPT encBool) whenever
msgLen, seed, hash, and adversary are uniformly polynomial-time / strict PPT.
Running prfNonceToPrfDistinguisher msgLen seed hash adversary in prfRealGame family
produces the exact same Boolean distribution as (carterWegmanNonceMAC ...).sufCmaGame adversary n.
Ideal-game bound for prfNonceToPrfDistinguisher ([BS23], Section 7.5.1,
Theorem 7.10, p. 274): under IsDeltaUniversalHash (ProbComp.eval (seed n)) ... ε, the ideal-game
acceptance probability of prfNonceToPrfDistinguisher msgLen seed hash adversary at parameter n
is at most max ε ((2 : ℝ≥0∞) ^ n)⁻¹.
Quantitative SUF-CMA bound for carterWegmanNonceMAC ([BS23], Section 7.5.1,
Theorem 7.10, p. 274): at security parameter n, the SUF-CMA forgery probability of any
NonceMACForger against carterWegmanNonceMAC is at most ε.toReal + (2 ^ n)⁻¹ plus the PRF
distinguishing advantage of prfNonceToPrfDistinguisher msgLen seed hash adversary.
Asymptotic NonceMACScheme.SUFCMA security of carterWegmanNonceMAC
([BS23], Section 7.5.1, Theorem 7.10, p. 274): if family is a PseudorandomFunction
and (seed n, hash n) is an (ε n)-almost-Δ-universal hash family on BitString (msgLen n) into
BitString n with Negligible ε, then carterWegmanNonceMAC satisfies NonceMACScheme.SUFCMA.
Asymptotic NonceMACScheme.EUFCMA security of carterWegmanNonceMAC
([BS23], Section 7.5.1, Theorem 7.10, p. 274).
Randomized Carter–Wegman MAC (Boneh–Shoup Section 7.4, Theorem 7.9) #
An adaptive multi-query forger against the randomized Carter–Wegman MAC ([BS23],
Section 7.4, Theorem 7.9, p. 270): it draws private coins s ← coins, makes adaptive signing
queries m : M (receiving (x, t) : N × Y where x is a random nonce chosen by the signer), and
outputs a candidate forgery ((m', x'), t') : (M × N) × Y.
- Coins : Type
Type of the forger's private coins.
Distribution of the forger's private coins.
- forge : self.Coins → OracleComp (fun (x : M) => N × Y) ((M × N) × Y)
Adaptive oracle program making signing queries
m : Mand outputting a candidate forgery((m', x'), t') : (M × N) × Y.
Instances For
Randomized Carter–Wegman signing handler driven by a pad function padFn : N → Y
([BS23], Section 7.4, p. 267): on signing query m, sample a uniform nonce
x ← PMF.uniformOfFintype N, compute t = sign hash k (padFn x) m, append ((m, x), t) to the
transcript tr, and return (x, t).
Instances For
Simulated key-independent randomized signing handler: on query m, sample independent uniform
(x, t) ← PMF.uniformOfFintype N × PMF.uniformOfFintype Y, append ((m, x), t) to tr, and
return (x, t).
Instances For
Multi-query simulation equivalence for randomNonceFnHandler under a random function:
for any post-processing post that collapses to a constant distribution c whenever the transcript
has a repeated nonce (¬ (tr'.map (fun e => e.1.2)).Nodup), running prog against
randomNonceFnHandler hash k (reconstructPadFn hash k tr table) over
table ← PMF.uniformOfFintype (N → Y) has the exact same distribution as running prog against
randomNonceSimHandler and reconstructing reconstructPadFn hash k res.2 table at the end.
Birthday-collision bound for randomNonceSimHandler: starting from tr, any Q-query-bounded
program produces a transcript with a repeated nonce with probability at most
((∑ i ∈ Finset.range Q, (tr.length + i) : ℕ) : ℝ≥0∞) / Fintype.card N when
(tr.map (fun e => e.1.2)).Nodup, and at most 1 otherwise.
Randomized Carter–Wegman SUF-CMA verification predicate ([BS23], Section 7.4,
Theorem 7.9, p. 270): the candidate out = ((m', x'), t') was not returned by any signing query
(!tr.contains out) and verify hash k (padFn x') m' t' = true.
Instances For
Randomized Carter–Wegman EUF-CMA (message-freshness) verification predicate: the message
m' = out.1.1 was never queried (!(tr.map (fun e => e.1.1)).contains out.1.1) and
verify hash k (padFn x') m' t' = true.
Instances For
Randomized Carter–Wegman EUF-CMA implies SUF-CMA (checkRandomNonceSUF), since a fresh message
m' cannot appear in any issued transcript triple ((mᵢ, xᵢ), tᵢ) ∈ tr.
The randomized Carter–Wegman SUF-CMA experiment under an arbitrary pad-function distribution
rfDist : PMF (N → Y).
Instances For
The randomized Carter–Wegman EUF-CMA (message-freshness) experiment under an arbitrary
pad-function distribution rfDist : PMF (N → Y).
Instances For
In maskedRandomNonceGame, message-freshness forgery probability is bounded by strong
unforgeability (maskedRandomNonceStrongGame).
The induced pad-function distinguisher (N → Y) → PMF Bool for maskedRandomNonceStrongGame.
Instances For
Factoring maskedRandomNonceStrongGame through randomNonceFnDistinguisher.
The ideal randomized Carter–Wegman SUF-CMA experiment ([BS23], Section 7.4,
Theorem 7.9, p. 270) under a truly random function rf ← PMF.uniformOfFintype (N → Y).
Instances For
The ideal randomized Carter–Wegman EUF-CMA (message-freshness) experiment under a truly random
function rf ← PMF.uniformOfFintype (N → Y).
Instances For
In randomNonceGame, message-freshness forgery probability is bounded by strong
unforgeability (randomNonceStrongGame).
Ideal randomized Carter–Wegman SUF-CMA security (∑ i < Q + max bound)
([BS23], Section 7.4, Theorem 7.9, p. 270): under IsDeltaUniversalHash seed hash ε,
any Q-query-bounded RandomNonceForger wins randomNonceStrongGame with probability at most
((∑ i ∈ Finset.range Q, i : ℕ) : ℝ≥0∞) / Fintype.card N + max ε (Fintype.card Y : ℝ≥0∞)⁻¹.
Ideal randomized Carter–Wegman SUF-CMA security ([BS23], Section 7.4,
Theorem 7.9, p. 270): under IsDeltaUniversalHash seed hash ε, any Q-query-bounded
RandomNonceForger wins randomNonceStrongGame with probability at most
(Q : ℝ≥0∞) ^ 2 / (2 * Fintype.card N) + (Fintype.card Y : ℝ≥0∞)⁻¹ + ε.
Ideal randomized Carter–Wegman EUF-CMA (message-freshness) security ([BS23], Section 7.4, Theorem 7.9, p. 270).
Hybrid bound for maskedRandomNonceStrongGame ([BS23], Section 7.4,
Theorem 7.9, p. 270): under IsDeltaUniversalHash seed hash ε (ε ≠ ⊤), any Q-query-bounded
RandomNonceForger wins maskedRandomNonceStrongGame with real-valued probability at most
((Q : ℝ≥0∞) ^ 2 / (2 * Fintype.card N)).toReal + ((Fintype.card Y : ℝ≥0∞)⁻¹).toReal + ε.toReal
plus the distinguishing advantage of randomNonceFnDistinguisher.
The PRF-masked randomized Carter–Wegman SUF-CMA experiment ([BS23], Section 7.4, Theorem 7.9, p. 270).
Instances For
The PRF-masked randomized Carter–Wegman EUF-CMA (message-freshness) experiment ([BS23], Section 7.4, Theorem 7.9, p. 270).
Instances For
Randomized Carter–Wegman SUF-CMA reduction ([BS23], Section 7.4, Theorem 7.9,
p. 270): if D simulates randomNonceFnDistinguisher seed hash forger in prfRealGame and
prfIdealGame, then any Q-query-bounded RandomNonceForger wins prfRandomNonceStrongGame with
real-valued probability at most (Q : ℝ) ^ 2 / (2 * 2 ^ n) + (2 ^ n)⁻¹ + ε.toReal plus the PRF
distinguishing advantage of D.
Randomized Carter–Wegman EUF-CMA (message-freshness) reduction ([BS23], Section 7.4, Theorem 7.9, p. 270).
Asymptotic randomized Carter–Wegman SUF-CMA security ([BS23], Section 7.4,
Theorem 7.9, p. 270): if family is a PseudorandomFunction, hash n is a family of
ε n-difference-universal hashes into BitString n with Negligible ε, forger n is bounded by
Q n queries with PolynomiallyBounded Q, and D is an IsOraclePPT encBool distinguisher that
simulates randomNonceFnDistinguisher in prfRealGame (hreal) and prfIdealGame (hideal),
then the SUF-CMA success probability Game.succProbability (prfRandomNonceStrongGame ...) is
Negligible. Note that this theorem assumes the PRF reduction wrapper D and its simulation
contracts hreal/hideal as hypotheses (whilst forger carries only the query bound hforger
and no efficiency certificate).
Asymptotic randomized Carter–Wegman EUF-CMA (message-freshness) security ([BS23],
Section 7.4, Theorem 7.9, p. 270), assuming the IsOraclePPT encBool PRF reduction wrapper D
and its simulation contracts hreal/hideal.
Multi-query simulation equivalence for randomNonceFnHandler on ProbOracleComp programs
under a random function: lifting uniform_bind_run_interpret_randomNonceFnHandler to programs
that also draw private coins via ProbComp.unifOracle.
Birthday-collision bound for randomNonceSimHandler on ProbOracleComp programs: starting
from tr, any Q-query-bounded ProbOracleComp program produces a transcript with a repeated
nonce with probability at most
((∑ i ∈ Finset.range Q, (tr.length + i) : ℕ) : ℝ≥0∞) / Fintype.card N when
(tr.map (fun e => e.1.2)).Nodup, and at most 1 otherwise.
Ideal randomized Carter–Wegman SUF-CMA bound for ProbOracleComp programs:
under IsDeltaUniversalHash seed hash ε, any Q-query-bounded ProbOracleComp program prog
against randomNonceFnHandler satisfies checkRandomNonceSUF on out res.1 with probability at
most (Q : ℝ≥0∞) ^ 2 / (2 * Fintype.card N) + (Fintype.card Y : ℝ≥0∞)⁻¹ + ε.
Word-level MACScheme packaging and IsOraclePPT PRF reduction (Theorem 7.9) #
Computational randomized Carter–Wegman MAC (MACScheme)
([BS23], Section 7.4, Theorem 7.9, pp. 267–270):
given a polynomial-time message-length schedule msgLen : ℕ → ℕ, a strict-PPT hash-key sampler
seed : ℕ → ProbComp (List Bool), a polynomial-time hash evaluator
hash : ℕ → List Bool → List Bool → List Bool, and a polynomial-time PRF family
family : List Bool → List Bool → List Bool:
keyGen nsamplesk ← seed nandprfKey ← BitString.sampleList n, returning the framed pairencPair encBits encBits (k, prfKey).sign sk msgrecoversk := unframe sk,prfKey := dropFrame sk, andn := prfKey.length, samples a fresh uniformn-bit noncenonce ← BitString.sampleList n, and whenmsg.length == msgLen nreturns the framed pairencPair encBits encBits (nonce, tag)wheretag = BitString.listXor n [hash n k msg, (prfOracle family n prfKey nonce).take n](and[]otherwise).verify sk msg fullTagdecodesnonce := unframe fullTag, computes the expectedn-bit tagtag := BitString.listXor n [hash n k msg, (prfOracle family n prfKey nonce).take n], and checksmsg.length == msgLen n,nonce.length == n, andencPair encBits encBits (nonce, tag) == fullTag.
Instances For
Open stateful handler for the randomized Carter–Wegman PRF reduction
([BS23], Section 7.4, Theorem 7.9, p. 270): given the hash key k and a signing request
msg := request.2, when msg.length == msgLen n it samples a fresh uniform n-bit nonce
nonce ← BitString.sampleList n, queries the external oracle on ((), nonce) (reading n bits
pad), computes tag := BitString.listXor n [hash n k msg, pad] and
fullTag := encPair encBits encBits (nonce, tag), and prepends (msg, fullTag) to queriedPairs;
otherwise it returns [] and prepends (msg, []) without querying the external oracle.
Instances For
Oracle reduction turning an adaptive word-level Forger into an OracleDistinguisher
for the PRF security game ([BS23], Section 7.4, Theorem 7.9, p. 270):
- Sample
k ← seed n. - Run
adversary n [], answering each signing query viacwRandomNonceLogHandler msgLen hash n k. - Query the external oracle on the candidate nonce
unframe out.1.2(readingnbitspad), and accept iffmsg.length == msgLen n,(unframe fullTag).length == n, the candidate(msg, fullTag)pair was not returned by the signing oracle, andencPair encBits encBits (unframe fullTag, BitString.listXor n [hash n k msg, pad]) == fullTag.
Instances For
prfRandomNonceToPrfDistinguisher is uniformly strict oracle-PPT (IsOraclePPT encBool)
whenever msgLen, seed, hash, and adversary are uniformly polynomial-time / strict PPT.
Real-game simulation for prfRandomNonceToPrfDistinguisher
([BS23], Section 7.4, Theorem 7.9, p. 270): running prfRandomNonceToPrfDistinguisher in
prfRealGame family at security parameter n has the exact same acceptance distribution as the
computational MACScheme.sufCmaGame of carterWegmanRandomMAC.
Ideal-game bound for prfRandomNonceToPrfDistinguisher
([BS23], Section 7.4, Theorem 7.9, p. 270): under
IsDeltaUniversalHash (ProbComp.eval (seed n)) ... ε, if adversary n [] makes at most Q signing
queries, the ideal-game acceptance probability of
prfRandomNonceToPrfDistinguisher msgLen seed hash adversary at parameter n is at most
(Q : ℝ≥0∞) ^ 2 / (2 * (2 : ℝ≥0∞) ^ n) + ((2 : ℝ≥0∞) ^ n)⁻¹ + ε.
Quantitative SUF-CMA bound for carterWegmanRandomMAC ([BS23], Section 7.4,
Theorem 7.9, p. 270): at security parameter n, the SUF-CMA forgery probability of any Q-query
Forger against carterWegmanRandomMAC is at most
(Q : ℝ) ^ 2 / (2 * (2 : ℝ) ^ n) + ((2 : ℝ) ^ n)⁻¹ + ε.toReal plus the PRF distinguishing
advantage of prfRandomNonceToPrfDistinguisher msgLen seed hash adversary.
Asymptotic MACScheme.SUFCMA security of carterWegmanRandomMAC
([BS23], Section 7.4, Theorem 7.9, p. 270): if family is a PseudorandomFunction and
(seed n, hash n) is an (ε n)-almost-Δ-universal hash family on BitString (msgLen n) into
BitString n with Negligible ε, then carterWegmanRandomMAC satisfies MACScheme.SUFCMA.
Asymptotic MACScheme.EUFCMA security of carterWegmanRandomMAC
([BS23], Section 7.4, Theorem 7.9, p. 270).
Asymptotic MACScheme.OneTimeEUFCMA security of carterWegmanRandomMAC
([BS23], Section 7.4, Theorem 7.9, p. 270).
Concrete Carter–Wegman instantiations #
Polynomial Carter–Wegman one-time MAC (xpolyHash) ([BS23], Section 7.4.1):
over a finite field F, authenticating messages of length at most ℓ via xpolyHash has
adaptive one-time EUF-CMA (and SUF-CMA) forgery probability at most (ℓ + 1) / |F|.
Polynomial Carter–Wegman multi-query issued-counter MAC (xpolyHash):
authenticating messages of length at most ℓ via xpolyHash with fresh pads per query has
adaptive multi-query issued-counter EUF-CMA forgery probability at most (ℓ + 1) / |F|.
Polynomial Carter–Wegman multi-query issued-slot strong unforgeability (xpolyHash).
Boolean-matrix Carter–Wegman one-time MAC (BitString.LinearHash.hash):
hashing n-bit messages to m-bit tags with a uniform Boolean matrix has adaptive one-time
forgery probability at most 2⁻ᵐ.
Boolean-matrix Carter–Wegman multi-query issued-counter MAC (BitString.LinearHash.hash):
adaptive multi-query issued-counter EUF-CMA forgery probability is at most 2⁻ᵐ.
Boolean-matrix Carter–Wegman multi-query issued-slot strong unforgeability
(BitString.LinearHash.hash).
Exact single-query PRF-pad reduction for Boolean-matrix Carter–Wegman
(BitString.LinearHash.hash) in the one-query, fixed-nonce case (after [BS23],
Section 7.4): hashing n-bit messages to m-bit tags with a uniform Boolean matrix and masking by
a fixed-nonce PRF evaluation at security parameter m has real-valued one-time forgery probability
at most (2 ^ m)⁻¹ plus the concrete PRF distinguishing advantage of prfPadDistinguisher test at
parameter m (without asserting IsOraclePPT encBool admissibility or an asymptotic
PseudorandomFunction corollary).
Subset-sum Carter–Wegman one-time MAC (BitString.LinearHash / BitString.SubsetSum.hash):
hashing binary words ι → Bool into a finite additive abelian group G via uniform subset-sum
weights has adaptive one-time forgery probability at most 1 / |G|.
Subset-sum Carter–Wegman multi-query issued-counter MAC (BitString.SubsetSum.hash):
adaptive multi-query issued-counter EUF-CMA forgery probability is at most 1 / |G|.
Pairwise-independent Carter–Wegman one-time MAC: any pairwise independent hash family
hash : K → M → Y into a finite additive group Y has adaptive one-time forgery probability at
most 1 / |Y|.
Pairwise-independent Carter–Wegman multi-query issued-counter MAC: any pairwise independent
hash family hash : K → M → Y has adaptive multi-query issued-counter forgery probability at most
1 / |Y|.
Polynomial Carter–Wegman nonce-based MAC (xpolyHash) ([BS23], Section 7.4.1
and Section 7.5.1, Theorem 7.10, p. 274): over a finite field F and finite nonce space N,
authenticating messages of length at most ℓ via xpolyHash has adaptive nonce-based SUF-CMA
forgery probability at most (ℓ + 1) / |F| (since 1 / |F| ≤ (ℓ + 1) / |F|).
Polynomial Carter–Wegman nonce-based EUF-CMA (message-freshness) security (xpolyHash).
Polynomial Carter–Wegman randomized MAC (xpolyHash) ([BS23], Section 7.4,
Theorem 7.9, p. 270): over a finite field F and nonempty finite nonce space N, any
Q-query-bounded RandomNonceForger wins randomNonceStrongGame with probability at most
(Q : ℝ≥0∞) ^ 2 / (2 * Fintype.card N) + (Fintype.card F : ℝ≥0∞)⁻¹ + (ℓ + 1) / Fintype.card F.
Boolean-matrix Carter–Wegman nonce-based MAC (BitString.LinearHash.hash):
hashing n-bit messages to m-bit tags with a uniform Boolean matrix has adaptive nonce-based
SUF-CMA forgery probability at most 2⁻ᵐ (since max (2⁻ᵐ) (2⁻ᵐ) = 2⁻ᵐ).
Boolean-matrix Carter–Wegman nonce-based EUF-CMA (message-freshness) security
(BitString.LinearHash.hash).
Boolean-matrix Carter–Wegman randomized MAC (BitString.LinearHash.hash)
([BS23], Section 7.4, Theorem 7.9, p. 270): any Q-query-bounded RandomNonceForger
wins randomNonceStrongGame with probability at most
(Q : ℝ≥0∞) ^ 2 / (2 * Fintype.card N) + ((2 : ℝ≥0∞) ^ m)⁻¹ + ((2 : ℝ≥0∞) ^ m)⁻¹.
Subset-sum Carter–Wegman nonce-based MAC (BitString.SubsetSum.hash):
adaptive nonce-based SUF-CMA forgery probability is at most 1 / |G|.
Pairwise-independent Carter–Wegman nonce-based MAC: any pairwise independent hash family
hash : K → M → Y has adaptive nonce-based SUF-CMA forgery probability at most 1 / |Y|.
Sampling an (n * msgLen n)-bit Boolean-matrix seed is uniformly strict PPT whenever msgLen
is computable in polynomial time.
Uncurried BitString.LinearHash.wordHash is computable in plain polynomial time.
Under a uniform (n * msgLen n)-bit seed BitString.sampleList (n * msgLen n), the executable
Boolean-matrix hash BitString.LinearHash.wordHash n on BitString (msgLen n) into BitString n
is (2 ^ n)⁻¹-almost-Δ-universal (IsDeltaUniversalHash).
Concrete computational nonce-based Carter–Wegman MAC (NonceMACScheme) from Boolean-matrix
linear hashing (BitString.LinearHash.wordHash) and a PRF family family
([BS23], Section 7.5.1, Theorem 7.10, p. 274).
Instances For
Quantitative SUF-CMA bound for linearHashNonceMAC
([BS23], Section 7.5.1, Theorem 7.10, p. 274): at security parameter n, the SUF-CMA
forgery probability of any NonceMACForger against linearHashNonceMAC is at most
2 * (2 ^ n)⁻¹ plus the PRF distinguishing advantage of prfNonceToPrfDistinguisher.
Asymptotic NonceMACScheme.SUFCMA security of linearHashNonceMAC
([BS23], Section 7.5.1, Theorem 7.10, p. 274): for any PseudorandomFunction family and
polynomial-time message-length schedule msgLen, linearHashNonceMAC satisfies
NonceMACScheme.SUFCMA.
Asymptotic NonceMACScheme.EUFCMA security of linearHashNonceMAC
([BS23], Section 7.5.1, Theorem 7.10, p. 274).
Concrete computational randomized Carter–Wegman MAC (MACScheme) from Boolean-matrix linear
hashing (BitString.LinearHash.wordHash) and a PRF family family
([BS23], Section 7.4, Theorem 7.9, p. 270).
Instances For
Quantitative SUF-CMA bound for linearHashRandomMAC
([BS23], Section 7.4, Theorem 7.9, p. 270): at security parameter n, the SUF-CMA
forgery probability of any Q-query Forger against linearHashRandomMAC is at most
(Q : ℝ) ^ 2 / (2 * (2 : ℝ) ^ n) + ((2 : ℝ) ^ n)⁻¹ + ((2 : ℝ) ^ n)⁻¹ plus the PRF distinguishing
advantage of prfRandomNonceToPrfDistinguisher.
Asymptotic MACScheme.SUFCMA security of linearHashRandomMAC
([BS23], Section 7.4, Theorem 7.9, p. 270): for any PseudorandomFunction family and
polynomial-time message-length schedule msgLen, linearHashRandomMAC satisfies
MACScheme.SUFCMA.
Asymptotic MACScheme.EUFCMA security of linearHashRandomMAC
([BS23], Section 7.4, Theorem 7.9, p. 270).
Asymptotic MACScheme.OneTimeEUFCMA security of linearHashRandomMAC
([BS23], Section 7.4, Theorem 7.9, p. 270).