Pseudorandom Functions (PRFs) #
This file defines pseudorandom functions and their security game.
A PRF adversary gets oracle access to uniform sampling plus a function D → R and tries to
distinguish the real function PRF.eval k (for a random key k) from a truly random function
(modeled as a lazy random oracle with consistent responses).
Main Definitions #
PRFScheme K D R— a PRF with key spaceK, domainD, and rangeR.PRFAdversary D R— a distinguisher with oracle access toD →ₒ R.prfRealExp— the real experiment (adversary queriesPRF.eval k).prfIdealExp— the ideal experiment (adversary queries a random oracle).prfAdvantage— distinguishing advantage.
Oracle interface for PRF distinguishers: unrestricted access to uniform sampling plus oracle access to the candidate function.
Instances For
A PRF adversary gets oracle access to uniform sampling and a function D → R,
and outputs a boolean guess (true = "real PRF", false = "random function").
Instances For
A PRF has uniform key generation when its keygen algorithm is exactly uniform sampling.
Instances For
Query implementation for the real PRF experiment. Uniform-sampling queries are handled
by the ambient unifSpec; function queries are answered by prf.eval k.
Instances For
Query implementation for the ideal PRF experiment. Uniform-sampling queries are handled
by the ambient unifSpec; function queries are answered by a lazy random oracle.
Instances For
Real PRF experiment: sample a key, let the adversary query prf.eval k.
Instances For
Ideal PRF experiment: let the adversary query a lazy random oracle (consistent random function). The oracle caches responses so that the same input always yields the same output.
Instances For
PRF advantage: how well the adversary distinguishes the real PRF from a random function.
Instances For
Forwarding lemmas for the PRF query implementations #
How prfRealQueryImpl/prfIdealQueryImpl act on a computation lifted in from the ambient
unifSpec (their identity-handled left summand) and on a function (Sum.inr) query. These are the
facts a PRF distinguisher reduction needs when it forwards its own uniform sampling / oracle access
through the PRF experiment: the unifSpec side is transparent, and an inr query is exactly the
candidate function (real: prf.eval k; ideal: the lazy random oracle).
The real PRF handler is transparent on a computation lifted in from unifSpec: its
unifSpec side is the identity handler and the function oracle is never consulted.
The ideal (lazy random oracle) PRF handler is transparent on a computation lifted in from
unifSpec, threading the cache: the result is just ob lifted into the cache state monad.
A function query (Sum.inr) under the real PRF handler evaluates the PRF.
A function query (Sum.inr) under the ideal PRF handler is the lazy random oracle at that
point.