The ideal strong-PRP game against the forgetful sampler #
A StrongPRPDistinguisher asks words on two channels: channel false for the permutation and
channel true for its inverse. strongBitStringCodec m reads such a request with an m-bit word
as a typed PermQuery (BitString m) (strongPermCodec in Crypto.Computational.LubyRackoff reads
it as a query on pairs of halves), so that the ideal strong-PRP game strongPRPIdealGame becomes
the typed experiment PRP.strongIdealExperiment (strongPRPIdealGame_eq_strongIdealExperiment).
The bidirectional switching bound of CslibFrontier.Crypto.Primitives.PRP.StrongSwitching then
compares the ideal game with its run against RandomPermutation.forgetfulAnswer, the lazy sampler
that keeps the pairs (x, y) it has answered, answers .forward x or .inverse y from a recorded
pair when there is one, and otherwise with a fresh uniform block, which may repeat a recorded one.
The forgetful sampler is neither a random function nor a random permutation; it is the object that
RandomPermutation.abs_sub_uniformPerm_forgetful_le compares a uniform permutation with.
The bound is information-theoretic: nothing is claimed about running time.
Main definitions #
strongBitStringCodec: the codec between word requests on two channels and typed permutation queries onm-bit blocks.
Main results #
strongBitStringCodec_wordOracle_evalPerm: a permutation table presentsstrongRandomPermOracle.advantage_strongPRPIdealGame_forgetful_le: a distinguisher making at mostQcalls has advantage at mostQ.choose 2 / 2 ^ blockLen nbetween the ideal strong-PRP game and its run against the forgetful sampler.
Bidirectional requests on m-bit blocks: channel true asks for the inverse.
On a request of the block length, the word oracle of strongBitStringCodec asks the typed query
and writes the reply as a word.
On any other request, the word oracle of strongBitStringCodec answers [].
A permutation table presents strongRandomPermOracle on the word channels.
The ideal strong-PRP game is the typed ideal chosen-ciphertext experiment
PRP.strongIdealExperiment of the adversary that reads valid words as blocks through
strongBitStringCodec (blockLen n).
A strong-PRP distinguisher against the forgetful sampler: a distinguisher making at most
Q calls tells the ideal strong-PRP game from its run against the forgetful lazy sampler with
advantage at most Q.choose 2 / 2 ^ blockLen n. This is
PRP.advantage_strongIdealExperiment_forgetful_le for the adversary reading valid words as blocks
through strongBitStringCodec (blockLen n).