Variable-length MACs from fixed-length MACs #
This file extends a fixed-length MAC to messages of varying length with the blockwise
construction of [KL20], Construction 4.7. Write L = M.msgLen n and w = L / 4.
A message with 0 < |m| < 2 ^ w is cut into w-bit blocks (the last one padded with zeros).
The signer samples a uniform w-bit identifier r and applies M to one L-bit input per
block, made of r, the message length, the block index and the block itself.
Main definitions #
BlockwiseMAC.blockInputs: the fixed-length inputs that a block encoder assigns to a message.BlockwiseMAC.fullEncoder: the encoder of the construction;noIdentifierEncoder,noLengthEncoderandnoIndexEncoderare insecure variants that each omit one field.BlockwiseMAC.IsPolyTimeEncoder: polynomial-time predicate for block encoders.BlockwiseMACForger: uniform word-oracle blockwise MAC forger (WordOracleAdv Unit (List Bool × Tag)).MACScheme.blockwiseSign,MACScheme.blockwiseVerify: the variable-length scheme.MACScheme.blockwiseGame: its fresh-message EUF-CMA experiment, andMACScheme.blockwiseRepeatGame: the event that two signing queries share an identifier.MACScheme.blockwiseReduction: the fixed-length adversary built from a blockwise adversary.MACScheme.blockwiseBoundedReduction: the uniform strict oracle-PPT fixed-length forger built from aBlockwiseMACForgerby truncating fixed-length oracle replies to a polynomial bound.MACScheme.BlockwiseEUFCMA: uniform asymptotic EUF-CMA security against strict oracle-PPTBlockwiseMACForgers.
Main results #
MACScheme.isPPTOn_blockwiseSign,MACScheme.computableInPolyTime_blockwiseVerify,MACScheme.isPPTOn_blockwiseSigningOracle,MACScheme.isPPT_blockwiseGame: strict PPT and plain polynomial-time certificates for the honest algorithms, signing oracle, and experiment.MACScheme.isOraclePPT_blockwiseBoundedReduction:blockwiseBoundedReductionis uniformly strict oracle PPT.MACScheme.blockwiseGame_le_add_repeat: the blockwise advantage is at most the advantage ofblockwiseReductionagainstMplus the probability of a repeated identifier.MACScheme.blockwiseRepeatGame_le: with at mostQsigning queries, a repeated identifier has probability at most(∑ i ∈ range Q, i) / 2 ^ w.MACScheme.blockwiseGame_le: the combined concrete bound ([KL20], Theorem 4.8).MACScheme.EUFCMA.blockwiseEUFCMA: uniform asymptotic security (M.EUFCMA → M.BlockwiseEUFCMA fullEncoderwhenPolynomiallyLowerBounded M.msgLen).MACScheme.blockwiseGame_noIndex,MACScheme.blockwiseGame_noLength,MACScheme.blockwiseGame_noIdentifier, andMACScheme.not_blockwiseEUFCMA_noIndexEncoder,MACScheme.not_blockwiseEUFCMA_noLengthEncoder,MACScheme.not_blockwiseEUFCMA_noIdentifierEncoder: concrete and uniform oracle-PPT separations. Each insecure variant admits an explicit strict oracle-PPT forger with at most two signing queries that wins with probability one whenw ≥ 3.
Implementation notes #
The encoder is a parameter, so the construction and its three variants share one definition.
Messages outside the domain have no block inputs and never verify. The repeated-identifier bound
adds up, query by query, the chance that a new identifier equals an earlier one, which gives
Q (Q - 1) / 2 ^ (w + 1). To obtain a uniform strict oracle-PPT reduction without changing the
concrete experiment blockwiseReduction, blockwiseBoundedSimulator truncates each fixed-length
oracle reply to tagBound n bits; when tagBound covers all honest tags of M.sign, this agrees
identically with blockwiseSimulator.
References #
The width L / 4 of each field of an L-bit block input.
The number of w-bit blocks, rounded up, in a len-bit message.
A block encoder takes a field width, an input length, an identifier, a message length, a block index and a block, and returns an input for the fixed-length MAC.
A blockwise tag: the identifier together with one fixed-length tag per block.
Two messages of the same length with the same blocks are equal.
The number of block inputs of a message m is at most m.length.
Encodings and polynomial-time certificates #
Total polynomial-time decoder for encTag.
tagDecoder.decode is computable in polynomial time.
Composition rule for tagDecoder.decode.
fieldWidth is computable in polynomial time in unary.
Composition rule for fieldWidth.
blockCount is computable in polynomial time in unary.
Composition rule for blockCount.
messageBlock is computable in polynomial time.
Composition rule for messageBlock.
A block Encoder is polynomial-time when it is computable in polynomial time with unary
widths/lengths/indices and bit-string identifier/block inputs.
Composition rule for a polynomial-time block Encoder.
fullEncoder is polynomial-time.
noIdentifierEncoder is polynomial-time.
noLengthEncoder is polynomial-time.
noIndexEncoder is polynomial-time.
blockInputs E is computable in polynomial time whenever E is polynomial-time.
Composition rule for blockInputs E.
authenticatedInputs E is computable in polynomial time whenever E is polynomial-time.
Composition rule for authenticatedInputs E.
freshBlockPair E is computable in polynomial time whenever E is polynomial-time.
Composition rule for freshBlockPair E.
An adaptive adversary against a variable-length MAC: on security parameter n it queries a
blockwise signing oracle and outputs a candidate message/tag pair.
A uniform adaptive word-oracle forger against a variable-length MAC: on security parameter n
and auxiliary word aux, it queries the single-channel word oracle on messages m : List Bool
(receiving encoded blockwise tags BlockwiseMAC.encTag tag : List Bool) and outputs a candidate
forgery (msg, tag).
Embed a uniform word-oracle forger as a BlockwiseMACAdversary by running it on empty
auxiliary input [] and encoding each returned BlockwiseMAC.Tag with BlockwiseMAC.encTag.
Embedding a BlockwiseMACForger as a BlockwiseMACAdversary preserves query budgets.
Convert a BlockwiseMACAdversary into a BlockwiseMACForger by answering each signing query
m with BlockwiseMAC.tagDecoder.decode of the first replyBound n m.length bits of the external
word-oracle reply.
Blockwise signing: sample a w-bit identifier r, then tag every block input with M.
Blockwise verification: the message is in the domain, the identifier has w bits, there is
one tag per block, and M accepts every block input with its tag.
The blockwise signing oracle; its state logs each query with the returned tag, newest first.
The fresh-message EUF-CMA experiment for the blockwise scheme: the adversary wins when it
outputs a message it never queried together with a tag that blockwiseVerify accepts.
The same experiment, reporting instead whether two signing queries received the same identifier.
Answers a blockwise signing query with fixed-length signing queries, one per block input, and logs the query.
The fixed-length adversary of the reduction: run the blockwise adversary against
blockwiseSimulator, then output the first block input of its message that no simulated query
covered, with the matching block tag.
The blockwise success probability is at most the EUF-CMA success of blockwiseReduction
against M plus the probability that two signing queries share an identifier.
Correctness of the blockwise scheme: an honest tag on a message in the domain verifies.
If the adversary makes at most Q signing queries, two queries share an identifier with
probability at most (∑ i ∈ range Q, i) / 2 ^ w.
Concrete security of the blockwise construction against an adversary with at most Q
signing queries: this is the concrete inequality behind [KL20], Theorem 4.8. Because
blockwiseReduction forwards arbitrary fixed-length oracle replies without a length bound, the
unbounded reduction itself has no uniform oracle-PPT certificate; see blockwiseBoundedReduction,
blockwiseGame_le_blockwiseBoundedReduction, and EUFCMA.blockwiseEUFCMA for the truncated
oracle-PPT reduction and the resulting uniform asymptotic security theorem.
Separation witness for noIndexEncoder: one query on 0^w ‖ 1^w, then the output
1^w ‖ 0^w with the two block tags in the opposite order.
Separation witness for noLengthEncoder: one query on 0^w ‖ 1^w, then the output 0^w
with the first block tag.
Separation witness for noIdentifierEncoder: queries on 0^w ‖ 0^w and 1^w ‖ 1^w, then
the output 0^w ‖ 1^w with the first block tag of the first answer and the second block tag of
the second answer.
Without the block index the construction is not EUF-CMA: swapBlocksAdversary wins with
probability one.
Without the message length the construction is not EUF-CMA: truncateAdversary wins with
probability one.
Without the identifier the construction is not EUF-CMA: mixBlocksAdversary wins with
probability one.
Efficiency of the honest algorithms, game, and reduction #
blockwiseSign E is strict PPT whenever E is a polynomial-time encoder.
blockwiseVerify E is computable in polynomial time whenever E is a polynomial-time
encoder.
blockwiseSigningOracle E is strict PPT in (n, sk, m) and the signing log log.
Every MACScheme and polynomial-time Encoder admits a plain polynomial-time bound
replyBound n ℓ on the encoded length (encTag tag).length of every blockwise tag produced on an
ℓ-bit message at security parameter n.
Word-oracle wrapper around blockwiseSigningOracle: tags request.2 using blockwiseSign,
replies with the word encTag tag, and logs (request.2, tag).
blockwiseWordSigningOracle E is strict PPT on handler calls with caller (n, sk).
blockwiseGame E F.toAdversary is strict PPT on the security parameter n whenever E is
a polynomial-time encoder and F is a strict oracle-PPT blockwise forger.
blockwiseGame E F.toAdversary is strict PPT whenever E is a polynomial-time encoder and
F is a strict oracle-PPT blockwise forger.
Truncated oracle-PPT simulator and reduction #
Answers a word-oracle blockwise signing query ((), m) with fixed-length signing queries, one
per block input in blockInputs E (M.msgLen n) r m, truncating each reply to tagBound n bits,
encoding the resulting blockwise tag (r, tags) with encTag, and logging (m, (r, tags)).
The uniform strict oracle-PPT fixed-length forger built from a word-oracle blockwise forger
F: run F n [] against blockwiseBoundedSimulator E tagBound n, then output the first block
input of its message that no simulated query covered, with the matching block tag.
blockwiseBoundedSimulator E tagBound is strict oracle PPT in the caller (n, aux), the
request and the signing log log, for every polynomial-time E and tagBound.
blockwiseBoundedReduction E tagBound F is uniformly strict oracle PPT whenever E is a
polynomial-time encoder, tagBound is polynomial-time, and F is a strict oracle-PPT blockwise
forger.
When tagBound n bounds all honest tags of M.sign sk on M.msgLen n-bit messages, running
blockwiseBoundedReduction fullEncoder tagBound F in M.eufCmaGame has the exact same output
distribution as running blockwiseReduction fullEncoder F.toAdversary.
Concrete security of the blockwise construction with blockwiseBoundedReduction: for any
word-oracle forger F making at most Q signing queries and any tagBound covering honest tags,
the blockwise forgery probability is at most the EUF-CMA success of
blockwiseBoundedReduction fullEncoder tagBound F plus (∑ i ∈ range Q, i) / 2 ^ w.
Game.succProbability form of blockwiseGame_le_blockwiseBoundedReduction in ℝ≥0.
Uniform asymptotic security and separations #
Existential unforgeability of the blockwise variable-length MAC with block encoder E under
adaptive chosen-message attack ([KL20], Construction 4.7 and Theorem 4.8) against
uniform strict oracle-PPT word-oracle forgers (BlockwiseMACForger).
Blockwise EUF-CMA security gives negligible forging probability for every oracle-PPT blockwise forger.
Uniform security of the blockwise variable-length MAC ([KL20], Theorem 4.8):
if M is an EUFCMA-secure fixed-length MAC whose message-length schedule M.msgLen is
polynomially lower-bounded (as it is when M.msgLen = id), then the blockwise
variable-length MAC with fullEncoder is BlockwiseEUFCMA-secure.
When replyBound n m.length covers the encoded length of every honest blockwise tag on m,
converting a BlockwiseMACAdversary to a BlockwiseMACForger and back preserves the game
distribution.
M.swapBlocksAdversary.toForger replyBound is strict oracle PPT for any polynomial-time
replyBound.
M.truncateAdversary.toForger replyBound is strict oracle PPT for any polynomial-time
replyBound.
M.mixBlocksAdversary.toForger replyBound is strict oracle PPT for any polynomial-time
replyBound.
Without the block index (noIndexEncoder), the blockwise construction is not
BlockwiseEUFCMA-secure whenever 3 ≤ fieldWidth (M.msgLen n) eventually.
Without the message length (noLengthEncoder), the blockwise construction is not
BlockwiseEUFCMA-secure whenever 3 ≤ fieldWidth (M.msgLen n) eventually.
Without the identifier (noIdentifierEncoder), the blockwise construction is not
BlockwiseEUFCMA-secure whenever 3 ≤ fieldWidth (M.msgLen n) eventually.