Uniform message authentication codes and PRF-based MACs #
A uniform symmetric message authentication code (MACScheme) consists of a polynomial-time
message-length schedule msgLen : ℕ → ℕ (defaulting to id), a strict probabilistic
polynomial-time key generator keyGen, a strict probabilistic polynomial-time tag generator sign,
and a deterministic polynomial-time tag verifier verify that accepts every tag produced by sign
on a msgLen n-bit message under a secret key sampled at security parameter n. Unlike digital
signatures (SignatureScheme), verification uses the same secret key as tag generation, and the
adversary receives no public key.
We formalize both strong (fresh-pair) existential unforgeability under adaptive chosen-message
attack (sufCmaGame, SUFCMA) and under one-time adaptive chosen-message attack (sufOneTimeGame,
OneTimeSUFCMA) as in
Boneh and Shoup, Attack Game 6.1 / Definition 6.2 and Section 7.6,
and ordinary fresh-message existential unforgeability under adaptive chosen-message attack
(eufCmaGame, EUFCMA) and under one-time adaptive chosen-message attack (eufOneTimeGame,
OneTimeEUFCMA) against uniform strict oracle-PPT forgers (IsOraclePPT). Both adaptive games
share the pair-logging execution core signingPairOracle (and oneTimeSigningPairOracle in the
one-time setting): sufCmaGame records returned
(msg, tag) pairs and accepts any valid msgLen n-bit forgery pair (msg, tag) that was never
returned (!queriedPairs.contains (msg, tag)), even on a previously queried message, whereas
eufCmaGame rejects any candidate forgery whose message was previously queried
(!queried.contains msg). As in the source, tagging queries lie in the message space: at parameter
n every tagging oracle answers a query that is not a msgLen n-bit word with the empty word,
without tagging or recording it, so such a query does not use up a one-time answer. We also provide
schedule reindexing (MACScheme.reindex,
MACScheme.reindexForger, SUFCMA.reindex, OneTimeSUFCMA.reindex, EUFCMA.reindex,
OneTimeEUFCMA.reindex), which
adapts any MACScheme along a strictly monotone polynomial-time parameter schedule ℓ : ℕ → ℕ so
that at security parameter n it authenticates M.msgLen (ℓ n)-bit messages.
We prove the quantitative bounds
$$\Pr[\text{EUF-CMA}] \le \Pr[\text{SUF-CMA}], \qquad \Pr[\text{1-EUF-CMA}] \le \Pr[\text{1-SUF-CMA}]$$
(succProbability_eufCmaGame_le_sufCmaGame, succProbability_eufOneTimeGame_le_sufOneTimeGame)
and the security implications SUFCMA → EUFCMA, SUFCMA → OneTimeSUFCMA, and
OneTimeSUFCMA → OneTimeEUFCMA (SUFCMA.eufCma, SUFCMA.oneTimeSUFCMA,
OneTimeSUFCMA.oneTimeEUFCMA). For randomized MACScheme.sign algorithms the two notions differ;
for MACs with a unique valid tag per (sk, msg) (eval_sufCmaGame_eq_eufCmaGame_of_unique_tag,
sufCma_iff_eufCma_of_unique_tag, eval_sufOneTimeGame_eq_eufOneTimeGame_of_unique_tag,
oneTimeSUFCMA_iff_oneTimeEUFCMA_of_unique_tag), including prfMAC, fresh-message and fresh-pair
unforgeability coincide.
We then prove that any uniform PseudorandomFunction yields a SUFCMA-, OneTimeSUFCMA-,
EUFCMA-, and OneTimeEUFCMA-secure deterministic MAC (prfMAC,
PseudorandomFunction.sufCma_prfMAC, PseudorandomFunction.oneTimeSUFCMA_prfMAC,
PseudorandomFunction.eufCma_prfMAC, PseudorandomFunction.oneTimeEUFCMA_prfMAC), with the
quantitative security reduction of
Boneh and Shoup, Section 6.3, Theorem 6.2:
$$\Pr[\text{Forge}] \le \mathrm{Adv}_{\mathrm{PRF}}(B(\mathcal{A}), n) + 2^{-n}.$$
Main definitions #
Cslib.Crypto.encBitsTriple: three bit words, the input encoding of MAC verification and of nonce-based tagging.Cslib.Crypto.MACScheme: uniform symmetric message authentication code onmsgLen n-bit messages (defaulting ton-bit messages).Cslib.Crypto.MACScheme.signingPairOracleOn: the guarded pair-logging tagging oracle, of which the full and one-time pair oracles are instances.Cslib.Crypto.MACScheme.signingPairOracle,sufCmaGame,SUFCMA: pair-logging tagging oracle and strong (fresh-pair) adaptive SUF-CMA experiment and security predicate (Boneh and Shoup, Attack Game 6.1 / Definition 6.2).Cslib.Crypto.MACScheme.oneTimeSigningPairOracle,sufOneTimeGame,OneTimeSUFCMA: one-time pair-logging tagging oracle and strong (fresh-pair) one-time MAC experiment and security predicate (Boneh and Shoup, Section 7.6, printed p. 275).Cslib.Crypto.MACScheme.signingOracle,eufCmaGame,EUFCMA: fresh-message adaptive EUF-CMA experiment and security predicate.Cslib.Crypto.MACScheme.oneTimeSigningOracle,eufOneTimeGame,OneTimeEUFCMA: one-time fresh-message adaptive EUF-CMA experiment and security predicate.Cslib.Crypto.MACScheme.toForgeExperiment:PK = Unittyped forgery-experiment bridge forMACScheme, reusingForger.toTyped.Cslib.Crypto.MACScheme.reindex,Cslib.Crypto.MACScheme.reindexForger: schedule reindexing of aMACSchemeand its adaptive forger reduction (viaGeneratorReindex.parameter).Cslib.Crypto.prfMAC: canonical deterministic MAC constructed from a keyed function family (Boneh and Shoup, Section 6.3).Cslib.Crypto.macLogHandlerOn,Cslib.Crypto.macLogHandler,Cslib.Crypto.macToPrfDistinguisher: domain-parameterized and fixed-length oracle logging handlers and reduction turning a MAC forger into a PRF distinguisher.Cslib.Crypto.encNonceTaggedMessage: the encoding of a nonce-tagged message((msg, nonce), tag).Cslib.Crypto.NonceMACForger,Cslib.Crypto.NonceMACScheme: uniform nonce-based message authentication code (sign : Key → Msg → Nonce → ProbComp Tag) and adaptive forger (Boneh and Shoup, Section 7.5, Attack Game 7.4).Cslib.Crypto.NonceMACScheme.signingPairOracle,sufCmaGame,eufCmaGame,SUFCMA,EUFCMA: nonce-respecting adaptive chosen-message security experiments and predicates requiring distinct queried nonces ((tr.map (fun e => e.1.2)).Nodup).
Main results #
Cslib.Crypto.MACScheme.isPPTOn_run_signingOracle,isPPTOn_sufCmaGame,isPPT_sufCmaGame,isPPTOn_sufOneTimeGame,isPPT_sufOneTimeGame,isPPTOn_eufCmaGame,isPPT_eufCmaGame: strict PPT certificates for the MAC SUF-CMA, one-time SUF-CMA, and EUF-CMA experiments.Cslib.Crypto.MACScheme.eufCmaGame_eq_forgeExperiment,eufOneTimeGame_eq_forgeExperiment,sufCmaGame_eq_forgeExperiment,sufOneTimeGame_eq_forgeExperiment: at each security parametern, the four word-level MAC games have the exact distributions offorgeExperimentwithPK = Unit.Cslib.Crypto.MACScheme.succProbability_eufCmaGame_le_sufCmaGame,succProbability_eufOneTimeGame_le_sufOneTimeGame,SUFCMA.eufCma,SUFCMA.oneTimeSUFCMA,OneTimeSUFCMA.oneTimeEUFCMA,SUFCMA.oneTimeEUFCMA: quantitative and asymptotic implications between strong, ordinary, and one-time unforgeability derived viaforgeExperiment.Cslib.Crypto.MACScheme.eval_sufCmaGame_eq_eufCmaGame_of_unique_tag,sufCma_iff_eufCma_of_unique_tag,eval_sufOneTimeGame_eq_eufOneTimeGame_of_unique_tag,oneTimeSUFCMA_iff_oneTimeEUFCMA_of_unique_tag: equivalence of strong and fresh-message unforgeability (multi-query and one-time) for MACs with a unique valid tag per message.Cslib.Crypto.MACScheme.isPPTOn_eufOneTimeGame,isPPT_eufOneTimeGame: strict PPT certificates for the one-time MAC EUF-CMA experiment.Cslib.Crypto.MACScheme.EUFCMA.oneTimeEUFCMA: full EUF-CMA security implies one-time EUF-CMA security.Cslib.Crypto.MACScheme.isOraclePPT_reindexForger,Cslib.Crypto.MACScheme.sufCmaGame_reindex,Cslib.Crypto.MACScheme.sufOneTimeGame_reindex,Cslib.Crypto.MACScheme.eufCmaGame_reindex,Cslib.Crypto.MACScheme.eufOneTimeGame_reindex,Cslib.Crypto.MACScheme.SUFCMA.reindex,Cslib.Crypto.MACScheme.OneTimeSUFCMA.reindex,Cslib.Crypto.MACScheme.EUFCMA.reindex,Cslib.Crypto.MACScheme.OneTimeEUFCMA.reindex: schedule reindexing preservesSUFCMA,OneTimeSUFCMA,EUFCMA, andOneTimeEUFCMAalong any strictly monotone polynomial-time schedule.Cslib.Crypto.eval_sufCmaGame_prfMAC,Cslib.Crypto.sufCma_prfMAC_iff_eufCma,Cslib.Crypto.eval_sufOneTimeGame_prfMAC,Cslib.Crypto.oneTimeSUFCMA_prfMAC_iff_oneTimeEUFCMA,Cslib.Crypto.isOraclePPTOn_run_macLogHandlerOn,Cslib.Crypto.isOraclePPT_macToPrfDistinguisher,Cslib.Crypto.eval_prfRealGame_macToPrfDistinguisher,Cslib.Crypto.eval_prfRealGame_macToPrfDistinguisher_eq_sufCmaGame,Cslib.Crypto.succProbability_prfIdealGame_macToPrfDistinguisher_le,Cslib.Crypto.succProbability_eufCmaGame_prfMAC_le,Cslib.Crypto.succProbability_sufCmaGame_prfMAC_le: quantitative PRF-to-MAC forgery reduction (Boneh and Shoup, Theorem 6.2).Cslib.Crypto.PseudorandomFunction.sufCma_prfMAC,Cslib.Crypto.PseudorandomFunction.oneTimeSUFCMA_prfMAC,Cslib.Crypto.PseudorandomFunction.eufCma_prfMAC,Cslib.Crypto.PseudorandomFunction.oneTimeEUFCMA_prfMAC: any secure uniformPseudorandomFunctionyields aSUFCMA-,OneTimeSUFCMA-,EUFCMA-, andOneTimeEUFCMA-secureMACScheme.Cslib.Crypto.NonceMACScheme.isPPTOn_run_signingPairOracle,Cslib.Crypto.NonceMACScheme.isPPTOn_sufCmaGame,isPPT_sufCmaGame,isPPTOn_eufCmaGame,isPPT_eufCmaGame,succProbability_eufCmaGame_le_sufCmaGame,SUFCMA.eufCma,eval_sufCmaGame_eq_freshPair_of_unique_tag: strict PPT certificates, quantitative / asymptotic implication fromSUFCMAtoEUFCMA, and unique-tag pair-freshness characterization for nonce-based MACs.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Chapter 6, Sections 6.1–6.3 (Definitions 6.1–6.2 and Theorem 6.2) and Chapter 7, Section 7.5 (Attack Game 7.4).
- O. Goldreich, S. Goldwasser, S. Micali, How to Construct Random Functions.
Three bit words (x, y, z); x and y are framed, z is not. It encodes the verification
input (sk, msg, tag) of a MACScheme, the tagging input (sk, msg, nonce) of a
NonceMACScheme, and the part (msg, nonce, tag) of its verification input after the key.
A uniform symmetric message authentication code (MAC) on msgLen n-bit messages at security
parameter n (defaulting to msgLen = id, i.e., n-bit messages), with plain polynomial-time
message-length schedule, strict polynomial-time key generation and tag generation, deterministic
polynomial-time verification, and perfect completeness on supported keys, msgLen n-bit messages,
and tags Boneh and Shoup, Definition 6.1.
Message length authenticated at unary security parameter
n(defaults ton).- msgLen_polyTime : Turing.MultiTapeTM.ComputableInPolyTime self.msgLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
The message-length schedule is computable in plain polynomial time in unary.
Sample a secret MAC key
skat unary security parametern.Compute a MAC tag on message
msgusing the secret keysk.Deterministically verify a candidate
tagonmsgunder secret keysk.Key generation is uniformly strict PPT in the unary security parameter.
- sign_ppt : Probability.IsPPTOn (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits fun (p : List Bool × List Bool) => self.sign p.1 p.2
Tag generation is uniformly strict PPT in the encoded secret key and message.
- verify_polyTime : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : List Bool × List Bool × List Bool) => self.verify p.1 p.2.1 p.2.2) encBitsTriple Turing.MultiTapeTM.encBool
Verification is computable in plain polynomial time on
(sk, msg, tag).
Composing M.msgLen with a plain polynomial-time unary parameter function is plain
polynomial-time.
Composing M.keyGen with a plain polynomial-time unary parameter function is strict PPT.
Composing M.sign with plain polynomial-time key and message selectors is strict PPT.
Composing M.verify with plain polynomial-time key, message, and tag selectors is plain
polynomial-time.
Guarded pair-logging oracle #
Guarded pair-logging MAC tagging oracle: answers request with M.sign sk and prepends
(request.2, tag) when admit request.2 queriedPairs = true, and answers [] without updating
queriedPairs otherwise. The full and one-time pair oracles are its instances
(signingPairOracle, oneTimeSigningPairOracle).
Stateful MAC tagging oracle at parameter n: it tags a M.msgLen n-bit requested message
under sk and prepends the message to the list of queried messages, and it answers a request of any
other length with the empty word, without tagging or recording it
(SignatureScheme.signingOracleOn on the M.msgLen n-bit words).
The fresh-message MAC EUF-CMA experiment: sample sk ← M.keyGen n, run the adaptive forger on
(n, []) with oracle access to M.signingOracle n sk, which tags M.msgLen n-bit messages only,
and accept when the forger outputs a valid (msg, tag) pair on a M.msgLen n-bit message msg
that was never queried to the tagging oracle.
Unlike Boneh and Shoup, Attack Game 6.1 / Definition 6.2, which logs (msg, tag)
pairs and rejects only previously returned pairs, this experiment logs queried messages and rejects
any previously queried message (!out.2.contains msg). The two notions differ for randomized
sign algorithms, and coincide for deterministic canonical MACs such as prfMAC.
Running an oracle-PPT forger against signingOracle is uniformly strict PPT in the unary
security parameter and secret key.
Run the complete MAC EUF-CMA experiment on its unary security parameter for any oracle-PPT forger.
The MAC EUF-CMA experiment is uniformly strict PPT, independently of unused auxiliary input.
Fresh-message existential unforgeability under adaptive chosen-message attack (EUFCMA) for a
symmetric MAC against uniform strict oracle-PPT adversaries.
Note that eufCmaGame enforces fresh-message unforgeability (msg ∉ queried), whereas
Boneh and Shoup, Attack Game 6.1 / Definition 6.2 defines the stronger fresh-pair
variant ((msg, tag) ∉ queriedPairs) for general (possibly randomized) signing algorithms. As in
the source, tagging queries and the forgery lie in the message space of msgLen n-bit words: the
tagging oracle answers a query of any other length with the empty word, without tagging or
recording it. The notion is therefore weaker than the source's, which implies it
(SUFCMA.eufCma).
Full EUF-CMA security gives negligible forgery probability for every oracle-PPT forger.
Establish EUF-CMA security by bounding every oracle-PPT forger's success probability.
One-time adaptive chosen-message security (OneTimeEUFCMA) #
One-time MAC oracle at parameter n that answers at most the first M.msgLen n-bit tagging
query using M.sign sk and returns the empty word without tagging or recording on any other query
(SignatureScheme.oneTimeSigningOracleOn on the M.msgLen n-bit words). A query of another length
does not use up the one answer.
The one-time MAC EUF-CMA experiment: sample sk ← M.keyGen n, run the adaptive forger on
(n, []) with oracle access to M.oneTimeSigningOracle n sk, which answers at most one tagging
query, on a M.msgLen n-bit message, and accept when the forger outputs a valid tag on a
M.msgLen n-bit message distinct from the queried message (if any).
Running an oracle-PPT forger against oneTimeSigningOracle is uniformly strict PPT in the
unary security parameter and secret key.
Run the complete one-time MAC EUF-CMA experiment on its unary security parameter for any oracle-PPT forger.
The one-time MAC EUF-CMA experiment is uniformly strict PPT, independently of unused auxiliary input.
Fresh-message existential unforgeability of a symmetric MAC under a one-time adaptive
chosen-message attack, against uniform strict oracle-PPT forgers. It is the one-time game of
[BS23], Section 7.6 (p. 275), Attack Game 6.1 (pp. 218–219) with a single signing query,
with two differences. Section 7.6 defines unconditional security, negligible advantage for all
adversaries, even computationally unbounded ones; here the forgers are efficient, as for the
one-time secure MAC of Theorem 9.2 (p. 367). A forgery counts only on a message that was not
queried, where the source accepts any new message–tag pair (OneTimeSUFCMA). As in the source, the
tagging query and the forgery lie in the message space of msgLen n-bit words: the oracle answers
only the first msgLen n-bit query, and it answers a query of any other length with the empty word,
without tagging or recording it, so such a query does not use up the one answer. The notion is
therefore weaker than the source's, which implies it (OneTimeSUFCMA.oneTimeEUFCMA).
One-time EUF-CMA security gives negligible forgery probability for every oracle-PPT forger.
Establish one-time EUF-CMA security by bounding every oracle-PPT forger's success probability.
Every MACScheme admits a plain polynomial-time bound tagBound : ℕ → ℕ on the length of tags
produced on M.msgLen n-bit messages under keys sampled from M.keyGen n.
Stateful MAC tagging oracle at parameter n that tags a M.msgLen n-bit requested message
under sk and prepends the returned (msg, tag) pair to the transcript of queried message/tag
pairs (Boneh and Shoup, Attack Game 6.1). It answers a request of any other
length with the empty word, without tagging or recording it, so tagging queries lie in the message
space.
The strong (fresh-pair) MAC SUF-CMA experiment
(Boneh and Shoup, Attack Game 6.1 / Definition 6.2): sample sk ← M.keyGen n,
run the adaptive forger on (n, []) with oracle access to M.signingPairOracle n sk, and accept
when the forger outputs a valid (msg, tag) pair on a M.msgLen n-bit message msg such that
(msg, tag) was never returned by the tagging oracle (!out.2.contains out.1).
Running an oracle-PPT forger against signingPairOracle is uniformly strict PPT in the unary
security parameter and secret key.
Run the complete MAC SUF-CMA experiment on its unary security parameter for any oracle-PPT forger.
The MAC SUF-CMA experiment is uniformly strict PPT, independently of unused auxiliary input.
Strong (fresh-pair) existential unforgeability under adaptive chosen-message attack (SUFCMA)
for a symmetric MAC against uniform strict oracle-PPT adversaries
(Boneh and Shoup, Attack Game 6.1 / Definition 6.2), on the message space of
msgLen n-bit words. Tagging queries and the forgery both lie in that space: the tagging oracle
answers a query of any other length with the empty word, without tagging or recording it.
Strong unforgeability gives negligible SUF-CMA forgery probability for every oracle-PPT forger.
Establish SUF-CMA security by bounding every oracle-PPT forger's success probability.
Strong one-time adaptive chosen-message security (OneTimeSUFCMA, Boneh–Shoup Section 7.6) #
One-time pair-logging MAC tagging oracle at parameter n (Boneh and Shoup, Section 7.6,
printed p. 275): answers at most the first M.msgLen n-bit tagging query using
M.sign sk, recording the returned (msg, tag) pair, and returns [] without tagging or recording
on any other query. A query of another length does not use up the one answer.
The strong (fresh-pair) one-time MAC experiment
(Boneh and Shoup, Attack Game 6.1 and Section 7.6, printed p. 275): sample
sk ← M.keyGen n, run the adaptive forger on (n, []) with oracle access to
M.oneTimeSigningPairOracle n sk (which answers at most one signing query, on a M.msgLen n-bit
message), and accept when the forger outputs a valid (msg, tag) pair on a M.msgLen n-bit message
msg distinct from the queried (msg, tag) pair (if any).
Running an oracle-PPT forger against oneTimeSigningPairOracle is uniformly strict PPT in the
unary security parameter and secret key.
Run the complete strong one-time MAC experiment on its unary security parameter for any oracle-PPT forger.
The strong one-time MAC experiment is uniformly strict PPT, independently of unused auxiliary input.
Strong (fresh-pair) existential unforgeability under one-time adaptive chosen-message attack
(OneTimeSUFCMA) for a symmetric MAC against uniform strict oracle-PPT adversaries: the
advantage MAC1adv of [BS23], Section 7.6 (p. 275), in Attack Game 6.1 (pp. 218–219)
with a single signing query, is negligible, as for the one-time secure MAC of Theorem 9.2
(p. 367), on the message space of msgLen n-bit words. The tagging query and the forgery both lie
in that space: the oracle answers only the first msgLen n-bit query, and it answers a query of any
other length with the empty word, without tagging or recording it, so such a query does not use up
the one answer.
Strong one-time unforgeability gives negligible sufOneTimeGame forgery probability for every
oracle-PPT forger.
Establish OneTimeSUFCMA security by bounding every oracle-PPT forger's success probability.
The typed PK = Unit forgery experiment of M at security parameter n under signing policy
signer and freshness test fresh: sample sk ← M.keyGen n (with public key ()), run
adversary.toTyped n [] against signer sk, and accept when the candidate (msg, tag) has
msg.length = M.msgLen n, verifies under sk, and satisfies fresh.
At each parameter n, M.sufCmaGame adversary n has the distribution of forgeExperiment
with PK = Unit, the policy (Signer.ofSign M.sign).restrict (·.length == M.msgLen n), which tags
M.msgLen n-bit messages only, and freshness freshPair.
At each parameter n, M.sufOneTimeGame adversary n has the distribution of forgeExperiment
with PK = Unit, the policy ((Signer.ofSign M.sign).restrict (·.length == M.msgLen n)).oneTime,
which answers the first M.msgLen n-bit query and refuses every other query, and freshness
freshPair.
At each parameter n, M.eufCmaGame adversary n has the distribution of forgeExperiment
with PK = Unit, the policy (Signer.ofSign M.sign).restrict (·.length == M.msgLen n), and
freshness freshMessage.
At each parameter n, M.eufOneTimeGame adversary n has the distribution of forgeExperiment
with PK = Unit, the policy ((Signer.ofSign M.sign).restrict (·.length == M.msgLen n)).oneTime,
and freshness freshMessage.
Full EUF-CMA security implies one-time EUF-CMA security for any MACScheme.
Full strong unforgeability (SUFCMA) implies one-time strong unforgeability (OneTimeSUFCMA)
for any MACScheme.
Quantitative EUF-CMA vs. SUF-CMA bound: for every MACScheme, adaptive forger, and
security parameter n, the fresh-message EUF-CMA forgery probability is at most the strong
fresh-pair SUF-CMA forgery probability.
Quantitative one-time EUF-CMA vs. one-time SUF-CMA bound: for every MACScheme, adaptive
forger, and security parameter n, the one-time fresh-message forgery probability is at most the
one-time fresh-pair forgery probability.
Strong one-time unforgeability (OneTimeSUFCMA) implies ordinary fresh-message one-time
unforgeability (OneTimeEUFCMA) for every MACScheme.
Strong unforgeability (SUFCMA) implies one-time unforgeability (OneTimeEUFCMA) for every
MACScheme.
For any MACScheme whose valid tags on M.msgLen n-bit messages under supported secret keys
agree with every tag in the support of M.sign, the sufCmaGame and eufCmaGame distributions
are identical.
For a MACScheme with unique valid tags per (sk, msg), the SUF-CMA and EUF-CMA forgery
probabilities are equal for every forger and security parameter n.
For a MACScheme with unique valid tags per (sk, msg), strong unforgeability (SUFCMA) is
equivalent to ordinary fresh-message unforgeability (EUFCMA).
For any MACScheme whose valid tags on M.msgLen n-bit messages under supported secret keys
agree with every tag in the support of M.sign, the sufOneTimeGame and eufOneTimeGame
distributions are identical.
For a MACScheme with unique valid tags per (sk, msg), the sufOneTimeGame and
eufOneTimeGame forgery probabilities are equal for every forger and security parameter n.
For a MACScheme with unique valid tags per (sk, msg), strong one-time unforgeability
(OneTimeSUFCMA) is equivalent to ordinary fresh-message one-time unforgeability
(OneTimeEUFCMA).
Schedule reindexing of a MACScheme (reindex, reindexForger) #
Reindex a MACScheme along a polynomial-time parameter schedule ℓ : ℕ → ℕ: at security
parameter n, M.reindex ℓ hℓ samples keys via M.keyGen (ℓ n) and authenticates messages of
length M.msgLen (ℓ n).
Wrap a forger adversary against M.reindex ℓ hℓ into a forger against M: given unary
parameter m and auxiliary input aux, recover n := GeneratorReindex.parameter ℓ m; if
ℓ n == m, run adversary n aux, and otherwise return ([], []) without querying the oracle.
At any parameter m = ℓ n of a strictly monotone schedule ℓ, reindexForger ℓ adversary
executes adversary n.
reindexForger ℓ adversary preserves strict oracle-PPT admissibility (IsOraclePPT).
For a strictly monotone schedule ℓ, (M.reindex ℓ hℓ).sufCmaGame adversary n is identical to
M.sufCmaGame (reindexForger ℓ adversary) (ℓ n).
For a strictly monotone schedule ℓ, (M.reindex ℓ hℓ).sufOneTimeGame adversary n is identical
to M.sufOneTimeGame (reindexForger ℓ adversary) (ℓ n).
For a strictly monotone schedule ℓ, (M.reindex ℓ hℓ).eufCmaGame adversary n is identical to
M.eufCmaGame (reindexForger ℓ adversary) (ℓ n).
For a strictly monotone schedule ℓ, (M.reindex ℓ hℓ).eufOneTimeGame adversary n is
identical to M.eufOneTimeGame (reindexForger ℓ adversary) (ℓ n).
Strong unforgeability (SUFCMA) is preserved under reindexing along any strictly monotone
plain polynomial-time schedule ℓ.
Strong one-time unforgeability (OneTimeSUFCMA) is preserved under reindexing along any
strictly monotone plain polynomial-time schedule ℓ.
Ordinary fresh-message unforgeability (EUFCMA) is preserved under reindexing along any
strictly monotone plain polynomial-time schedule ℓ.
One-time unforgeability (OneTimeEUFCMA) is preserved under reindexing along any strictly
monotone plain polynomial-time schedule ℓ.
Canonical deterministic MAC constructed from a keyed function family family
(Boneh and Shoup, Section 6.3):
Open stateful handler forwarding valid n-admissible MAC signing requests to the external
PRF/random-function oracle (truncating the reply to n bits) and recording the queried message in
the query log; invalid requests receive [] without querying or recording
(Boneh and Shoup, Section 6.3, Theorem 6.2).
Running an oracle-PPT forger against macLogHandlerOn valid is uniformly strict oracle-PPT in
the unary security parameter and auxiliary input whenever valid is computable in polynomial time
on (1ⁿ, msg).
Open stateful handler that forwards each n-bit MAC signing request to the external
PRF/random-function oracle (truncating the reply to n bits) and records the queried message in the
query log. Like the tagging oracle of prfMAC, it answers a request of any other length with the
empty word, without querying or recording it (macLogHandlerOn on n-bit messages).
Oracle reduction turning an adaptive MAC forger adversary into an OracleDistinguisher for
the PRF security game Boneh and Shoup, Section 6.3, Theorem 6.2:
- Run
adversary n [], answering each tagging query viamacLogHandler n, which logs the queriedn-bit messages and refuses the others. - When
adversaryoutputs((msg, tag), queried), ifmsg.length == nand!queried.contains msg, query the external oracle once onmsg(reading at mostnbits) and check whether the reply equalstag; otherwise returnfalse.
macToPrfDistinguisher preserves strict oracle-PPT admissibility (IsOraclePPT).
Running macToPrfDistinguisher adversary in prfRealGame id family produces the exact same
Boolean distribution as the EUF-CMA experiment for prfMAC family.
In the ideal random-function game, macToPrfDistinguisher adversary succeeds with probability
at most 1 / 2 ^ n: any unqueried n-bit forgery message misses the lazy random-oracle cache and
draws a fresh uniform n-bit tag, matching the forger's candidate tag with probability at most
1 / 2 ^ n.
Because prfMAC is deterministic with a unique valid tag per (sk, msg), its strong
fresh-pair sufCmaGame distribution is identical to its fresh-message eufCmaGame
distribution.
For prfMAC, strong unforgeability (SUFCMA) and fresh-message unforgeability (EUFCMA)
coincide.
Because prfMAC is deterministic with a unique valid tag per (sk, msg), its strong
one-time fresh-pair sufOneTimeGame distribution is identical to its one-time fresh-message
eufOneTimeGame distribution.
For prfMAC, strong one-time unforgeability (OneTimeSUFCMA) and fresh-message one-time
unforgeability (OneTimeEUFCMA) coincide.
Running macToPrfDistinguisher adversary in prfRealGame id family produces the exact same
Boolean distribution as the strong SUF-CMA experiment for prfMAC family.
Step of succProbability_sufCmaGame_prfMAC_le, the bound of
Boneh and Shoup, Theorem 6.2, not the cited result: its fresh-message form. For
every adaptive MAC forger adversary and every security parameter n, the EUF-CMA forgery
probability against prfMAC family is at most the PRF distinguishing advantage of
macToPrfDistinguisher adversary plus 1 / 2 ^ n.
Quantitative PRF-to-SUF-CMA forgery bound Boneh and Shoup, Theorem 6.2:
for every adaptive MAC forger adversary and every security parameter n, the strong SUF-CMA
forgery probability against prfMAC family is at most the PRF distinguishing advantage of
macToPrfDistinguisher adversary plus 1 / 2 ^ n.
Step of PseudorandomFunction.sufCma_prfMAC (Boneh and Shoup, Theorem 6.2),
not the cited result: every uniform PseudorandomFunction yields an EUFCMA-secure MACScheme,
the fresh-message form of the theorem's conclusion.
PRF-to-SUF-CMA security theorem Boneh and Shoup, Theorem 6.2:
every uniform PseudorandomFunction yields a strongly unforgeable (SUFCMA) MACScheme.
Every uniform PseudorandomFunction also yields a OneTimeEUFCMA-secure MACScheme.
Every uniform PseudorandomFunction also yields a strongly one-time unforgeable
(OneTimeSUFCMA) MACScheme.
Nonce-based message authentication codes (NonceMACScheme, Boneh–Shoup Section 7.5) #
Nonce-tagged message ((msg, nonce), tag), the output of a nonce-based MAC forger and an
entry of the signing oracle's log: the message, the nonce and the tag as bit words. The pair
(msg, nonce) is framed, and within it the message.
An adaptive nonce-based MAC forger receives a unary security parameter and an auxiliary word,
queries a nonce-respecting tagging oracle on encoded (message, nonce) pairs
(encPair encBits encBits (msg, nonce)), and outputs a candidate ((message, nonce), tag) triple
(Boneh and Shoup, Section 7.5, Attack Game 7.4).
A uniform symmetric nonce-based message authentication code (NonceMACScheme) on msgLen n-bit
messages and nonceLen n-bit nonces at security parameter n (both defaulting to n), with plain
polynomial-time length schedules, strict polynomial-time key generation and tag generation,
deterministic polynomial-time verification, and perfect completeness on supported keys,
msgLen n-bit messages, nonceLen n-bit nonces, and tags
(Boneh and Shoup, Section 7.5, Attack Game 7.4).
Message length authenticated at unary security parameter
n(defaults ton).- msgLen_polyTime : Turing.MultiTapeTM.ComputableInPolyTime self.msgLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
The message-length schedule is computable in plain polynomial time in unary.
Nonce length required at unary security parameter
n(defaults ton).- nonceLen_polyTime : Turing.MultiTapeTM.ComputableInPolyTime self.nonceLen Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encUnary
The nonce-length schedule is computable in plain polynomial time in unary.
Sample a secret MAC key
skat unary security parametern.Compute a MAC tag on message
msgand noncenonceusing the secret keysk.Deterministically verify a candidate
tagon(msg, nonce)under secret keysk.Key generation is uniformly strict PPT in the unary security parameter.
- sign_ppt : Probability.IsPPTOn encBitsTriple Turing.MultiTapeTM.encBits fun (p : List Bool × List Bool × List Bool) => self.sign p.1 p.2.1 p.2.2
Tag generation is uniformly strict PPT in the encoded
(sk, msg, nonce). - verify_polyTime : Turing.MultiTapeTM.ComputableInPolyTime (fun (p : List Bool × List Bool × List Bool × List Bool) => self.verify p.1 p.2.1 p.2.2.1 p.2.2.2) (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits encBitsTriple) Turing.MultiTapeTM.encBool
Verification is computable in plain polynomial time on
(sk, msg, nonce, tag).
Composing M.msgLen with a plain polynomial-time unary parameter function is plain
polynomial-time.
Composing M.nonceLen with a plain polynomial-time unary parameter function is plain
polynomial-time.
Composing M.keyGen with a plain polynomial-time unary parameter function is strict PPT.
Composing M.sign with plain polynomial-time key, message, and nonce selectors is strict
PPT.
Composing M.verify with plain polynomial-time key, message, nonce, and tag selectors is plain
polynomial-time.
Stateful nonce-based MAC tagging oracle at parameter n that decodes (msg, nonce) from the
framed query word request.2, tags (msg, nonce) under sk when msg has M.msgLen n bits and
nonce has M.nonceLen n bits, and prepends the returned ((msg, nonce), tag) triple to the
transcript (Boneh and Shoup, Section 7.5, Attack Game 7.4). It answers any other
request with the empty word, without tagging or recording it, so queries lie in the message and
nonce spaces.
The strong nonce-based MAC SUF-CMA experiment
(Boneh and Shoup, Section 7.5, Attack Game 7.4): sample sk ← M.keyGen n, run
the adaptive forger on (n, []) with oracle access to M.signingPairOracle n sk, and accept when:
- the candidate message has length
M.msgLen nand the candidate nonce has lengthM.nonceLen n, - all nonces queried during the signing phase are pairwise distinct
(
decide (out.2.map (fun ⟨⟨_, qnonce⟩, _⟩ => qnonce)).Nodup), - the candidate
((msg, nonce), tag)triple was never returned by the tagging oracle (!out.2.contains out.1), and M.verify sk msg nonce tag = true.
The fresh-message nonce-based MAC EUF-CMA experiment: identical to sufCmaGame except that the
candidate message msg must never have been queried during the signing phase
(!(out.2.map (fun ⟨⟨qmsg, _⟩, _⟩ => qmsg)).contains msg).
Running an oracle-PPT nonce-MAC forger against signingPairOracle is uniformly strict PPT in
the unary security parameter and secret key.
Run the complete nonce-based MAC SUF-CMA experiment on its unary security parameter for any oracle-PPT forger.
The nonce-based MAC SUF-CMA experiment is uniformly strict PPT, independently of unused auxiliary input.
Run the complete nonce-based MAC EUF-CMA experiment on its unary security parameter for any oracle-PPT forger.
The nonce-based MAC EUF-CMA experiment is uniformly strict PPT, independently of unused auxiliary input.
Strong existential unforgeability under nonce-respecting adaptive chosen-message attack
(SUFCMA) for a NonceMACScheme against uniform strict oracle-PPT adversaries
(Boneh and Shoup, Section 7.5, Attack Game 7.4). A run that repeats a nonce
loses, as the source forbids repeated nonces. As in the source, tagging queries and the forgery lie
in the spaces of msgLen n-bit messages and nonceLen n-bit nonces: the oracle answers any other
query with the empty word, without tagging or recording it.
Strong nonce-based unforgeability gives negligible SUF-CMA forgery probability for every oracle-PPT forger.
Establish nonce-based SUF-CMA security by bounding every oracle-PPT forger's success probability.
Fresh-message existential unforgeability under nonce-respecting adaptive chosen-message attack
(EUFCMA) for a NonceMACScheme against uniform strict oracle-PPT adversaries: [BS23],
Attack Game 7.4 and Definition 7.6 (p. 274), with one difference. A forgery counts only on a
message that was never queried, where the source accepts any new triple (m, t, N) (SUFCMA). As
in the source, tagging queries and the forgery lie in the spaces of msgLen n-bit messages and
nonceLen n-bit nonces: the oracle answers any other query with the empty word, without tagging or
recording it. The notion is therefore weaker than the source's, which implies it (SUFCMA.eufCma).
A run that repeats a nonce loses, as the source forbids repeated nonces.
Nonce-based EUF-CMA security gives negligible forgery probability for every oracle-PPT forger.
Establish nonce-based EUF-CMA security by bounding every oracle-PPT forger's success probability.
Quantitative EUF-CMA vs. SUF-CMA bound for NonceMACScheme: for every NonceMACScheme,
adaptive forger, and security parameter n, the fresh-message eufCmaGame forgery probability is
at most the strong fresh-triple sufCmaGame forgery probability.
Strong unforgeability (SUFCMA) implies fresh-message unforgeability (EUFCMA) for every
NonceMACScheme.
For any NonceMACScheme whose valid tags on M.msgLen n-bit messages and M.nonceLen n-bit
nonces under supported secret keys agree with every tag in the support of M.sign, strong
triple-freshness (!out.2.contains out.1) in sufCmaGame is identical to (msg, nonce)-pair
freshness (!(out.2.map Prod.fst).contains pair).