Length-Prepended CBC-MAC over a Uniform Random Function #
This module proves the information-theoretic uniform-random-function step (#6046) toward
length-prepended CBC-MAC PRF security ([BS23], Section 6.4.1, Theorem 6.3, pp. 226–229,
and Sections 6.6–6.6.1, Theorem 6.8, pp. 235–236; [KL20], Section 4.4, pp. 120–127),
bounding length-prepended CBC-MAC over a uniform random function g : BitString n → BitString n
rather than a keyed computational PRF. Basic CBC-MAC is secure only for prefix-free message sets;
prepending the message block count encoded as an n-bit block makes variable-length block-aligned
messages prefix-free ([BS23], Section 6.6.1, pp. 235–236; [KL20], Section
4.4.1–4.4.2 and Chapter 4 Exercises, p. 140ff., interior [KL20] numbering from the
existing module notes, see manual/sources.md).
Here block-aligned messages of 0 to L blocks prepend an n-bit block encoding the number of
blocks. Every adaptive distinguisher that asks such messages is translated into a distinguisher
against basic random-function CBC-MAC on inputs of at most L + 1 blocks whose queries are
prefix-free whenever the length encoding is injective. The uniform-random-function step
abs_cbcUniformFunctionSuccess_sub_cbcIdealSuccess_le (#6046) then gives the variable-length bound
q ^ 2 * (L + 1) ^ 2 / (2 * 2 ^ n).
Main definitions #
LengthPrependedInput,lengthPrependedBlocks: block-aligned messages of at mostLblocks.prependLength,lengthPrependedCbcMac: prepend the encoded block count and run basic CBC-MAC.blockCountBlock: the block countkwritten as ann-bit block, injective whenL < 2 ^ n.LengthPrependedSpec,prependLengthQueries,lengthPrependedUniformFunctionSuccess,lengthPrependedIdealSuccess: adaptive variable-length distinguishers, their translation into CBC-MAC distinguishers, and uniform-block-function vs. ideal acceptance probabilities.
Main results #
prependLength_injective,not_isPrefix_prependLength,isPrefixFreeEncoding_prependLength,cbcPrefixFree_of_forall_mem_range: length prepending is injective and, for an injective length encoding, prefix-free ([BS23], Section 6.6.1, pp. 235–236).cbcUniformFunctionSuccess_map_prependLengthQueries,cbcIdealSuccess_map_prependLengthQueries: the translated distinguisher has the same uniform-function and ideal acceptance probabilities.abs_lengthPrependedUniformFunctionSuccess_sub_lengthPrependedIdealSuccess_le: uniform-random-function step|urf - ideal| ≤ q ^ 2 * (L + 1) ^ 2 / (2 * 2 ^ n)(#6046) toward length-prepended CBC-MAC PRF security ([BS23], Theorem 6.3 and Theorem 6.8; [KL20], Section 4.4), bounding length-prepended CBC-MAC over a uniform random function rather than a keyed computational PRF.
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Section 6.4.1 (Theorem 6.3, pp. 226–229) and Sections 6.6–6.6.1 (Theorem 6.8, pp. 235–236).
- J. Katz, Y. Lindell, Introduction to Modern Cryptography, 3rd ed.,
Section 4.4 (pp. 120–127) and Chapter 4 Exercises (p. 140ff.; interior theorem/exercise numbers
not re-audited against the Chapter 4 body, see
manual/sources.md).
Section 1: The Length-Prepended Encoding Is Prefix-Free #
Block-aligned messages of at most L blocks: a block count k ≤ L and k blocks of n
bits. The empty message is included.
Decidable equality on LengthPrependedInput n L, transported from the sigma type.
The list of blocks of a block-aligned message.
A block-aligned message is determined by its list of blocks.
Prepend the encoded block count encodeLength x.1 to a block-aligned message x, giving a
nonempty CBC-MAC input of x.1 + 1 ≤ L + 1 blocks.
Length-prepended CBC-MAC ([KL20], Section 4.4.1, p. 122, Figure 4.2): basic CBC-MAC of the encoded block count followed by the message blocks.
Length-prepended CBC-MAC chains the message blocks starting from g (encodeLength x.1).
Prepending the block count is injective, for any length encoding.
Length prepending is prefix-free ([KL20], Exercise 4.18, p. 143): with an injective length encoding, no length-prepended input is a prefix of a different one.
Method 1: length prepending is a prefix-free encoding ([BS23], Section 6.6.1,
p. 235): restates not_isPrefix_prependLength as PRF.IsPrefixFreeEncoding.
Every list of length-prepended inputs is prefix-free, for an injective length encoding.
The block count k ≤ L written as the n-bit block with binary value k. [KL20]
prepend the bit length |m|; for block-aligned messages the block count carries the same
information, and any injective encoding works. This one is injective when L < 2 ^ n.
Section 2: Adaptive Variable-Length Distinguishers #
The oracle interface of variable-length distinguishers: a query is a block-aligned message of
at most L blocks, answered by an n-bit tag.
Translate a variable-length distinguisher into a CBC-MAC distinguisher that asks the length-prepended version of each query.
Answering the translated program with a CBC-MAC oracle is answering the original program with
the oracle precomposed with prependLength.
Every query that the translated program asks is length-prepended, and a program that asks
at most q queries leads to at most q CBC-MAC queries.
Acceptance probability of a distribution D over variable-length distinguishers interacting
with lengthPrependedCbcMac g encodeLength over a uniform random block function
g : BitString n → BitString n (not a keyed computational PRF; #6046).
Ideal-world acceptance probability of a distribution D over variable-length distinguishers
interacting with a uniform random function f : LengthPrependedInput n L → BitString n.
The translated distinguisher has the same uniform-function acceptance probability.
The translated distinguisher has the same ideal-world acceptance probability: a uniform
random function on CBC-MAC inputs, precomposed with the injective map prependLength, is a
uniform random function on block-aligned messages.
Information-theoretic uniform-random-function step (#6046) toward length-prepended CBC-MAC PRF
security ([BS23], Section 6.4.1, Theorem 6.3, pp. 226–229, and Sections 6.6–6.6.1,
Theorem 6.8, pp. 235–236; [KL20], Section 4.4, pp. 120–127), bounding length-prepended
CBC-MAC over a uniform random function g : BitString n → BitString n rather than a keyed
computational PRF: for an injective length encoding and every distribution D over
distinguishers that ask at most q block-aligned messages of at most L blocks,
length-prepended CBC-MAC with a uniform random function is within
q ^ 2 * (L + 1) ^ 2 / (2 * 2 ^ n) of a uniform random function on such messages.