Word requests as block-mode queries #
In the asymptotic CPA game symmetricCPAGameOn blockPairValid, an adversary at parameter n
submits pairs of words. blockModeWordAdversary adversary n reads it as a BlockModeAdversary n
for the typed experiments of RandomFunctionHybrid.lean. An admissible request (m₀, m₁) becomes
the query made of their n-bit blocks (BitString.toBlocks); the answer (iv, cs) is flattened
back into the word iv ++ cs. Inadmissible requests are answered with [] and no query. Word-level
reductions for block modes are compared with the typed reductions through this adapter, which
inherits a block budget from the word adversary's query budget.
Main definitions #
Cslib.Crypto.blockModeWordQuery: one word request as a block-mode query.Cslib.Crypto.blockModeWordAdversary: a word adversary as a block-mode adversary.
Main results #
Cslib.Crypto.blockModeSelect_toBlocks: an admissible pair of at mostℓblocks selects the blocks of the chosen message.Cslib.Crypto.isCostBounded_blockModeWordAdversary:Qrequests ask for at mostQ * ℓblocks when the queries are capped atℓblocks each.
A word CPA adversary at parameter n, with empty auxiliary input, as a block-mode adversary.
An admissible pair whose messages have at most ℓ blocks selects the blocks of the message
chosen by bit.
If the word adversary makes at most Q requests, the block-mode adversary asks for at most
Q * ℓ blocks, counting each query's blocks only up to the cap ℓ as blockModeCost ℓ does.