Pseudorandom function

A pseudorandom function (PRF) is a keyed family of functions that no efficient adversary can distinguish from a uniformly random function given oracle access.

Syntax

A PRF is a pair of efficient algorithms with respect to keyspace , domain , and range :

  • is a randomized function that samples a key
  • is a deterministic function that takes a key and an input , outputting

The domain and range are families and of finite sets of strings of length polynomial in , each with an efficient uniform sampler, such that is superpolynomial in ( is negligible) and . The standard instance is with and with . Both conditions exclude trivial instances: with polynomial, a key that is a table of independent uniform values in , one per input, with the entry for , is pseudorandom unconditionally, and with every keyed family is — standard. On a domain of polynomial size the definition therefore carries content only for keys shorter than the function table of bits, and restricting a PRF to any efficiently embedded subset of its domain gives a family on that small domain, with the same key, that is pseudorandom in , since a distinguisher for it is a distinguisher for the PRF that queries only embedded points — standard. Neither the shape of the standard instance nor any relation between , and is required, and the range may be or a group, so a construction that XORs outputs with -bit blocks or feeds them back as inputs assumes a length-preserving PRF.

Properties

Security

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{prf}}_{\PRF,\calA}(\secpar)$}
\begin{algorithmic}
\State $k \gets \KeyGen(1^\secpar)$; $b \getsr \bits$
\State $R \getsr \Funcs(\calD,\calR)$
\Comment{Can be sampled lazily for efficiency}
\State $\calO_0(x) := \Eval(k,x)$
\State $\calO_1(x) := R(x)$
\State $b' \gets \calA^{\calO_b}(1^\secpar)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}

A PRF is pseudorandom if for all efficient ,

is negligible. The notion is due to GGM86.

Security against non-uniform adversaries

Let be a family of polynomial-size oracle circuits, a non-uniform adversary, with playing . is pseudorandom against non-uniform adversaries if for every such family , is negligible. Security against all non-uniform adversaries implies security against all uniform ones (Non-uniform PRF ⇒ PRF) — standard.

Variations

Length-preserving PRFs

A length-preserving PRF is a PRF with , for a polynomially bounded computable from in polynomial time with , so that the domain is superpolynomial; and are unconstrained. As an object, a length-preserving PRF denotes such a PRF, pseudorandom in , for some such , which the construction producing it fixes. It is a PRF (Length-preserving PRF ⇒ PRF), and restricting a compression-function PRF to the -padded copy of in gives one with (Compression-function PRF ⇒ Length-preserving PRF) — standard. A PRP on bit strings with domain is one up to the birthday term (PRP on bit strings ⇒ Length-preserving PRF) — BKR00. CBC-MAC, counter mode and the Wegman–Carter MAC use this shape, which a PRF with range lacks.

Compression-function PRFs

A compression-function PRF is, for some polynomially bounded and , computable from in polynomial time, with and , an efficiently computable taken as a PRF with , and , whose samples . As an object, a compression-function PRF denotes such an that is pseudorandom in . Pseudorandomness under a uniform -bit key already forces , since guessing the key and checking two queries gives advantage at least — standard. Outputs lie in the key space, so a chaining value can serve as the next key, as in the NMAC cascade; this is the premise of the uniform NMAC theorem of GPR14 (Compression-function PRF ⇒ MAC (NMAC, uniform proof)). XMSS uses one together with a length-halving second-preimage-resistant family of the same width (same-width SPR hash and PRF, SPR hash + PRF ⇒ Stateful DS (XMSS)) — HBG+18 (Sections 3.1.1.1, 3.1.2 and 4.1.2).

Non-uniform compression-function PRFs

A non-uniform compression-function PRF is an of the shape above, for some such and , taken as the PRF with uniform on , such that for every family of polynomial-size oracle circuits, a non-uniform adversary, with playing , is negligible. It is the premise of the NMAC theorem of Bel06 (Non-uniform compression-function PRF ⇒ MAC (NMAC)), whose reduction is non-uniform — GPR14.

Invertible PRFs

An invertible PRF (iPRF) extends the PRF with an inversion algorithm, allowing recovery of all inputs that map to a given output (Invertible PRFs ⇒ PRF) — HPPY25. An adds:

  • is a deterministic algorithm that returns the preimage set

There is a polynomial such that for every , every in the support of and every , runs in time at most for . Inversion is efficient relative to the size of its output, which may be exponential when — HPPY25.

Correctness

An iPRF is correct if for all and ,

over .

Security

An iPRF is pseudorandom if is pseudorandom in . In the stronger game , also has an inversion oracle that returns the preimage set of a given output .

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{iprf}}_{\mathsf{iPRF},\calA}(\secpar)$}
\begin{algorithmic}
\State $k \gets \KeyGen(1^\secpar)$; $b \getsr \bits$
\State $R \getsr \Funcs(\calD,\calR)$
\Comment{Can be sampled lazily for efficiency}
\State $\calO_0(x) := \Eval(k,x)$ ; $\calO_0^{-1}(y) := \Invert(k,y)$
\State $\calO_1(x) := R(x)$ ; $ \calO_1^{-1}(y) := R^{-1}(y)$
\State $b' \gets \calA^{\calO_b,\calO_b^{-1}}(1^\secpar)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}

An iPRF is strongly pseudorandom if for all efficient ,

is negligible.

As an object, an invertible PRF denotes a correct iPRF whose meets the running-time bound above and whose is pseudorandom (). Strong pseudorandomness () is a stronger notion: without the inversion oracle is .

Pseudorandom Injective Functions

A pseudorandom injective function is a PRF with such that is injective for every key , secure if for all efficient the advantage of in distinguishing from a uniformly random injective function is negligible: the PRF game with replaced by a uniform injection. With it meets PRP security but need not be efficiently invertible, so it need not be a PRP in the sense of that page. A -query distinguisher separates a uniform injection from a uniform function with advantage at most , by the coupling of the switching lemma, so for superpolynomial in a pseudorandom injective function is a PRF; a PRP on restricted to an injectively encoded is a pseudorandom injective function — standard.

Adding an inversion algorithm , returning the unique preimage of or , and giving an inversion oracle (whose ideal version, the inverse of the uniform injection, returns off its image) gives the invertible pseudorandom functions of BKW17, which for are exactly strong PRPs. Unlike the iPRFs above, they have at most one preimage per output. BKW17 give puncturable and single-key circuit-constrained invertible pseudorandom functions, and show that constrained PRPs are impossible for many classes of constraints under their definition, which is why the range is allowed to exceed the domain.

Puncturable PRFs

A puncturable PRF adds an algorithm outputting a key punctured at , with for all . It is secure if for all efficient that output before seeing the key, given the value is indistinguishable from uniform in — BW13, KPTZ13, BGI14. The GGM tree is puncturable: consists of the seeds of the siblings of the nodes on the path to (PRG ⇒ puncturable PRF) — BW13, KPTZ13, BGI14. Puncturable PRFs are the PRFs of the punctured-programming proofs of SW14.

Weak PRFs

A weak PRF has the syntax of a PRF but need only be pseudorandom on uniformly random inputs: instead of choosing evaluation points, receives pairs for fresh .

\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{wprf}}_{\PRF,\calA}(\secpar)$}
\begin{algorithmic}
\State $k \gets \KeyGen(1^\secpar)$; $b \getsr \bits$
\State $R \getsr \Funcs(\calD,\calR)$
\Comment{Can be sampled lazily for efficiency}
\State $\calO_0() := (x \getsr \calD;\; (x, \Eval(k,x)))$
\State $\calO_1() := (x \getsr \calD;\; (x, R(x)))$
\Comment{Each query samples a fresh $x$}
\State $b' \gets \calA^{\calO_b}(1^\secpar)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}

A PRF is weakly pseudorandom if for all efficient ,

is negligible.

Key-expanding weak PRFs

A key-expanding weak PRF is a weak PRF with , and , for polynomials and with , whose samples . It is secure against non-uniform adversaries: for every family of polynomial-size circuits playing the weak-PRF game above, the advantage is negligible. Pie09’s adversaries and reduction are non-uniform, so this premise is the one its theorem uses — Pie09. Each output splits into a key and an input, which the mode of Pie09 feeds back.

Other results

Participates in

Builds on Pseudorandom function

Produces Pseudorandom function

Barriers