This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

11institutetext: Georgia Institute of Technology, Atlanta, Georgia, US
11email: [email protected]
22institutetext: Portland State University, Portland, Oregon, US
22email: [email protected]
33institutetext: Paul G. Allen School of Computer Science & Engineering
University of Washington, Seattle, Washington, US
33email: [email protected]

Quantum Key-length Extension

Joseph Jaeger 11    Fang Song 22    Stefano Tessaro 33
Abstract

Should quantum computers become available, they will reduce the effective key length of basic secret-key primitives, such as blockciphers. To address this we will either need to use blockciphers with inherently longer keys or develop key-length extension techniques to amplify the security of a blockcipher to use longer keys.

We consider the latter approach and revisit the FX and double encryption constructions. Classically, FX was proven to be a secure key-length extension technique, while double encryption fails to be more secure than single encryption due to a meet-in-the-middle attack. In this work we provide positive results, with concrete and tight bounds, for the security of both of these constructions against quantum attackers in ideal models.

For FX, we consider a partially-quantum model, where the attacker has quantum access to the ideal primitive, but only classical access to FX. This is a natural model and also the strongest possible, since effective quantum attacks against FX exist in the fully-quantum model when quantum access is granted to both oracles. We provide two results for FX in this model. The first establishes the security of FX against non-adaptive attackers. The second establishes security against general adaptive attackers for a variant of FX using a random oracle in place of an ideal cipher. This result relies on the techniques of Zhandry (CRYPTO ’19) for lazily sampling a quantum random oracle. An extension to perfectly lazily sampling a quantum random permutation, which would help resolve the adaptive security of standard FX, is an important but challenging open question. We introduce techniques for partially-quantum proofs without relying on analyzing the classical and quantum oracles separately, which is common in existing work. This may be of broader interest.

For double encryption, we show that it amplifies strong pseudorandom permutation security in the fully-quantum model, strengthening a known result in the weaker sense of key-recovery security. This is done by adapting a technique of Tessaro and Thiruvengadam (TCC ’18) to reduce the security to the difficulty of solving the list disjointness problem and then showing its hardness via a chain of reductions to the known quantum difficulty of the element distinctness problem.

1 Introduction

The looming threat of quantum computers has inspired significant efforts to design and analyze post-quantum cryptographic schemes. In the public-key setting, polynomial-time quantum algorithms for factoring and computing discrete logarithms essentially break all practically deployed primitives [28].

In the secret-key setting, Grover’s quantum search algorithm [12] will reduce the effective key length of secret-key primitives by half. Thus, a primitive like the AES-128 blockcipher which may be thought to have 128 bits of security against classical computers may provide no more than 64 bits of security against a quantum computer, which would be considered significantly lacking. Even more worrisome, it was shown relatively recent that quantum computers can break several secret-key constructions completely such as the Even-Mansour blockcipher [23] and CBC-MAC [17] if we grant the attacker fully quantum access to the cryptosystem.

This would not be the first time that we find ourselves using too short of a key. A similar issue had to be addressed when the DES blockcipher was widely used and its 56 bit keylength was considered insufficient. Following approaches considered at that time, we can either transition to using basic primitives which have longer keys (e.g. replacing AES-128 with AES-256) or design key-length extension techniques to address the loss of concrete security due to quantum computers. In this paper we analyze the latter approach. We consider two key-length extension techniques, FX [20] and double encryption, and provide provable bounds against quantum attackers in ideal models.

Of broader and independent interest, our study of FX focuses on a hybrid quantum model which only allows for classical online access to the encrypted data, whereas offline computation is quantum. This model is sometimes referred to as the “Q1 model” in the cryptanalysis literature [17, 5], in contrast to the fully-quantum, so-called “Q2 model”, which allows for quantum online access. This is necessary in view of existing attacks in the Q2 model showing that FX is no more secure than the underlying cipher [24], but also, Q1 is arguably more realistic and less controversial than Q2. We observe that (as opposed to the plain model) ideal-model proofs in the Q1 model can be harder than those in the Q2 model, as we need to explicitly account for measuring the online queries to obtain improved bounds. In many prior ideal-model Q1 proofs, e.g. [21, 22, 14, 4, 18], this interaction is handled essentially for free because the effects of online and offline queries on an attacker’s advantage can largely be analyzed separately. Our work introduces techniques to handle the interaction between classical online queries and quantum offline ideal-model queries in Q1 proofs that cannot be analyzed separately. On the other hand, our result on double encryption considers the full Q2 model – and interestingly, restricting adversaries to the Q1 model does not improve the bound. To be self-explanatory we will often refer to the Q1 and Q2 models as the partially-quantum and fully-quantum models, respectively.

The remainder of this introduction provides a detailed overview of our results for these two constructions, and of the underlying challenges and techniques.

1.1 The FX Construction

The FX construction was originally introduced by Kilian and Rogaway [20] as a generalization of Rivest’s DESX construction. Consider a blockcipher 𝖤\mathsf{E} which uses a key K{0,1}kK\in\{0,1\}^{k} to encrypt messages M{0,1}nM\in\{0,1\}^{n}. Then the FX construction introduces “whitening” key K2{0,1}nK_{2}\in\{0,1\}^{n} which is xor-ed into the input and output of the blockcipher. Formally, this construction is defined by 𝖥𝖷[𝖤](KK2,M)=𝖤K(MK2)K2\mathsf{FX}[\mathsf{E}](K\,\|\,K_{2},M)=\mathsf{E}_{K}(M\oplus K_{2})\oplus K_{2}. (Note that the Even-Mansour blockcipher [11] may be considered to be a special case of this construction where k=0k=0, i.e., the blockcipher is a single permutation.) This construction has negligible efficiency overhead as compared to using 𝖤\mathsf{E} directly.

Kilian and Rogaway proved this scheme secure against classical attacks in the ideal cipher model. In particular, they established that

𝖠𝖽𝗏𝖥𝖷𝗌𝗉𝗋𝗉(𝒜)pq/2k+n1.\mathsf{Adv}^{\mathsf{sprp}}_{\mathsf{FX}}(\mathcal{A})\leq pq/2^{k+n-1}\,.

Here 𝖠𝖽𝗏𝗌𝗉𝗋𝗉\mathsf{Adv}^{\mathsf{sprp}} measures the advantage of 𝒜\mathcal{A} in breaking the strong pseudorandom permutation (SPRP) security of 𝖥𝖷\mathsf{FX} while making at most pp queries to the ideal cipher and at most qq queries to the 𝖥𝖷\mathsf{FX} construction. Compared to the p/2kp/2^{k} bound achieved by 𝖤\mathsf{E} alone, this is a clear improvement so 𝖥𝖷\mathsf{FX} can be considered a successful key-length extension technique again classical attackers.

Is this construction equally effective in the face of quantum attackers? The answer is unfortunately negative. Leander and May [24], inspired by a quantum attack due to Kuwakado and Morii [23] that completely breaks Even-Mansour blockcipher, gave a quantum attack against FX, which shows that the whitening keys provide essentially no additional security over that achieved by 𝖤\mathsf{E} in isolation. Bonnetain, et al. [5] further reduced the number of online quantum queries in the attack. Roughly speaking, O(n)O(n) quantum queries to FX construction and O(n2k/2)O(n2^{k/2}) local quantum computations of the blockcipher suffice to recover the secret encryption key. Note that, however, such attacks require full quantum access to both the ideal primitive and to the instance FX that is under attack, i.e. they are attacks in the fully-quantum model. The latter is rather strong and may be considered unrealistic. While we cannot prevent a quantum attacker from locally evaluating a blockcipher in quantum superposition, honest implementations of encryption will likely continue to be classical.111Some may argue that maintaining purely classical states, e.g., enforcing perfect measurements is also non-trivial physically. However, we deem maintaining coherent quantum superposition significantly more challenging.

Partially-quantum model.

Because of the realistic concern of the fully-quantum model and the attacks therein that void key extension in FX, we turn to the partially-quantum model in which the attacker makes quantum queries to ideal primitives, but only classical queries to the cryptographic constructions.

In this model there has been extensive quantum cryptanalysis on FX and related constructions [13, 5]. The best existing attack [5] recovers the key of FX using roughly 2(k+n)/32^{(k+n)/3} classical queries to the construction and 2(k+n)/32^{(k+n)/3} quantum queries to the ideal cipher. However, to date, despite the active development in provable quantum security, we are not aware of SPRP or just PRF security analysis, which gives stronger security guarantees. Namely, it should not just be infeasible to retrieve a key, but also to merely distinguish the system from a truly random permutation (or function). We note that in the special case where the primitives are plain-model instantiations (e.g., non-random-oracle hash functions), with a bit of care many security reductions carry over to the quantum setting [25]. This is because the underlying primitives are hidden from the adversary, and hence the difficulty arising from the interaction of classical and quantum queries to two correlated oracles becomes irrelevant.

Our main contribution on FX is to prove, for the first time, indistinguishability security in the partially-quantum model, in two restricted ways. Although they do not establish the complete security, our security bounds are tight in their respective settings.222Throughout, when mentioning tightness, we mean it with respect to the resources required to achieve advantage around one. The roots in our bounds make them weaker for lower resource regimes. Removing these is an interesting future direction.

Non-adaptive security.

We first consider non-adaptive security where we restrict the adversary such that its classical queries to the FX construction (but not to the underlying ideal cipher) must be specified before execution has begun. We emphasize that non-adaptive security of a blockcipher suffices to prove adaptive security for many practical uses of blockciphers such as the various randomized or stateful encryption schemes (e.g. those based on counter mode or output feedback mode) in which an attacker would have no control over the inputs to the blockcipher.

In this setting the bound we prove is of the form

𝖠𝖽𝗏𝖥𝖷𝗌𝗉𝗋𝗉-𝗇𝖺(𝒜)O(p2q/2k+n).\mathsf{Adv}^{\mathsf{sprp}\mbox{-}\mathsf{na}}_{\mathsf{FX}}(\mathcal{A})\leq O\left(\sqrt{p^{2}q/2^{k+n}}\right).

Supposing k=n=128k=n=128 (as with AES-128), an attacker able to make p264p\approx 2^{64} queries to the ideal cipher could break security of 𝖤\mathsf{E} in isolation. But to attack FX, such an attacker with access to q264q\approx 2^{64} encryptions would need to make p296p\approx 2^{96} queries to the ideal cipher. In fact we can see from our bound that breaking the security with constant probability would require the order of Ω(2(k+n)/3)\Omega(2^{(k+n)/3}) queries in total, matching the bound given in the attacks mentioned above [5]. Hence our bound is tight.

To prove this bound we apply a one-way to hiding (O2H) theorem of Ambainis, Hamburg, and Unruh [3], an improved version of the original one in [32]. This result provides a clean methodology for bounding the probability that an attacker can distinguish between two functions drawn from closely related distributions given quantum access. The non-adaptive setting allows us to apply this result by sampling the outputs of FX ahead of time and then considering the ideal world in which the ideal cipher is chosen independently of these outputs and the real world in which we very carefully reprogram this ideal cipher to be consistent with the outputs chosen for FX. These two ideal ciphers differ only in the O(q)O(q) places where we need to reprogram.

Adaptive security of FFX.

As a second approach towards understanding fully adaptive security of FX, we consider a variant construction (which we call FFX for “function FX”) that replaces the random permutation with a random function. In particular, suppose 𝖥\mathsf{F} is a function family which uses a key K{0,1}kK\in\{0,1\}^{k} on input messages M{0,1}nM\in\{0,1\}^{n} to produce outputs C{0,1}mC\in\{0,1\}^{m}. Then we define 𝖥𝖥𝖷[𝖥](KK2,M)=𝖥K(MK2)\mathsf{FFX}[\mathsf{F}](K\,\|\,K_{2},M)=\mathsf{F}_{K}(M\oplus K_{2}).333Note we have removed the external xor with K2K_{2}. In FX this xor is necessary, but in our analysis it would not provide any benefit for FFX. For this construction we prove a bound of the form

𝖠𝖽𝗏𝖥𝖥𝖷𝗉𝗋𝖿(𝒜)O(p2q/2k+n).\mathsf{Adv}^{\mathsf{prf}}_{\mathsf{FFX}}(\mathcal{A})\leq O\left(\sqrt{{p^{2}q}/{2^{k+n}}}\right).

in the partially-quantum random oracle model. Note that this matches the bound we obtained for the non-adaptive security of FX. Since the same key-recovery attack [5] also applies here, it follows that our bound is tight as well. Our proof combines two techniques of analyzing a quantum random oracle, the O2H theorem above and a simulation technique by Zhandry [35]. The two techniques usually serve distinct purposes. O2H is helpful to program a random oracle, whereas Zhandry’s technique is typically convenient for (compactly) maintaining a random oracle and providing some notion of “recording” the queries. In essence, in the two function distributions of O2H for which we aim to argue indistinguishability, we apply Zhandry’s technique to simulate the functions in a compact representation. As a result, analyzing the guessing game in O2H, which implies indistinguishability, becomes intuitive and much simplified. This way of combining them could also be useful elsewhere.

To build intuition for the approach of our proof, let us first consider one way to prove the security of this construction classically. The core idea is to use lazy sampling. In the ideal world, we can independently lazily sample a random function F:{0,1}k×{0,1}n{0,1}mF:\{0,1\}^{k}\crossproduct\{0,1\}^{n}\to\{0,1\}^{m} to respond to 𝖥\mathsf{F} queries and a random function T:{0,1}n{0,1}mT:\{0,1\}^{n}\to\{0,1\}^{m} to respond to 𝖥𝖥𝖷\mathsf{FFX} queries. These lazily random functions are stored in tables.

The real world can similarly be modeled by lazily sampling FF and TT to respond to the separate oracles. However, these oracles need to be kept consistent. So if the adversary ever queries MM to 𝖥𝖥𝖷\mathsf{FFX} and (K,MK2)(K,M\oplus K_{2}) to 𝖥\mathsf{F}, then the game should copy values between the two tables such that the same value is returned by both oracles. (Here KK and K2K_{2} are the keys honestly sampled by the game.) Alternatively, we can think of the return value being stored only in the TT table when such queries occur (rather than being copied into both tables) as long as we remember that this has happened. When represented in this manner, the two games only differ if the adversary makes such a pair of queries, where we think of the latter one as being “bad”. Thus a simple O(pq/2k+n)O(pq/2^{k+n}) bound on the probability of making such a query bounds the advantage of the adversary.

In our quantum security proof we wish to proceed analogously. First, we find a way to represent the responses to oracle queries with two (superpositions over) tables that are independent in the ideal world and dependent in the real world (the dependency occurs only for particular “bad” inputs). Then (using the O2H theorem of Ambainis, Hamburg, and Unruh) we can bound the distinguishing advantage by the probability of an attacker finding a “bad” input. In applying this theorem we will jointly think of the security game and its adversary 𝒜\mathcal{A} as a combined adversary 𝒜\mathcal{A}^{\prime} making queries to an oracle which takes in both the input of 𝒜\mathcal{A} and the tables being stored by the game – processing them appropriately.

The required representation of the oracles via two tables is a highly non-trivial step in the quantum setting. For starters, the no-cloning theorem prevents us from simply recording queries made by the adversary. This has been a recurring source of difficulty for numerous prior papers such as [33, 30, 9]. We make use of the recent elegant techniques of Zhandry [35] which established that, by changing the perspective (e.g., to the Fourier domain), a random function can be represented by a table which is initialized to all zeros and then xor-ed into with each oracle query made by the adversary. This makes it straightforward to represent the ideal world as two separate tables. To represent the real world similarly, we exploit the fact that the queries to FFX are classical. To check if an input to FFX is “bad” we simply check if the corresponding entry of the random oracle’s table is non-zero. To check if an input to the random oracle is “bad” we check if it overlaps with prior queries to FFX which we were able to record because they were classical. For a “bad” input we then share the storage of the two tables and this is the only case where the behavior of the real world differs from that of the ideal world. These “bad” inputs may of course be part of a superposition query and it is only for the bad components of the superposition that the games differ.

Difficulty of extending to FX.

It is possible that this proof could be extended to work for normal FX given an analogous way to lazily represent a random permutation. Unfortunately, no such representation is known.

Czajkowski, et al. [8] extended Zhandry’s lazy sampling technique to a more general class of random functions, but this does not include permutations because of the correlation between the different outputs of a random permutation. Chevalier, et al. [6] provided a framework for recording queries to quantum oracles, which enables succinctly recording queries made to an externally provided function for purposes of later responding to inverse queries. This is distinct from the lazy sampling of a permutation that we require. Rosmanis [27] introduced a new technique for analyzing random permutations in a compressed manner and applied it to the question of inverting a permutation (given only forward access to it). Additional ideas seem needed to support actions based on the oracle queries that have been performed so far. This is essential in order to extend our proof for the function variant of FX to maintain consistency for the real world in the face of “bad” queries.

Recent work of Czajkowski [7] provided an imperfect lazy sampling technique for permutations and used it to prove indifferentiability of SHA3. They claim that their lazy sampling strategy cannot be distinguished from a random permutation with advantage better than O(q2/2n)O(q^{2}/2^{n}). Unfortunately, this bound is too weak to be useful to our FX proof. For example, if knk\geq n we already have O(q2/2n)O(q^{2}/2^{n}) security without key-length extension. Determining if it is possible to perfectly lazily sample a random permutation remains an interesting future direction.

1.2 Double Encryption

The other key-extension technique we consider is double encryption. Given a blockcipher 𝖤:{0,1}k×{0,1}n{0,1}n\mathsf{E}:\{0,1\}^{k}\crossproduct\{0,1\}^{n}\to\{0,1\}^{n} this is defined by 𝖣𝖤[𝖤](K1K2,M)=𝖤K2(𝖤K1(M))\mathsf{DE}[\mathsf{E}](K_{1}\,\|\,K_{2},M)=\mathsf{E}_{K_{2}}(\mathsf{E}_{K_{1}}(M)). This construction requires more computational overhead than FX because it requires two separate application of the blockcipher with different keys. Classically, this construction is not considered to be a successful key-length extension technique because the meet-in-the-middle attack [10, 26] shows that it can be broken in essentially the same amount of time as 𝖤\mathsf{E} alone.

However, this does not rule out that double encryption is an effective key-length extension method in the quantum setting, as it is not clear that the Grover search algorithm [12] used to halve the effective keylength of blockciphers can be composed with the meet-in-the middle attack to unify their savings. The security of double encryption in the quantum setting was previously considered by Kaplan [16]. They related the key-recovery problem in double encryption to the claw-finding problem, and gave the tight quantum query bound Θ(N2/3)\Theta(N^{2/3}) for solving key recovery (here N=2kN=2^{k} is the length of the lists in the claw-finding problem). This indicates that in the quantum setting double encryption is in fact useful (compare to N1/2N^{1/2}), although key-recovery security is fairly weak.

We strengthen their security result by proving the SPRP security, further confirming double encryption as an effective key-extension scheme against quantum attacks. This is proven in the fully-quantum model, and the bound we obtain matches the attack in [16] which works in the partially-quantum model. Namely restricting to the weaker partially-quantum model would not improve the bound. Our result is obtained by a reduction to list disjointness. This is a worst-case decision problem measuring how well an algorithm can distinguish between a pair of lists with zero or exactly one element in common, which can be viewed as a decision version of the claw-finding problem. This reduction technique was originally used by Tessaro and Thiruvengadam [31] to establish a classical time-memory trade-off for double encryption. We observe that their technique works for a quantum adversary.

We then construct a chain of reductions to show that the known quantum hardness of element distinctness [1, 34] (deciding if a list of NN elements are all distinct) can be used to establish the quantum hardness of solving list disjointness. Our result (ignoring log factors) implies that a highly successful attacker must make Ω(22k/3)\Omega(2^{2k/3}) oracle queries which is more than the Ω(2k/2)\Omega(2^{k/2}) queries needed to attack 𝖤\mathsf{E} used in isolation.

Our proof starts by observing that Zhandry’s [34] proof of the hardness of the search version of element distinctness (finding a collision in a list) in fact implies that a promise version of element distinctness (promising that there is exactly one collision) is also hard. Then a simple reduction (randomly splitting the element distinctness list into two lists) shows the hardness of the search version of list disjointness. Next we provide a binary-search inspired algorithm showing that the decision version of list disjointness can be used to solve the search version, implying that the decision version must be hard. During our binary search we pad the lists we are considering with random elements to ensure that our lists maintain a fixed size which is necessary for our proof to go through.

The final bound we obtain for double encryption is of the form

𝖠𝖽𝗏𝖣𝖤𝗌𝗉𝗋𝗉(𝒜)O((qklgk)3/22k6).\mathsf{Adv}^{\mathsf{sprp}}_{\mathsf{DE}}(\mathcal{A})\leq O\left(\sqrt[6]{(q\cdot k\lg k)^{3}/2^{2k}}\right).

The sixth root arises in this bound from the final step in our chain of results analyzing list disjointness. The binary search algorithm requires its underlying decision list disjointness algorithm to have relatively high advantage. To obtain this from a given algorithm with advantage δ\delta we need to amplify its advantage by running in on the order of 1/δ21/\delta^{2} times. The number of queries depending on the square of δ\delta causes the root to arise in the proof.

1.3 Overview

In Section 2, we introduce preliminaries such as notation, basic cryptographic definitions, and some background on quantum computation that we will use throughout the paper. Following this, in Section 3 we consider the security of FX in the partially quantum setting. Non-adaptive SPRP security of FX is proven in Section 3.1 and adaptive PRF security of FFX is proven in Section 3.2. We conclude with Section 4 in which we prove the SPRP security of double encryption against fully quantum adaptive attacks.

2 Preliminaries

For n,mn,m\in\mathbb{N}, we let [n]={1,,n}[n]=\{1,\dots,n\} and [n..m]={n,n+1,,m}[n..m]=\{n,n+1,\dots,m\}. The set of length nn bit strings is denoted {0,1}n\{0,1\}^{n}. We use \,\|\, to denote string concatenation. We let 𝖨𝗇𝗃(n,m)\mathsf{Inj}(n,m) denote the set of injections f:[n][m]f:[n]\to[m].

We let y$𝒜[O1,](x1,)y{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathcal{A}[O_{1},\dots](x_{1},\dots) denote the (randomized) execution of algorithm 𝒜\mathcal{A} with input x1,x_{1},\dots and oracle access to O1,O_{1},\dots which produces output yy. For different 𝒜\mathcal{A} we will specify whether it can access its oracles in quantum superposition or only classically. If 𝒮\mathcal{S} is a set, then y$𝒮y{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathcal{S} denotes randomly sampling yy from 𝒮\mathcal{S}.

We express security notions via pseudocode games. See Fig. 1 for some example games. In the definition of games, oracles will sometimes be specified by pseudocode with the following form.

Oracle O(X1,:Z1,)\textsc{O}(X_{1},\dots:Z_{1},\dots)
//Code defining X1,X^{\prime}_{1},\dots and Z1,Z^{\prime}_{1},\dots
Return (X1,:Z1,)(X^{\prime}_{1},\dots:Z^{\prime}_{1},\dots)

This notation indicates that X1,X_{1},\dots are variables controlled by the adversary prior to the oracle query and Z1,Z_{1},\dots are variables controlled by the game itself which the adversary cannot access. At the end of the execution of the oracle, these variables are overwritten with the values indicated in the return statement. Looking ahead, we will be focusing on quantum computation so this notation will be useful to make it explicit that O can be interpreted as a unitary acting on the registers X1,X_{1},\dots and Z1,Z_{1},\dots (because O will be an efficiently computable and invertible permutation over these values). If 𝐇\mathbf{H} is a function stored by the game, then oracle access to 𝐇\mathbf{H} represents access to the oracle that on input (X,Y:𝐇)(X,Y:\mathbf{H}) returns (X,𝐇(X)Y:𝐇)(X,\mathbf{H}(X)\oplus Y:\mathbf{H}).

We define games as outputting boolean values and let Pr[G]\Pr[{\textsf{G}}] denote the probability that game G returns true. When not otherwise indicated, variables are implicitly initialized to store all 0’s.

If 𝒜\mathcal{A} is an adversary expecting access to multiple oracles we say that it is order consistent if the order it will alternate between queries to these different oracles is a priori fixed before execution. Note that order consistency is immediate if, e.g., 𝒜\mathcal{A} is represented by a circuit where each oracle is modeled by a separate oracle gate, but is not immediate for other possible representations of an adversary.

Ideal Models.

In this work we will work in ideal models – specifically, the random oracle model or the ideal cipher model. Fix k,n,mk,n,m\in\mathbb{N} (throughout this paper we will treat these parameters as having been fixed already). We let 𝖥𝖼𝗌(k,n,m)\mathsf{Fcs}(k,n,m) be the set of all functions 𝐇:{0,1}k×{0,1}n{0,1}m\mathbf{H}:\{0,1\}^{k}\times\{0,1\}^{n}\to\{0,1\}^{m} and 𝖨𝖼𝗌(k,n)𝖥𝖼𝗌(k,n,n)\mathsf{Ics}(k,n)\subset\mathsf{Fcs}(k,n,n) be the set of all functions 𝐄:{0,1}k×{0,1}n{0,1}n\mathbf{E}:\{0,1\}^{k}\times\{0,1\}^{n}\to\{0,1\}^{n} such that 𝐄(K,)\mathbf{E}(K,\cdot) is a permutation on {0,1}n\{0,1\}^{n}. When convenient, we will write 𝐇K(x)\mathbf{H}_{K}(x) in place of 𝐇(K,x)\mathbf{H}(K,x) for 𝐇𝖥𝖼𝗌(k,n,m)\mathbf{H}\in\mathsf{Fcs}(k,n,m). Similarly, we will write 𝐄K(x)\mathbf{E}_{K}(x) for 𝐄(K,x)\mathbf{E}(K,x) and 𝐄K1()\mathbf{E}^{-1}_{K}(\cdot) for the inverse of 𝐄K()\mathbf{E}_{K}(\cdot) when 𝐄𝖨𝖼𝗌(k,n)\mathbf{E}\in\mathsf{Ics}(k,n). When K=εK=\varepsilon we omit the subscript to 𝐇\mathbf{H} or 𝐄\mathbf{E}.

In the random oracle model, honest algorithms and the adversary are given oracle access to a randomly chosen 𝐇𝖥𝖼𝗌(k,n,m)\mathbf{H}\in\mathsf{Fcs}(k,n,m). In the ideal cipher model, they are given oracle access to 𝐄\mathbf{E} and 𝐄1\mathbf{E}^{-1} for 𝐄\mathbf{E} chosen at random from 𝖨𝖼𝗌(k,n)\mathsf{Ics}(k,n). We refer to queries to these oracles as primitive queries and queries to all other oracles as construction queries.

Game G𝖥,b𝗉𝗋𝖿(𝒜){\textsf{G}}^{\mathsf{prf}}_{\mathsf{F},b}(\mathcal{A}) 𝐇$𝖥𝖼𝗌(k,n,m)\mathbf{H}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Fcs}(k,n,m) K${0,1}𝖥.𝗄𝗅K{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\{0,1\}^{\mathsf{F}.\mathsf{kl}} F$𝖥𝖼𝗌(0,𝖥.𝗂𝗅,𝖥.𝗈𝗅)F{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Fcs}(0,\mathsf{F}.\mathsf{il},\mathsf{F}.\mathsf{ol}) b$𝒜[Ev,𝐇]b^{\prime}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathcal{A}[{\textsc{Ev},\mathbf{H}}] Return b=1b^{\prime}=1 Ev(X,Y:𝐇,K,F)\textsc{Ev}(X,Y:\mathbf{H},K,F) Y1𝖥[𝐇](K,X)Y_{1}\leftarrow\mathsf{F}[{\mathbf{H}}](K,X) Y0F(X)Y_{0}\leftarrow F(X) Return (X,YbY:𝐇,K,F)(X,Y_{b}\oplus Y:\mathbf{H},K,F)

Game G𝖤,b𝗌𝗉𝗋𝗉(𝒜){\textsf{G}}^{\mathsf{sprp}}_{\mathsf{E},b}(\mathcal{A}) 𝐄$𝖨𝖼𝗌(k,n)\mathbf{E}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Ics}(k,n) K${0,1}𝖤.𝗄𝗅K{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\{0,1\}^{\mathsf{E}.\mathsf{kl}} P$𝖨𝖼𝗌(0,𝖤.𝖻𝗅)P{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Ics}(0,\mathsf{E}.\mathsf{bl}) b$𝒜[Ev,Inv,𝐄,𝐄1]b^{\prime}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathcal{A}[{\textsc{Ev},\textsc{Inv},\mathbf{E},\mathbf{E}^{-1}}] Return b=1b^{\prime}=1 Ev(X,Y:𝐄,K,P)\textsc{Ev}(X,Y:\mathbf{E},K,P) Y1𝖤[𝐄](K,X)Y_{1}\leftarrow\mathsf{E}[{\mathbf{E}}](K,X) Y0P(X)Y_{0}\leftarrow P(X) Return (X,YbY:𝐄,K,P)(X,Y_{b}\oplus Y:\mathbf{E},K,P)
Inv(X,Y:𝐄,K,P)\textsc{Inv}(X,Y:\mathbf{E},K,P)
Y1𝖤1[𝐄](K,X)Y_{1}\leftarrow\mathsf{E}^{-1}[\mathbf{E}](K,X)
Y0P1(X)Y_{0}\leftarrow P^{-1}(X)
Return (X,YbY:𝐄,K,P)(X,Y_{b}\oplus Y:\mathbf{E},K,P)

Figure 1: Security games measuring PRF security of a family of functions 𝖥\mathsf{F} and SPRP security of a blockcipher 𝖤\mathsf{E}.

Function family and pseudorandomness.

A function family 𝖥\mathsf{F} is an efficiently computable element of 𝖥𝖼𝗌(𝖥.𝗄𝗅,𝖥.𝗂𝗅,𝖥.𝗈𝗅)\mathsf{Fcs}(\mathsf{F}.\mathsf{kl},\mathsf{F}.\mathsf{il},\mathsf{F}.\mathsf{ol}). If, furthermore, 𝖥𝖨𝖼𝗌(𝖥.𝗄𝗅,𝖥.𝗂𝗅)\mathsf{F}\in\mathsf{Ics}(\mathsf{F}.\mathsf{kl},\mathsf{F}.\mathsf{il}) and 𝖥1\mathsf{F}^{-1} is efficiently computable then we say 𝖥\mathsf{F} is a blockcipher and let 𝖥.𝖻𝗅=𝖥.𝗂𝗅\mathsf{F}.\mathsf{bl}=\mathsf{F}.\mathsf{il}.

If 𝖥\mathsf{F} is a function family (constructed using oracle access to a function 𝐇𝖥𝖼𝗌(k,n,m)\mathbf{H}\in\mathsf{Fcs}(k,n,m)), then its security (in the random oracle model) as a pseudorandom function (PRF) is measured by the game G𝗉𝗋𝖿{\textsf{G}}^{\mathsf{prf}} shown in Fig. 1. In it, the adversary 𝒜\mathcal{A} attempts to distinguish between a real world (b=1b=1) where it is given oracle access to 𝖥\mathsf{F} with a random key KK and an ideal world (b=0b=0) where it is given access to a random function. We define the advantage function 𝖠𝖽𝗏𝖥𝗉𝗋𝖿(𝒜)=Pr[G𝖥,1𝗉𝗋𝖿(𝒜)]Pr[G𝖥,0𝗉𝗋𝖿(𝒜)]\mathsf{Adv}^{\mathsf{prf}}_{\mathsf{F}}(\mathcal{A})=\Pr[{\textsf{G}}^{\mathsf{prf}}_{\mathsf{F},1}(\mathcal{A})]-\Pr[{\textsf{G}}^{\mathsf{prf}}_{\mathsf{F},0}(\mathcal{A})].

If 𝖤\mathsf{E} is a blockcipher (constructed using oracle access to a function 𝐄𝖨𝖼𝗌(k,n)\mathbf{E}\in\mathsf{Ics}(k,n) and its inverse), then its security (in the ideal cipher model) as a strong pseudorandom permutation (SPRP) is measured by the game G𝗌𝗉𝗋𝗉{\textsf{G}}^{\mathsf{sprp}} shown in Fig. 1. In it, the adversary 𝒜\mathcal{A} attempts to distinguish between a real world (b=1b=1) where it is given oracle access to 𝖤\mathsf{E}, 𝖤1\mathsf{E}^{-1} with a random key KK and an ideal world (b=0b=0) where it is given access to a random permutation. We define the advantage function 𝖠𝖽𝗏𝖥𝗌𝗉𝗋𝗉(𝒜)=Pr[G𝖥,1𝗌𝗉𝗋𝗉(𝒜)]Pr[G𝖥,0𝗌𝗉𝗋𝗉(𝒜)]\mathsf{Adv}^{\mathsf{sprp}}_{\mathsf{F}}(\mathcal{A})=\Pr[{\textsf{G}}^{\mathsf{sprp}}_{\mathsf{F},1}(\mathcal{A})]-\Pr[{\textsf{G}}^{\mathsf{sprp}}_{\mathsf{F},0}(\mathcal{A})].

In some examples, we will restrict attention to non-adaptive SPRP security. In such cases our attention is restricted to attackers whose queries to Ev and Inv when relevant are a priori fixed before execution. That is, 𝒜\mathcal{A} is a non-adaptive attacker which makes at most qq classical, non-adaptive queries to Ev,Inv\textsc{Ev},\textsc{Inv} if there exists M1,,Mq,Yq+1,,Yq{0,1}nM_{1},\dots,M_{q^{\prime}},Y_{q^{\prime}+1},\dots,Y_{q}\in\{0,1\}^{n} such that 𝒜\mathcal{A} only ever queries Ev on MiM_{i} for 1iq1\leq i\leq q^{\prime} and Inv on YiY_{i} for q+1iqq^{\prime}+1\leq i\leq q. Then we write 𝖠𝖽𝗏𝗌𝗉𝗋𝗉-𝗇𝖺(𝒜)\mathsf{Adv}^{\mathsf{sprp}\mbox{-}\mathsf{na}}(\mathcal{A}) in place of 𝖠𝖽𝗏𝗌𝗉𝗋𝗉(𝒜)\mathsf{Adv}^{\mathsf{sprp}}(\mathcal{A}).

2.1 Quantum Background

We assume the reader has basic familiarity with quantum computation. Quantum computation proceeds by performing unitary operations on registers which each contain a fixed number of qubits. We sometimes use \circ to denote composition of unitaries. Additionally, qubits may be measured in the computational basis. We will typically use the principle of deferred measurements to without loss of generality think of such measurements as being deferred until the end of computation.

The Hadamard transform \mathcal{H} acts on a bitstring x{0,1}nx\in\{0,1\}^{n} (for some nn\in\mathbb{N}) via |x=1/2nx(1)xx|x\mathcal{H}\ket{x}=1/\sqrt{2^{n}}\cdot\sum_{x^{\prime}}(-1)^{x\cdot x^{\prime}}\ket{x^{\prime}}. Here \cdot denotes inner product modulo 2 and the summation is over x{0,1}nx^{\prime}\in\{0,1\}^{n}. The Hadamard transform is its own inverse. We sometimes use the notation X1,X2,\mathcal{H}^{X_{1},X_{2},\dots} to denote the Hadamard transform applied to registers X1,X2,X_{1},X_{2},\dots.

We make use of the fact that if PP is a permutation for which both PP and P1P^{-1} can be efficiently implemented classically, then there is a comparable efficient quantumly computable unitary UPU_{P} which maps according to UP|x=|P(x)U_{P}\ket{x}=\ket{P(x)} for x{0,1}nx\in\{0,1\}^{n}. For simplicity, we often write PP in place of UPU_{P}. If f:{0,1}n{0,1}mf:\{0,1\}^{n}\to\{0,1\}^{m} is a function, we define the permutation f[](x,y)=(x,f(x)y)f[{\oplus}](x,y)=(x,f(x)\oplus y).

Game G𝐃,b𝖽𝗂𝗌𝗍(𝒜){\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},b}(\mathcal{A}) (S,S,P0,P0,P1,P1,z)$𝐃(S,S^{\prime},P_{0},P^{\prime}_{0},P_{1},P^{\prime}_{1},z){\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathbf{D} b$𝒜[Pb,Pb](z)b^{\prime}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathcal{A}[{P_{b}},{P^{\prime}_{b}}](z) Return b=1b^{\prime}=1 Game G𝐃𝗀𝗎𝖾𝗌𝗌(𝒜){\textsf{G}}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}) (S,S,P0,P0,P1,P1,z)$𝐃(S,S^{\prime},P_{0},P^{\prime}_{0},P_{1},P^{\prime}_{1},z){\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathbf{D} i${1,,q}i{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\{1,\dots,q\} Run 𝒜[P0,P0]\mathcal{A}[P_{0},P^{\prime}_{0}] until its ii-th query
Measure the input xx to this query
If the query is to P0P_{0} then
    Return xSx\in S
Else (the query is to P0P^{\prime}_{0})
    Return xSx\in S^{\prime}

Figure 2: Games used for O2H Theorem 2.1.

One-way to hiding.

We will make use of (a slight variant of) a one-way to hiding (O2H) theorem of Ambainis, Hamburg, and Unruh [3]. The theorem will consider an adversary given oracle access either to permutations (P0,P0)(P_{0},P^{\prime}_{0}) or permutations (P1,P1)(P_{1},P^{\prime}_{1}). It relates the advantage of the adversary in distinguishing between these two cases to the probability that the adversary can be used to find one of those points on which P0P_{0} differs from P1P_{1} or P0P^{\prime}_{0} differs from P1P^{\prime}_{1}. The result considers a distribution 𝐃\mathbf{D} over (S,S,P0,P0,P1,P1,z)(S,S^{\prime},P_{0},P^{\prime}_{0},P_{1},P^{\prime}_{1},z) where S,SS,S^{\prime} are sets, P0,P1P_{0},P_{1} are permutations on the same domain, P0,P1P^{\prime}_{0},P^{\prime}_{1} are permutations on the same domain, and z{0,1}z\in\{0,1\}^{\ast} is some auxiliary information. Such a 𝐃\mathbf{D} is valid if P0(x)=P1(x)P_{0}(x)=P_{1}(x) for all xSx\not\in S and P0(x)=P1(x)P^{\prime}_{0}(x)=P^{\prime}_{1}(x) for all xSx\not\in S^{\prime}. Now consider the game G𝐃,b𝖽𝗂𝗌𝗍{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},b} shown in Fig. 2. In it, an adversary 𝒜\mathcal{A} is given zz and tries to determine which of the oracle pairs it has access to. We define 𝖠𝖽𝗏𝐃𝖽𝗂𝗌𝗍(𝒜)=Pr[G𝐃,1𝖽𝗂𝗌𝗍(𝒜)]Pr[G𝐃,0𝖽𝗂𝗌𝗍(𝒜)]\mathsf{Adv}^{\mathsf{dist}}_{\mathbf{D}}(\mathcal{A})=\Pr[{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},1}(\mathcal{A})]-\Pr[{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},0}(\mathcal{A})].

The game G𝐃𝗀𝗎𝖾𝗌𝗌(𝒜){\textsf{G}}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}) in the same figure measures the ability of 𝒜\mathcal{A} to query its oracles on inputs at which P0P_{0} and P1P_{1} (or P0P^{\prime}_{0} and P1P^{\prime}_{1}) differ. It assumes that the adversary makes at most qq oracle queries. The adversary is halted in its execution on making a random one of these queries and the input to this query is measured. If the input falls in the appropriate set SS or SS^{\prime}, then the game returns true. Thus we can roughly think of this as a game in which 𝒜\mathcal{A} is trying to guess a point on which the two oracles differ. We define 𝖠𝖽𝗏𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)=Pr[G𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)]\mathsf{Adv}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A})=\Pr[{\textsf{G}}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A})], which leads to a bound on 𝖠𝖽𝗏𝐃𝖽𝗂𝗌𝗍(𝒜)\mathsf{Adv}^{\mathsf{dist}}_{\mathbf{D}}(\mathcal{A}).

Theorem 2.1 ([3], Thm.3)

Let 𝐃\mathbf{D} be a valid distribution and 𝒜\mathcal{A} be an adversary making at most qq oracle queries. Then 𝖠𝖽𝗏𝐃𝖽𝗂𝗌𝗍(𝒜)2q𝖠𝖽𝗏𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)\mathsf{Adv}^{\mathsf{dist}}_{\mathbf{D}}(\mathcal{A})\leq 2q\sqrt{\mathsf{Adv}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A})}.

Our statement of the theorem differs from the result as given in [3] in that we consider arbitrary permutations, rather than permutations of the form f[]f[{\oplus}] for some function ff, and we provide the attacker with access to two oracles rather than one.444Their result additionally allows the adversary to make oracle queries in parallel and bounds its advantage in terms of the “depth” of its oracle queries rather than the total number of queries. We omit this for simplicity. These are simply notational conveniences to match how we will be applying the theorem. The proof given in [3] suffices to establish this variant without requiring any meaningful modifications.

The most natural applications of this theorem would apply it to distributions 𝐃\mathbf{D} for which the guessing advantage 𝖠𝖽𝗏𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)\mathsf{Adv}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}) is small for any efficient adversary 𝒜\mathcal{A}. This will indeed be the case for our use of it in our Theorem 3.1. However, note that it can also be applied more broadly with a distribution 𝐃\mathbf{D} where it is not necessarily difficult to guess inputs on which the oracles differ. We will do so at the end of our proof of Theorem 3.2. Here we will use a deterministic 𝐃\mathbf{D} so, in particular, the sets SS and SS^{\prime} are a priori fixed and not hard to query. The trick we will use to profitably apply the O2H result is to exploit knowledge of the particular form that 𝒜\mathcal{A} will take (it will be a reduction adversary internally simulating the view of another adversary) to provide a useful bound on its guessing advantage 𝖠𝖽𝗏𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)\mathsf{Adv}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}).

3 The FX Construction

The FX construction (originally introduced by Kilian and Rogaway [20] as a generalization of Rivest’s DESX construction) is a keylength extension for blockciphers. In this construction, an additional key is used which is xor-ed with input and the output of the blockcipher.555Technically, the original definition of FX [20] uses distinct keys for xor-ing with the input and the output, but this would not provide any benefit in our concrete security analysis so we focus on the simplified construction. Formally, given a blockcipher 𝖤𝖨𝖼𝗌(𝖤.𝗄𝗅,𝖤.𝖻𝗅)\mathsf{E}\in\mathsf{Ics}(\mathsf{E}.\mathsf{kl},\mathsf{E}.\mathsf{bl}), the blockcipher 𝖥𝖷[𝖤]\mathsf{FX}[\mathsf{E}] is defined by 𝖥𝖷[𝖤](K1K2,x)=𝖤K1(xK2)K2\mathsf{FX}[\mathsf{E}](K_{1}\,\|\,K_{2},x)=\allowbreak\mathsf{E}_{K_{1}}(x\oplus K_{2})\oplus K_{2}. Here |K1|=𝖤.𝗄𝗅|K_{1}|=\mathsf{E}.\mathsf{kl} and |K2|=𝖤.𝖻𝗅|K_{2}|=\mathsf{E}.\mathsf{bl} so 𝖥𝖷[𝖤].𝗄𝗅=𝖤.𝗄𝗅+𝖤.𝖻𝗅\mathsf{FX}[\mathsf{E}].\mathsf{kl}=\mathsf{E}.\mathsf{kl}+\mathsf{E}.\mathsf{bl} and 𝖥𝖷[𝖤].𝖻𝗅=𝖤.𝖻𝗅\mathsf{FX}[\mathsf{E}].\mathsf{bl}=\mathsf{E}.\mathsf{bl}. Its inverse can similarly be computed as 𝖥𝖷[𝖤]1(K1K2,x)=𝖤K11(xK2)K2\mathsf{FX}[\mathsf{E}]^{-1}(K_{1}\,\|\,K_{2},x)=\mathsf{E}^{-1}_{K_{1}}(x\oplus K_{2})\oplus K_{2}. Let k=𝖤.𝗄𝗅k=\mathsf{E}.\mathsf{kl} and n=𝖤.𝖻𝗅n=\mathsf{E}.\mathsf{bl}.

Kilian and Rogaway [19] analyzed the PRP security of FX against classical attacks, showing that 𝖠𝖽𝗏𝖥𝖷𝗌𝗉𝗋𝗉(𝒜)2pq/2k+n\mathsf{Adv}^{\mathsf{sprp}}_{\mathsf{FX}}(\mathcal{A})\leq 2pq/2^{k+n} where qq is the number of Ev,Inv\textsc{Ev},\textsc{Inv} queries and pp is the number of 𝐄,𝐄1\mathbf{E},\mathbf{E}^{-1} queries made by 𝒜\mathcal{A} (with 𝖤\mathsf{E} modeled as an ideal cipher). In [24], Leander and May showed a quantum attack against the FX construction – establishing that the added whitening keys did not provide additionally security. This attack uses a clever combination of the quantum algorithms of Grover [12] and Simon [29]. It was inspired by an attack by Kuwakado and Morii [23] showing that the Even-Mansour blockcipher [11] provides no quantum security. Thus, it seems that 𝖥𝖷[𝖤]\mathsf{FX}[\mathsf{E}] does not provide meaningfully more security than 𝖤\mathsf{E} against quantum attackers.

However, the attack of Leander and May requires quantum access to both the FX construction and the underlying blockcipher 𝖤\mathsf{E}. This raises the question of whether the FX is actually an effective key-length extension technique in the partially-quantum setting where the adversary performs only classical queries to the construction oracles. In this section, we approach this question from two directions. First, in Section 3.1 we apply Theorem 2.1 with a careful representation of the real and ideal worlds to show that FX does indeed achieve improved security against non-adaptive attacks.

Analyzing the full adaptive security of FX against classical construction queries seems beyond the capabilities of current proof techniques. Accordingly, in Section 3.2, we consider a variant of FX in which a random oracle is used in place of the ideal cipher and prove its quantum PRF security. Here we apply a new reduction technique (built on the “sparse” quantum representation of a random function introduced by Zhandry [35] and Theorem 2.1, the O2H theorem from Ambainis, Hamburg, and Unruh [3]) to prove that this serves as an effective key-length extension technique in our setting. It seems likely that our technique could be extended to the normal FX construction, should an appropriate sparse quantum representation of random permutations be discovered.

3.1 Security of FX Against Non-Adaptive Attacks

The following theorem bounds the security of the FX construction against non-adaptive attacks (in which the non-adaptive queries are all classical). This result is proven via a careful use of Theorem 2.1 in which the distribution 𝐃\mathbf{D} is defined in terms of the non-adaptive queries that the adversary will make and defined so as to perfectly match the two worlds that 𝒜\mathcal{A} is attempting to distinguish between.

Theorem 3.1

Let 𝒜\mathcal{A} be a quantum adversary which makes at most qq classical, non-adaptive queries to Ev,Inv\textsc{Ev},\textsc{Inv} and consider 𝖥𝖷[]\mathsf{FX}[\cdot] with the underlying blockcipher modeled by an ideal cipher drawn from 𝖨𝖼𝗌(k,n)\mathsf{Ics}(k,n). Then

𝖠𝖽𝗏𝖥𝖷𝗌𝗉𝗋𝗉-𝗇𝖺(𝒜)8p2q/2k+n,\mathsf{Adv}^{\mathsf{sprp}\mbox{-}\mathsf{na}}_{\mathsf{FX}}(\mathcal{A})\leq\sqrt{8p^{2}q/2^{k+n}},

where pp is the number of quantum oracle queries that 𝒜\mathcal{A} makes to the ideal cipher.

Proof

We will use Theorem 2.1 to prove this result, so first we define a distribution 𝐃\mathbf{D}. Suppose that M1,,Mq{0,1}nM_{1},\dots,M_{q^{\prime}}\in\{0,1\}^{n} are the distinct queries 𝒜\mathcal{A} will make to Ev and Yq+1,,Yq{0,1}nY_{q^{\prime}+1},\dots,Y_{q}\in\{0,1\}^{n} are the distinct queries that 𝒜\mathcal{A} will make to Inv. The order in which these queries will be made does not matter. Then we define 𝐃\mathbf{D} as shown in Fig. 3. This distribution is valid (as required for Theorem 2.1) because G1G_{1} is reprogrammed to differ from G0G_{0} by making inputs in SS map to different values in SS^{\prime}.

Distribution 𝐃\mathbf{D} // Step 1: Sample responses to construction queries
For i=1,,qi=1,\dots,q^{\prime} do
    Yi${0,1}n{Y1,,Yi1}Y_{i}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\{0,1\}^{n}\setminus\{Y_{1},\dots,Y_{i-1}\}
    T[Mi]YiT[M_{i}]\leftarrow Y_{i}; T1[Yi]MiT^{-1}[Y_{i}]\leftarrow M_{i}
For i=q+1,,qi=q^{\prime}+1,\dots,q do
    If T1[Yi]T^{-1}[Y_{i}]\neq\bot then MiT1[Yi]M_{i}\leftarrow T^{-1}[Y_{i}]
    Else Mi${0,1}n{M1,,Mi1}M_{i}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\{0,1\}^{n}\setminus\{M_{1},\dots,M_{i-1}\}
    T[Mi]YiT[M_{i}]\leftarrow Y_{i}; T1[Yi]MiT^{-1}[Y_{i}]\leftarrow M_{i}
z(T,T1)z\leftarrow(T,T^{-1})
 // Step 2: Sample f0f_{0} as independent ideal cipher
f0$𝖨𝖼𝗌(k,n)f_{0}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Ics}(k,n)
 // Step 3: Reprogram f1f_{1} for consistency with construction queries
K1${0,1}kK_{1}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\{0,1\}^{k}
; K2${0,1}nK_{2}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\{0,1\}^{n}
{MiK2:1iq}\mathcal{I}\leftarrow\{M_{i}\oplus K_{2}:1\leq i\leq q\}; 𝒪{YiK2:1iq}\mathcal{O}\leftarrow\{Y_{i}\oplus K_{2}:1\leq i\leq q\}
{f01(K1,y):y𝒪}\mathcal{I}^{\prime}\leftarrow\{f_{0}^{-1}(K_{1},y):y\in\mathcal{O}\}; 𝒪{f0(K1,x):x}\mathcal{O}^{\prime}\leftarrow\{f_{0}(K_{1},x):x\in\mathcal{I}\}
S={(K1,x):x}S=\{(K_{1},x):x\in\mathcal{I}\cup\mathcal{I}^{\prime}\}; S={(K1,y):y𝒪𝒪}S^{\prime}=\{(K_{1},y):y\in\mathcal{O}\cup\mathcal{O}^{\prime}\}
For (K,x)S(K,x)\not\in S do
    f1(K,x)f0(K,x)f_{1}(K,x)\leftarrow f_{0}(K,x)
For i=1,,qi=1,\dots,q do
    f1(K1,MiK2)YiK2f_{1}(K_{1},M_{i}\oplus K_{2})\leftarrow Y_{i}\oplus K_{2}
For xx\in\mathcal{I}^{\prime}\setminus\mathcal{I} do
    f1(K1,x)$𝒪{f1(K1,x):x,f1(K1,x)}f_{1}(K_{1},x){\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathcal{O}^{\prime}\setminus\{f_{1}(K_{1},x):x\in\mathcal{I}\cup\mathcal{I}^{\prime},f_{1}(K_{1},x)\neq\bot\}
Return (S,S,f0[],f01[],f1[],f11[],z)(S,S^{\prime},f_{0}[{\oplus}],f_{0}^{-1}[{\oplus}],f_{1}[{\oplus}],f_{1}^{-1}[{\oplus}],z)

Figure 3: Distribution of oracles used in proof of Theorem 3.1.

We will show that the oracles output by this distribution (described in words momentarily) can be used to perfectly simulate the views expected by 𝒜\mathcal{A}. In particular, let 𝒜\mathcal{A}^{\prime} be an adversary (for G𝐃𝖽𝗂𝗌𝗍{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D}}) which runs 𝒜\mathcal{A}, responding to Ev(Mi)\textsc{Ev}(M_{i}) queries with T[Mi]T[M_{i}], responding to Inv(Yi)\textsc{Inv}(Y_{i}) queries with T1[Yi]T^{-1}[Y_{i}], and simulating 𝐄,𝐄1\mathbf{E},\mathbf{E}^{-1} with its own oracles fb[],fb1[]f_{b}[{\oplus}],f_{b}^{-1}[{\oplus}]. When 𝒜\mathcal{A} halts with output bb, this adversary halts with the same output. We claim that (i) Pr[G𝖥,1𝗌𝗉𝗋𝗉(𝒜)]=Pr[G𝐃,1𝖽𝗂𝗌𝗍(𝒜)]\Pr[{\textsf{G}}^{\mathsf{sprp}}_{\mathsf{F},1}(\mathcal{A})]=\Pr[{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},1}(\mathcal{A}^{\prime})] and (ii) Pr[G𝖥,0𝗌𝗉𝗋𝗉(𝒜)]=Pr[G𝐃,0𝖽𝗂𝗌𝗍(𝒜)]\Pr[{\textsf{G}}^{\mathsf{sprp}}_{\mathsf{F},0}(\mathcal{A})]=\Pr[{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},0}(\mathcal{A}^{\prime})]. This gives 𝖠𝖽𝗏𝖥𝗌𝗉𝗋𝗉-𝗇𝖺(𝒜)=𝖠𝖽𝗏𝐃𝖽𝗂𝗌𝗍(𝒜)\mathsf{Adv}^{\mathsf{sprp}\mbox{-}\mathsf{na}}_{\mathsf{F}}(\mathcal{A})=\mathsf{Adv}^{\mathsf{dist}}_{\mathbf{D}}(\mathcal{A}^{\prime}).

Claim (ii) follows by noting that the view of 𝒜\mathcal{A} is identical when run by G0𝗌𝗉𝗋𝗉{\textsf{G}}^{\mathsf{sprp}}_{0} or by 𝒜\mathcal{A}^{\prime} in G𝐃,0𝖽𝗂𝗌𝗍{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},0}. In G0𝗌𝗉𝗋𝗉{\textsf{G}}^{\mathsf{sprp}}_{0}, its construction queries are answered with the random permutation FF. When it is run by 𝒜\mathcal{A}^{\prime} in G𝐃,0𝖽𝗂𝗌𝗍{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},0}, these queries are answered with the tables TT and T1T^{-1} which can be viewed as having just lazily sampled enough of a random permutation to respond to the given queries. In both cases, its primitive oracle is an independently chosen ideal cipher.

Claim (i), follows by noting that the view of 𝒜\mathcal{A} is identical when run by G1𝗌𝗉𝗋𝗉{\textsf{G}}^{\mathsf{sprp}}_{1} or by 𝒜\mathcal{A}^{\prime} in G𝐃,1𝖽𝗂𝗌𝗍{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},1}. In G1𝗌𝗉𝗋𝗉{\textsf{G}}^{\mathsf{sprp}}_{1}, construction queries are answered by the 𝖥𝖷\mathsf{FX} construction using the ideal cipher and keys K1K_{1}, K2K_{2}. In the distribution, we first sample the responses to the construction queries and then construct the ideal cipher f1f_{1} by picking K1K_{1} and K2K_{2} and setting f1f_{1} to equal f0f_{0} except for places where we reprogram it to be consistent with these construction queries. The construction will map MiM_{i} to YiY_{i} for each ii, which means that the condition f1(K1,MiK2)=YiK2f_{1}(K_{1},M_{i}\oplus K_{2})=Y_{i}\oplus K_{2} should hold. These inputs and outputs are stored in the sets \mathcal{I} and 𝒪\mathcal{O}. The sets \mathcal{I}^{\prime} and 𝒪\mathcal{O}^{\prime} store the inputs mapping to 𝒪\mathcal{O} and outputs mapped to \mathcal{I} by f0(K1,)f_{0}(K_{1},\cdot), respectively. Thus while making the above condition hold, we additionally reprogram f1f_{1} so that elements of \mathcal{I}^{\prime}\setminus\mathcal{I} map to (random, non-repeating) elements of 𝒪𝒪\mathcal{O}^{\prime}\setminus\mathcal{O}.

In particular, the uniformity of f0f_{0} ensures that the map induced by f1(K1,)f_{1}(K_{1},\cdot) between {0,1}n()\{0,1\}^{n}\setminus(\mathcal{I}\cup\mathcal{I}^{\prime}) and {0,1}n(𝒪𝒪)\{0,1\}^{n}\setminus(\mathcal{O}\cup\mathcal{O}^{\prime}) is a random bijection. The last for loop samples a random bijection between \mathcal{I}^{\prime}\setminus\mathcal{I} and 𝒪𝒪\mathcal{O}^{\prime}\setminus\mathcal{O}. Because there are no biases in which values fall into these two cases among those of {0,1}n\{0,1\}^{n}\setminus\mathcal{I} and {0,1}n𝒪\{0,1\}^{n}\setminus\mathcal{O}, this means the map between these two sets is a uniform bijection as desired. A more detailed probability analysis of Claim (i) is given in Appendix 0.A.

Applying the bound on 𝖠𝖽𝗏𝐃𝖽𝗂𝗌𝗍(𝒜)\mathsf{Adv}^{\mathsf{dist}}_{\mathbf{D}}(\mathcal{A}^{\prime}) from Theorem 2.1 gives us

𝖠𝖽𝗏𝖥𝗌𝗉𝗋𝗉-𝗇𝖺(𝒜)2pPr[G𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)]\mathsf{Adv}^{\mathsf{sprp}\mbox{-}\mathsf{na}}_{\mathsf{F}}(\mathcal{A})\leq 2p\sqrt{\Pr[{\textsf{G}}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}^{\prime})]}

so we complete the proof by bounding this probability. Let 𝖿𝗐\mathsf{fw} denote the event that the ii-th query of 𝒜\mathcal{A}^{\prime} in H0𝐃{\textsf{H}}^{\mathbf{D}}_{0} is to f0f_{0} and let (K,x)(K,x) denote the measured value of this query so that

Pr[H𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)]=Pr[𝖿𝗐]Pr[(K,x)S𝖿𝗐]+Pr[¬𝖿𝗐]Pr[(K,x)S¬𝖿𝗐].\Pr[{\textsf{H}}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}^{\prime})]=\Pr[\mathsf{fw}]\cdot\Pr[(K,x)\in S\mid\mathsf{fw}]+\Pr[\neg\mathsf{fw}]\cdot\Pr[(K,x)\in S^{\prime}\mid\neg\mathsf{fw}].

A union bound over the different elements of SS gives

Pr[(K,x)S𝖿𝗐]\displaystyle\Pr[(K,x)\in S\mid\mathsf{fw}] j=1qPr[K=K1xMj=K2𝖿𝗐]\displaystyle\leq\sum_{j=1}^{q}\Pr[K=K_{1}\land x\oplus M_{j}=K_{2}\mid\mathsf{fw}]
+j=1qPr[K=K1G0(K1,x)Yj=K2𝖿𝗐].\displaystyle+\sum_{j=1}^{q}\Pr[K=K_{1}\land G_{0}(K_{1},x)\oplus Y_{j}=K_{2}\mid\mathsf{fw}].

However, note that the view of 𝒜\mathcal{A} in H0𝐃{\textsf{H}}^{\mathbf{D}}_{0} is independent of K1K_{1} and K2K_{2} so we get that

Pr[(K,x)S𝖿𝗐]2q/2k+n.\Pr[(K,x)\in S\mid\mathsf{fw}]\leq 2q/2^{k+n}.

Applying analogous analysis to the ¬𝖿𝗐\neg\mathsf{fw} case gives

Pr[(K,x)S¬𝖿𝗐]2q/2k+n\Pr[(K,x)\in S^{\prime}\mid\neg\mathsf{fw}]\leq 2q/2^{k+n}

and hence Pr[H0𝐃(𝒜)]2q/2k+n\Pr[{\textsf{H}}^{\mathbf{D}}_{0}(\mathcal{A}^{\prime})]\leq 2q/2^{k+n}. Plugging this into our earlier inequality gives the stated bound.∎

3.2 Adaptive Security of FFX

In this section we will prove the security of FFX (a variant of FX using a random oracle in place of the ideal cipher) against quantum adversaries making strictly classical queries to the construction.

Formally, given a function family 𝖥𝖥𝖼𝗌(𝖥.𝗄𝗅,𝖥.𝗂𝗅,𝖥.𝗈𝗅)\mathsf{F}\in\mathsf{Fcs}(\mathsf{F}.\mathsf{kl},\mathsf{F}.\mathsf{il},\mathsf{F}.\mathsf{ol}), we model the FFX construction by the function family 𝖥𝖥𝖷[𝖥]\mathsf{FFX}[\mathsf{F}] by 𝖥𝖥𝖷[𝖥](K1K2,x)=𝖥K1(xK2)\mathsf{FFX}[\mathsf{F}](K_{1}\,\|\,K_{2},x)=\mathsf{F}_{K_{1}}(x\oplus K_{2}).666The outer xor by K2K_{2} used in 𝖥𝖷\mathsf{FX} is omitted because it is unnecessary for our analysis. Here |K1|=𝖥.𝗄𝗅|K_{1}|=\mathsf{F}.\mathsf{kl} and |K2|=𝖥.𝗂𝗅|K_{2}|=\mathsf{F}.\mathsf{il} so 𝖥𝖥𝖷[𝖥].𝗄𝗅=𝖥.𝗄𝗅+𝖥.𝗂𝗅\mathsf{FFX}[\mathsf{F}].\mathsf{kl}=\mathsf{F}.\mathsf{kl}+\mathsf{F}.\mathsf{il}, 𝖥𝖥𝖷[𝖥].𝗂𝗅=𝖥.𝗂𝗅\mathsf{FFX}[\mathsf{F}].\mathsf{il}=\mathsf{F}.\mathsf{il}, and 𝖥𝖥𝖷[𝖥].𝗈𝗅=𝖥.𝗈𝗅\mathsf{FFX}[\mathsf{F}].\mathsf{ol}=\mathsf{F}.\mathsf{ol}. Let k=𝖥.𝗄𝗅k=\mathsf{F}.\mathsf{kl}, n=𝖥.𝗂𝗅n=\mathsf{F}.\mathsf{il}, and m=𝖥.𝗈𝗅m=\mathsf{F}.\mathsf{ol}.

Theorem 3.2

Let 𝒜\mathcal{A} be an order consistent quantum adversary which makes classical queries to Ev and consider 𝖥𝖥𝖷[]\mathsf{FFX}[\cdot] with the underlying function family modeled by a random oracle drawn from 𝖥𝖼𝗌(k,n,m)\mathsf{Fcs}(k,n,m). Then

𝖠𝖽𝗏𝖥𝖥𝖷𝗉𝗋𝖿(𝒜)8(p+q)pq2k+n,\mathsf{Adv}^{\mathsf{prf}}_{\mathsf{FFX}}(\mathcal{A})\leq\sqrt{\frac{8(p+q)pq}{2^{k+n}}},

where pp is the number of quantum oracle queries that 𝒜\mathcal{A} makes to the random oracle and qq is the number of queries it makes to Ev.

We can reasonably assume that p>qp>q so the dominant behavior of the above expression is O(p2q/2k+n)O\left(\sqrt{p^{2}q/2^{k+n}}\right).

The proof of this result proceeds via a sequence of hybrids which gradually transition from the real world of G𝖥𝖥𝖷𝗉𝗋𝖿{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX}} to the ideal world. Crucial to this sequence of hybrids are the technique of Zhandry [35] which, by viewing a space under dual bases, allows one to simulate a random function using a sparse representation table and to “record” the queries to the function. For the ideal world, we can represent the random oracle and the random function underlying Ev independently using such sparse representation tables. With some careful modification, we are also able to represent the real world’s random oracle using a similar pair of sparse representation tables as if it were two separate functions. However, in this case, the tables will be slightly non-independent in that if the adversary queries Ev on an input xx and the random oracle on (K1,xK2)(K_{1},x\oplus K_{2}) then the results of the latter query is stored in the Ev table, rather than the random oracle table. Beyond this minor consistency check (which we are only able to implement because the queries to Ev are classical and so can be stored by simulation), the corresponding games are identical. Having done this rewriting, we can carefully apply Theorem 2.1 to bound the ability of an adversary to distinguish between the two worlds by its ability to trigger this consistency check.

As mentioned in Section 2.1, our application of Theorem 2.1 here is somewhat atypical. Our distribution over functions 𝐃\mathbf{D} will be deterministic, but we are able to still extract a meaningful bound from this by taking advantage of our knowledge of the particular behavior of the adversary we apply Theorem 2.1 with.

Proof

In this proof we will consider a sequence of hybrid games H0{\textsf{H}}_{0} through H9{\textsf{H}}_{9}. Of these games we will establish the following claims.

  1. 1.

    Pr[G𝖥𝖥𝖷,0𝗉𝗋𝖿(𝒜)]=Pr[H0]=Pr[H1]=Pr[H2]=Pr[H3]\Pr[{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX},0}(\mathcal{A})]=\Pr[{\textsf{H}}_{0}]=\Pr[{\textsf{H}}_{1}]=\Pr[{\textsf{H}}_{2}]=\Pr[{\textsf{H}}_{3}]

  2. 2.

    Pr[G𝖥𝖥𝖷,1𝗉𝗋𝖿(𝒜)]=Pr[H9]=Pr[H8]=Pr[H7]=Pr[H6]=Pr[H5]=Pr[H4]\Pr[{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX},1}(\mathcal{A})]=\Pr[{\textsf{H}}_{9}]=\Pr[{\textsf{H}}_{8}]=\Pr[{\textsf{H}}_{7}]=\Pr[{\textsf{H}}_{6}]=\Pr[{\textsf{H}}_{5}]=\Pr[{\textsf{H}}_{4}]

  3. 3.

    Pr[H4]Pr[H3]8(p+q)pq/2𝖥.𝗄𝗅+𝖥.𝗂𝗅\Pr[{\textsf{H}}_{4}]-\Pr[{\textsf{H}}_{3}]\leq\sqrt{8(p+q)pq/2^{\mathsf{F}.\mathsf{kl}+\mathsf{F}.\mathsf{il}}}

Combining these claims gives the desired result.

In formally defining our hybrids we write the computation to be performed using the following quantum registers.

  • WW: The workspace of 𝒜\mathcal{A}. The adversary’s final output is written into W[1]W[1].

  • KK: The kk-qubit register (representing the function key/index) 𝒜\mathcal{A} uses when making oracle queries to the random oracle.

  • XX: The nn-qubit register (representing function inputs) used when making oracle queries to the random oracle or Ev.

  • YY: The mm-qubit register (representing function outputs) into which the results of oracle queries are written.

  • HH: The 2k+nm2^{k+n}\cdot m-qubit register which stores the function defining the random oracle (initially via its truth table).

  • FF: The 2nm2^{n}\cdot m-qubit register which stores the function defining Ev.

  • K1K_{1}: The kk-qubit register which stores the first key of the construction.

  • K2K_{2}: The nn-qubit register which stores the second key of the construction.

  • II: The logp\lceil\log p\rceil-qubit register which tracks how many Ev queries 𝒜\mathcal{A} has made.

  • X=(X1,,Xp)\vec{X}=(\vec{X}_{1},...,\vec{X}_{p}): The pp nn-qubit registers used to store the classical queries that 𝒜\mathcal{A} makes to Ev.

We start by changing our perspective. A quantum algorithm that makes classical queries to Ev can be modeled by thinking of a quantum algorithm that measures its XX register immediately before the query. (Because the behavior of Ev is completely classical at this point, we do not need to measure the YY register as well.) Measuring the register XX is indistinguishable from using a CNOT operation to copy it into a separate register (i.e. xor-ing XX into the previously empty register XI\vec{X}_{I} that will never again be modified). By incorporating this CNOT operation into the behavior of our hybrid game, we treat 𝒜\mathcal{A} as an attacker that makes fully quantum queries to its oracles in the hybrid game. We think of 𝒜\mathcal{A} as deferring all of measurements until the end of its computation. Because all that matters is its final output W[1]W[1] we can have the game measure just that register and assume that 𝒜\mathcal{A} does not internally make any measurements. The principle of deferred measurement ensures that the various changes discussed here do not change the behavior of 𝒜\mathcal{A}. This perspective change lets us use purely quantum analysis, rather than mixing quantum and classical.

Claim 1.

We start by considering the hybrids H0{\textsf{H}}_{0} through H3{\textsf{H}}_{3}, defined in Fig. 4 which are all identical to the ideal world of G𝖥𝖥𝖷𝗉𝗋𝖿{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX}}. In these transitions we are applying the ideas of Zhandry [35] to transition to representing the random functions stored in HH and FF by an all zeros table which is updated whenever the adversary makes a query.

The hybrid H0{\textsf{H}}_{0} is mostly just G𝖥𝖥𝖷𝗉𝗋𝖿{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX}} rewritten to use the registers indicated above. So Pr[G𝖥𝖥𝖷,0𝗉𝗋𝖿(𝒜)]=Pr[H0]\Pr[{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX},0}(\mathcal{A})]=\Pr[{\textsf{H}}_{0}] holds.

Games H0{\textsf{H}}_{0}, H1{\textsf{H}}_{1} 𝐇$𝖥𝖼𝗌(k,n,m)\mathbf{H}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Fcs}(k,n,m) F$𝖥𝖼𝗌(0,n,m)\textbf{F}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Fcs}(0,n,m) |H,F|𝐇,𝐅\ket{H,F}\leftarrow\ket{\mathbf{H},\mathbf{F}} |H,F|02k+nm,02nm\ket{H,F}\leftarrow\mathcal{H}\ket{0^{2^{k+n}\cdot m},0^{2^{n}\cdot m}} Run 𝒜[Ev,Ro]\mathcal{A}[{\textsc{Ev},\textsc{Ro}}]
Measure W[1]W[1], HH, FF
Return W[1]=1W[1]=1
Ev(X,Y:I,X,F)\textsc{Ev}(X,Y:I,\vec{X},F) II+1mod2|I|I\leftarrow I+1\mod 2^{|I|} XIXIX\vec{X}_{I}\leftarrow\vec{X}_{I}\oplus X YF(X)YY\leftarrow F(X)\oplus Y Return (X,Y:I,X,F)(X,Y:I,\vec{X},F)
Ro(K,X,Y:H)\textsc{Ro}(K,X,Y:H)
YHK(X)YY\leftarrow H_{K}(X)\oplus Y
Return (K,X,Y:H)(K,X,Y:H)

Games H2{\textsf{H}}_{2}, H3{\textsf{H}}_{3} |H,F|02k+nm,02nm\ket{H,F}\leftarrow\mathcal{H}\ket{0^{2^{k+n}\cdot m},0^{2^{n}\cdot m}} Run 𝒜[Y,FFEvY,F,Y,HFRoY,H]\mathcal{A}[{\mathcal{H}^{Y,F}\circ\textsc{FEv}\circ\mathcal{H}^{Y,F},\mathcal{H}^{Y,H}\circ\textsc{FRo}\circ\mathcal{H}^{Y,H}}] |H,F|02k+nm,02nm\ket{H,F}\leftarrow\ket{0^{2^{k+n}\cdot m},0^{2^{n}\cdot m}} Run 𝒜[YFEvY,YFRoY]\mathcal{A}[{\mathcal{H}^{Y}\circ\textsc{FEv}\circ\mathcal{H}^{Y},\mathcal{H}^{Y}\circ\textsc{FRo}\circ\mathcal{H}^{Y}}] |H,F|H,F\ket{H,F}\leftarrow\mathcal{H}\ket{H,F} Measure W[1]W[1], HH, FF
Return W[1]=1W[1]=1
FEv(X,Y:I,X,F)\textsc{FEv}(X,Y:I,\vec{X},F) II+1mod2|I|I\leftarrow I+1\mod 2^{|I|} XIXIX\vec{X}_{I}\leftarrow\vec{X}_{I}\oplus X F(X)F(X)YF(X)\leftarrow F(X)\oplus Y Return (X,Y:I,X,F)(X,Y:I,\vec{X},F)
FRo(K,X,Y:H)\textsc{FRo}(K,X,Y:H)
HK(X)HK(X)YH_{K}(X)\leftarrow H_{K}(X)\oplus Y
Return (K,X,Y:H)(K,X,Y:H)

Figure 4: Hybrid games H0{\textsf{H}}_{0} through H3{\textsf{H}}_{3} for the proof of Theorem 3.2 which are equivalent to the ideal world of G𝖥𝖥𝖷𝗉𝗋𝖿{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX}}. Highlighted or boxed code is only included in the correspondingly highlighted or boxed game.

Next consider H1{\textsf{H}}_{1} which differs from H0{\textsf{H}}_{0} only in the grey highlighted code which initializes HH and FF in the uniform superposition and then measures them at the end of execution. (Recall that the Hadamard transform applied to the all zeros state gives the uniform superposition.) Note that these register control, but are unaffected by the oracles Ev and Ro. Because they are never modified while 𝒜\mathcal{A} is executing, the principle of deferred measurement tells us that this modification is undetectable by 𝒜\mathcal{A}, giving Pr[H0]=Pr[H1]\Pr[{\textsf{H}}_{0}]=\Pr[{\textsf{H}}_{1}]

Next consider H2{\textsf{H}}_{2} which contains the boxed, but not the highlighted, code. This game uses the oracles FEv and FRo, the Fourier versions of Ev and Ro, which xor the YY value of 𝒜\mathcal{A}’s query into the the register FF or HH. Note that 𝒜\mathcal{A}’s access to these oracles is mitigated by Y,F\mathcal{H}^{Y,F} on each query. The superscript here indicate that the Hadamard transform is being applied to the registers YY and FF. We have that Y,FFEvY,F=Ev{\mathcal{H}^{Y,F}\circ\textsc{FEv}\circ\mathcal{H}^{Y,F}}=\textsc{Ev} and Y,HFRoY,H=Ro\mathcal{H}^{Y,H}\circ\textsc{FRo}\circ\mathcal{H}^{Y,H}=\textsc{Ro} both hold.777 This follows as a consequence of the following. Let UU_{\oplus} and UU^{\prime}_{\oplus} be the unitaries which for y,z{0,1}y,z\in\{0,1\} are defined by U|y,z=|yz,zU_{\oplus}\ket{y,z}=\ket{y\oplus z,z} and U|y,z=|y,yzU^{\prime}_{\oplus}\ket{y,z}=\ket{y,y\oplus z}. Then U=U\mathcal{H}\circ U_{\oplus}\circ\mathcal{H}=U^{\prime}_{\oplus}. So Pr[H1]=Pr[H2]\Pr[{\textsf{H}}_{1}]=\Pr[{\textsf{H}}_{2}] because the adversary’s oracles are identical.

Next consider H3{\textsf{H}}_{3} which contains the highlighted, but not the boxed, code. For this transition, recall that \mathcal{H}\circ\mathcal{H} is the identity operator. So to transition to this game we can cancel the \mathcal{H} operator used to initialize HH with the H\mathcal{H}^{H} operator applied before 𝒜\mathcal{A}’s first FRo oracle query. Similarly, we can cancel the H\mathcal{H}^{H} operation performed after any (non-final) FRo query with the H\mathcal{H}^{H} operation performed before the next FRo query. Finally, the H\mathcal{H}^{H} operation that would be performed after the final FRo query is instead delayed to be performed immediately before HH is measured. (We could have omitted this operation and measurement entirely because all that matters at that point is the measurement of W[1]W[1].) The \mathcal{H} operators on FF are similarly changed. Because 𝒜\mathcal{A} does not have access to the HH and FF registers, we can indeed commute the \mathcal{H} operators with 𝒜\mathcal{A} in this manner without changing behavior. Hence Pr[H2]=Pr[H3]\Pr[{\textsf{H}}_{2}]=\Pr[{\textsf{H}}_{3}], as desired. Note that HH and FF independently store tables which are initialized to all zeros and then written into by the adversary’s queries.

Games H9{\textsf{H}}_{9}, H8{\textsf{H}}_{8} 𝐇$𝖥𝖼𝗌(k,n,m)\mathbf{H}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Fcs}(k,n,m) 𝐊𝟏${0,1}k\mathbf{K_{1}}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\{0,1\}^{k} 𝐊𝟐${0,1}n\mathbf{K_{2}}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\{0,1\}^{n} |H,K1,K2|𝐇,𝐊𝟏,𝐊𝟐\ket{H,K_{1},K_{2}}\leftarrow\ket{\mathbf{H},\mathbf{K_{1}},\mathbf{K_{2}}} |H,K1,K2|02k+nm,0k,0n\ket{H,K_{1},K_{2}}\leftarrow\mathcal{H}\ket{0^{2^{k+n}\cdot m},0^{k},0^{n}} Run 𝒜[Ev,Ro]\mathcal{A}[{\textsc{Ev},\textsc{Ro}}]
Measure W[1]W[1], HH, K1K_{1}, K2K_{2}
Return W[1]=1W[1]=1
Ev(X,Y:H,I,X,K1,K2)\textsc{Ev}(X,Y:H,I,\vec{X},K_{1},K_{2}) II+1mod2|I|I\leftarrow I+1\mod 2^{|I|} XIXIX\vec{X}_{I}\leftarrow\vec{X}_{I}\oplus X YHK1(XK2)YY\leftarrow H_{K_{1}}(X\oplus K_{2})\oplus Y Return (X,Y:H,I,X,K1,K2)(X,Y:H,I,\vec{X},K_{1},K_{2})
Ro(K,X,Y:H)\textsc{Ro}(K,X,Y:H)
YHK(X)YY\leftarrow H_{K}(X)\oplus Y
Return (K,X,Y:H)(K,X,Y:H)

Games H7{\textsf{H}}_{7}, H6{\textsf{H}}_{6} |H,K1,K2|02k+nm,0k,0n\ket{H,K_{1},K_{2}}\leftarrow\mathcal{H}\ket{0^{2^{k+n}\cdot m},0^{k},0^{n}} OY,HFEvY,HO\leftarrow{\mathcal{H}^{Y,H}\circ\textsc{FEv}\circ\mathcal{H}^{Y,H}} OY,HFRoY,HO^{\prime}\leftarrow\mathcal{H}^{Y,H}\circ\textsc{FRo}\circ\mathcal{H}^{Y,H} Run 𝒜[O,O]\mathcal{A}[O,O^{\prime}] |K1,K2|0k,0n\ket{K_{1},K_{2}}\leftarrow\mathcal{H}\ket{0^{k},0^{n}} |H|02k+nm\ket{H}\leftarrow\ket{0^{2^{k+n}\cdot m}} Run 𝒜[YFEvY,YFRoY]\mathcal{A}[{\mathcal{H}^{Y}\circ\textsc{FEv}\circ\mathcal{H}^{Y},\mathcal{H}^{Y}\circ\textsc{FRo}\circ\mathcal{H}^{Y}}] |H|H\ket{H}\leftarrow\mathcal{H}\ket{H} Measure W[1]W[1], HH, K1K_{1}, K2K_{2}
Return W[1]=1W[1]=1
FEv(X,Y:H,I,X,K1,K2)\textsc{FEv}(X,Y:H,I,\vec{X},K_{1},K_{2}) II+1mod2|I|I\leftarrow I+1\mod 2^{|I|} XIXIX\vec{X}_{I}\leftarrow\vec{X}_{I}\oplus X HK1(XK2)HK1(XK2)YH_{K_{1}}(X\oplus K_{2})\leftarrow H_{K_{1}}(X\oplus K_{2})\oplus Y Return (X,Y:H,I,X,K1,K2)(X,Y:H,I,\vec{X},K_{1},K_{2})
FRo(K,X,Y:H)\textsc{FRo}(K,X,Y:H)
HK(X)HK(X)YH_{K}(X)\leftarrow H_{K}(X)\oplus Y
Return (K,X,Y:H)(K,X,Y:H)

Figure 5: Hybrid games H9{\textsf{H}}_{9} through H6{\textsf{H}}_{6} for the proof of Theorem 3.2 which are equivalent to the real world of G𝖥𝖥𝖷𝗉𝗋𝖿{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX}}. Highlighted or boxed code is only included in the correspondingly highlighted or boxed game.

Claim 2.

We now consider the hybrids H4{\textsf{H}}_{4} through H9{\textsf{H}}_{9} (starting from H9{\textsf{H}}_{9}), which are defined in Fig. 5 and Fig. 6 using similar ideas as in the transition from H0{\textsf{H}}_{0} through H3{\textsf{H}}_{3}. As we will justify, these games are all equivalent to the real world of G𝖥𝖥𝖷𝗉𝗋𝖿{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX}}.

First H9{\textsf{H}}_{9} rewrote the real world of G𝖥𝖥𝖷𝗉𝗋𝖿{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX}} to use our specified registers and to record queries into X\vec{X} in Ev. Then in H8{\textsf{H}}_{8}, rather than sampling HH, K1K_{1}, and K2K_{2} uniformly at the beginning of the game we put them in the uniform superposition and measure them at the end of the game. For H7{\textsf{H}}_{7} we replace our oracles that xor into the adversary’s YY register with oracles that xor into the HH register using Hadamard operations, some of which we then cancel out to transition to H6{\textsf{H}}_{6}. The same arguments from Claim 1 of why these sorts of modifications do not change the behavior of the game apply here and so Pr[G𝖥𝖥𝖷,1𝗉𝗋𝖿(𝒜)]=Pr[H9]=Pr[H8]=Pr[H7]=Pr[H6]\Pr[{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX},1}(\mathcal{A})]=\Pr[{\textsf{H}}_{9}]=\Pr[{\textsf{H}}_{8}]=\Pr[{\textsf{H}}_{7}]=\Pr[{\textsf{H}}_{6}].

Games H5{\textsf{H}}_{5}, H4{\textsf{H}}_{4} |K1,K2|0k,0n\ket{K_{1},K_{2}}\leftarrow\mathcal{H}\ket{0^{k},0^{n}} |H,F|02k+nm,02nm\ket{H,F}\leftarrow\ket{0^{2^{k+n}\cdot m},0^{2^{n}\cdot m}} OY𝒯FEv𝒯YO\leftarrow\mathcal{H}^{Y}\circ\mathcal{T}\circ\textsc{FEv}\circ\mathcal{T}\circ\mathcal{H}^{Y} OY𝒯FRo𝒯YO^{\prime}\leftarrow\mathcal{H}^{Y}\circ\mathcal{T}\circ\textsc{FRo}\circ\mathcal{T}\circ\mathcal{H}^{Y} Run 𝒜[O,O]\mathcal{A}[{O,O^{\prime}}] Run 𝒜[YFEvY,YFRoY]\mathcal{A}[{\mathcal{H}^{Y}\circ\textsc{FEv}^{\prime}\circ\mathcal{H}^{Y},\mathcal{H}^{Y}\circ\textsc{FRo}^{\prime}\circ\mathcal{H}^{Y}}] |H,F,I,X,K1,K2𝒯|H,F,I,X,K1,K2\ket{H,F,I,\vec{X},K_{1},K_{2}}\leftarrow\mathcal{T}\ket{H,F,I,\vec{X},K_{1},K_{2}} |H|H\ket{H}\leftarrow\mathcal{H}\ket{H} Measure W[1]W[1], HH, K1K_{1}, K2K_{2}
Return W[1]=1W[1]=1
FRo(K,X,Y:H,F,I,X,K1,K2)\textsc{FRo}^{\prime}(K,X,Y:H,F,I,\vec{X},K_{1},K_{2})
If K=K1K=K_{1} and XK2{X1,,XI}X\oplus K_{2}\in\{\vec{X}_{1},\dots,\vec{X}_{I}\} then
     // Input is bad
    F(XK2)F(XK2)YF(X\oplus K_{2})\leftarrow F(X\oplus K_{2})\oplus Y
Else
    HK(X)HK(X)YH_{K}(X)\leftarrow H_{K}(X)\oplus Y
Return (K,X,Y:H,F,I,X,K1,K2)(K,X,Y:H,F,I,\vec{X},K_{1},K_{2})
FEv(X,Y:H,I,X,K1,K2)\textsc{FEv}(X,Y:H,I,\vec{X},K_{1},K_{2}) II+1mod2|I|I\leftarrow I+1\mod 2^{|I|} XIXIX\vec{X}_{I}\leftarrow\vec{X}_{I}\oplus X HK1(XK2)HK1(XK2)YH_{K_{1}}(X\oplus K_{2})\leftarrow H_{K_{1}}(X\oplus K_{2})\oplus Y Return (X,Y:H,I,X,K1,K2)(X,Y:H,I,\vec{X},K_{1},K_{2})
FRo(K,X,Y:H)\textsc{FRo}(K,X,Y:H)
HK(X)HK(X)YH_{K}(X)\leftarrow H_{K}(X)\oplus Y
Return (K,X,Y:H)(K,X,Y:H)
FEv(X,Y:H,F,I,X,K1,K2)\textsc{FEv}^{\prime}(X,Y:H,F,I,\vec{X},K_{1},K_{2})
II+1mod2|I|I\leftarrow I+1\mod 2^{|I|}
XIXIX\vec{X}_{I}\leftarrow\vec{X}_{I}\oplus X
𝖻𝗈𝗈𝗅1(X{X1,,XI1})\mathsf{bool}_{1}\leftarrow(X\not\in\{\vec{X}_{1},\dots,\vec{X}_{I-1}\})
𝖻𝗈𝗈𝗅2(HK1(XK2)0m)\mathsf{bool}_{2}\leftarrow(H_{K_{1}}(X\oplus K_{2})\neq 0^{m})
𝖻𝗈𝗈𝗅3(F(X)0m)\mathsf{bool}_{3}\leftarrow(F(X)\neq 0^{m})
If 𝖻𝗈𝗈𝗅1\mathsf{bool}_{1} and (𝖻𝗈𝗈𝗅2\mathsf{bool}_{2} or 𝖻𝗈𝗈𝗅3\mathsf{bool}_{3}) then
     // Input is bad
    F(X)F(X)F^{\prime}(X)\leftarrow F(X)
    F(X)HK1(XK2)F(X)\leftarrow H_{K_{1}}(X\oplus K_{2})
    HK1(XK2)F(X)H_{K_{1}}(X\oplus K_{2})\leftarrow F^{\prime}(X)
F(X)F(X)YF(X)\leftarrow F(X)\oplus Y
Return (X,Y:H,I,X,K1,K2)(X,Y:H,I,\vec{X},K_{1},K_{2})

Figure 6: Hybrid games H5{\textsf{H}}_{5} and H4{\textsf{H}}_{4} for the proof of Theorem 3.2 which are equivalent to the real world of G𝖥𝖥𝖷𝗉𝗋𝖿{\textsf{G}}^{\mathsf{prf}}_{\mathsf{FFX}}. Highlighted or boxed code is only included in the correspondingly highlighted or boxed game. Unitary 𝒯\mathcal{T} is define in the text.

Our next transitions are designed to make the current game’s oracles identical with those of H3{\textsf{H}}_{3}, except on some “bad” inputs. In H6{\textsf{H}}_{6} we have a single all zeros table HH which gets written into by queries that 𝒜\mathcal{A} makes to either of its oracles, while in H3{\textsf{H}}_{3} the oracles separately wrote into either HH or FF. For H5{\textsf{H}}_{5} we will similarly separate the single table HH into separate tables HH and FF. However, we cannot keep them completely independent, because if the adversary queries FEv with X=xX=x and FRo with (K,X)=(K1,xK2)(K,X)=(K_{1},x\oplus K_{2}) then both of these operations would be writing into the same table location in H6{\textsf{H}}_{6}. Consider the following unitary 𝒯\mathcal{T} which acts on registers HH and FF and is controlled by the registers II, X\vec{X}, K1K_{1}, and K2K_{2}. We will think of this unitary as transitioning us between a representation of HH as a single table (with an all-zero FF table) and a representation of it divided between HH and FF.

𝒯(H,F,I,X,K1,K2)\mathcal{T}(H,F,I,\vec{X},K_{1},K_{2})
For x{X1,,XI}x\in\{\vec{X}_{1},\dots,\vec{X}_{I}\} do
     F(x)F(x)F^{\prime}(x)\leftarrow F(x)
     F(x)HK1(xK2)F(x)\leftarrow H_{K_{1}}(x\oplus K_{2})
     HK1(xK2)F(x)H_{K_{1}}(x\oplus K_{2})\leftarrow F^{\prime}(x)
Return (H,F,I,X,K1,K2)(H,F,I,\vec{X},K_{1},K_{2})

In words, 𝒯\mathcal{T} swaps F(x)F(x) and HK1(xK2)H_{K_{1}}(x\oplus K_{2}) for each xx that has been previous queried to FEv (as stored by X\vec{X} and II). Note that 𝒯\mathcal{T} is its own inverse. In H5{\textsf{H}}_{5} we (i) initialize the table FF as all zeros, (ii) perform 𝒯\mathcal{T} before and after each oracle query, and (iii) perform 𝒯\mathcal{T} after 𝒜\mathcal{A} has executed. We verify that HH has the same value in H5{\textsf{H}}_{5} that it would have had in H6{\textsf{H}}_{6} during each oracle query and at the end before measurement. The application of 𝒯\mathcal{T} before the first oracle query does nothing (because I=0I=0) so HH is all zeros for this query as required. As we’ve seen previously with \mathcal{H}, we can commute 𝒯\mathcal{T} with the operations of 𝒜\mathcal{A} because 𝒯\mathcal{T} only acts on registers outside of the adversary’s control. We can similarly commute 𝒯\mathcal{T} with Y\mathcal{H}^{Y}. Hence the 𝒯\mathcal{T} operation after every non-final oracle query can be seen to cancel with the 𝒯\mathcal{T} operation before the following oracle query. The 𝒯\mathcal{T} operation after the final oracle query cancels with the 𝒯\mathcal{T} operation performed after 𝒜\mathcal{A} halts execution. Hence, Pr[H6]=Pr[H5]\Pr[{\textsf{H}}_{6}]=\Pr[{\textsf{H}}_{5}] as claimed.

For the transition to H4{\textsf{H}}_{4} let us dig into how our two-table representation in H5{\textsf{H}}_{5} works so that we can incorporate the behavior of 𝒯\mathcal{T} directly into the oracles. For simplicity of notation in discussion, let H~(x)\widetilde{H}(x) denote HK1(xK2)H_{K_{1}}(x\oplus K_{2}). First note that in between oracle queries the two tables representation of H5{\textsf{H}}_{5} will satisfy the property that for each x{X1,,XI}x\in\{\vec{X}_{1},\dots,\vec{X}_{I}\} we will have H~(x)=0𝖥.𝗈𝗅\widetilde{H}(x)=0^{\mathsf{F}.\mathsf{ol}} and for all other xx we will have that F(x)=0𝖥.𝗈𝗅F(x)=0^{\mathsf{F}.\mathsf{ol}}.888More precisely, the corresponding registers hold superpositions over tables satisfying the properties we discuss. This is the case because after each query we have applied 𝒯\mathcal{T} to an HH which contains the same values it would have in H6{\textsf{H}}_{6} and an FF which is all zeros.

Now consider when a 𝒯FEv𝒯\mathcal{T}\circ\textsc{FEv}\circ\mathcal{T} query is executed with some XX and YY. If X{X1,,XI}X\in\{\vec{X}_{1},\dots,\vec{X}_{I}\}, then F(X)F(X) and H~(X)\widetilde{H}(X) are swapped, YY is xored into H~(X)\widetilde{H}(X), then finally F(X)F(X) and H~(X)\widetilde{H}(X) are swapped back. Equivalently, we could have xored YY directly into F(X)F(X) and skipped the swapping around. If X{X1,,XI}X\not\in\{\vec{X}_{1},\dots,\vec{X}_{I}\}, then YY is xored into H~(X)\widetilde{H}(X) before F(X)F(X) and H~(X)\widetilde{H}(X) are swapped. If H~(X)=0F.𝗈𝗅\widetilde{H}(X)=0^{F.\mathsf{ol}} beforehand, then we could equivalently have xored YY directly into F(X)F(X) and skipped the swapping around (because F(X)=0𝖥.𝗈𝗅F(X)=0^{\mathsf{F}.\mathsf{ol}} must have held from our assumption on XX). If H~(X)0F.𝗈𝗅\widetilde{H}(X)\neq 0^{F.\mathsf{ol}} beforehand, then we could equivalently could have swapped H~(X)\widetilde{H}(X) and F(X)F(X) first, then xored YY into F(X)F(X). The equivalent behavior we described is exactly the behavior captured by the oracle FEv\textsc{FEv}^{\prime} which is used in H4{\textsf{H}}_{4} in place of 𝒯FEv𝒯\mathcal{T}\circ\textsc{FEv}\circ\mathcal{T}. It checks if X{X1,,XI}X\not\in\{\vec{X}_{1},\dots,\vec{X}_{I}\} (𝖻𝗈𝗈𝗅1\mathsf{bool}_{1}) and H~(X)0m\widetilde{H}(X)\neq 0^{m} (𝖻𝗈𝗈𝗅𝟤\mathsf{bool_{2}}), performing a swap if so. Then YY is xored into F(X)F(X). A swap is also performed if X{X1,,XI1}X\not\in\{\vec{X}_{1},\dots,\vec{X}_{I-1}\} and F(X)0mF(X)\neq 0^{m}, however this case is impossible from our earlier observation that F(x)=0mF(x)=0^{m} when XX is not in X\vec{X}. This second case was added only to ensure that FEv\textsc{FEv}^{\prime} is a permutation.

Similarly, consider when a 𝒯FRo𝒯\mathcal{T}\circ\textsc{FRo}\circ\mathcal{T} query is executed with some KK, XX, YY. Any swapping done by 𝒯\mathcal{T} uses HK1H_{K_{1}}, so when KK1K\neq K_{1} this just xors YY into HK(X)H_{K}(X). If XK2X\oplus K_{2} is not in {X1,,XI}\{\vec{X}_{1},\dots,\vec{X}_{I}\}, then HK(X)H_{K}(X) is unaffected by the swapping so again this just xors YY into HK(X)H_{K}(X). When K=K1K=K_{1} and XK2{X1,,XI}X\oplus K_{2}\in\{\vec{X}_{1},\dots,\vec{X}_{I}\}, first HK(X)H_{K}(X) would have been swapped with F(XK2)F(X\oplus K_{2}), then YY would be xored into HK(X)H_{K}(X), then HK(X)H_{K}(X) and F(XK2)F(X\oplus K_{2}) would be swapped back. Equivalently, we could just have xored YY into F(XK2)F(X\oplus K_{2}) and skipped the swapping. This behavior we described is exactly the behavior captured by the oracle FRo\textsc{FRo}^{\prime} which is used in H4{\textsf{H}}_{4} in place of 𝒯FRo𝒯\mathcal{T}\circ\textsc{FRo}\circ\mathcal{T}.

We have just described that on the inputs we care about FEv\textsc{FEv}^{\prime} behaves identically to 𝒯FEv𝒯\mathcal{T}\circ\textsc{FEv}\circ\mathcal{T} and FRo\textsc{FRo}^{\prime} behaves identically to 𝒯FRo𝒯\mathcal{T}\circ\textsc{FRo}\circ\mathcal{T}. Hence Pr[H5]=Pr[H4]\Pr[{\textsf{H}}_{5}]=\Pr[{\textsf{H}}_{4}], completing this claim.

Games H~3\widetilde{{\textsf{H}}}_{3}, H~4\widetilde{{\textsf{H}}}_{4} |K1,K2|0k,0n\ket{K_{1},K_{2}}\leftarrow\mathcal{H}\ket{0^{k},0^{n}} |H,F|02k+nm,02nm\ket{H,F}\leftarrow\ket{0^{2^{k+n}\cdot m},0^{2^{n}\cdot m}} Run 𝒜[YFEvY,YFRoY]\mathcal{A}[{\mathcal{H}^{Y}\circ\textsc{FEv}\circ\mathcal{H}^{Y},\mathcal{H}^{Y}\circ\textsc{FRo}\circ\mathcal{H}^{Y}}]
Measure W[1]W[1]
Return W[1]=1W[1]=1
FRo(K,X,Y:H,F,I,X,K1,K2)\textsc{FRo}(K,X,Y:H,F,I,\vec{X},K_{1},K_{2})
If K=K1K=K_{1} and XK2{X1,,XI}X\oplus K_{2}\in\{\vec{X}_{1},\dots,\vec{X}_{I}\} then
     // Input is bad
    F(XK2)F(XK2)YF(X\oplus K_{2})\leftarrow F(X\oplus K_{2})\oplus Y
    HK(X)HK(X)YH_{K}(X)\leftarrow H_{K}(X)\oplus Y
Else
    HK(X)HK(X)YH_{K}(X)\leftarrow H_{K}(X)\oplus Y
Return (K,X,Y:H,F,I,X,K1,K2)(K,X,Y:H,F,I,\vec{X},K_{1},K_{2})
FEv(X,Y:H,F,I,X,K1,K2)\textsc{FEv}(X,Y:H,F,I,\vec{X},K_{1},K_{2}) II+1mod2|I|I\leftarrow I+1\mod 2^{|I|} XIXIX\vec{X}_{I}\leftarrow\vec{X}_{I}\oplus X 𝖻𝗈𝗈𝗅1(X{X1,,XI1})\mathsf{bool}_{1}\leftarrow(X\not\in\{\vec{X}_{1},\dots,\vec{X}_{I-1}\}) 𝖻𝗈𝗈𝗅2(HK1(XK2)0m)\mathsf{bool}_{2}\leftarrow(H_{K_{1}}(X\oplus K_{2})\neq 0^{m}) 𝖻𝗈𝗈𝗅3(F(X)0m)\mathsf{bool}_{3}\leftarrow(F(X)\neq 0^{m}) If 𝖻𝗈𝗈𝗅1\mathsf{bool}_{1} and (𝖻𝗈𝗈𝗅2\mathsf{bool}_{2} or 𝖻𝗈𝗈𝗅3\mathsf{bool}_{3})
     // Input is bad
    F(X)F(X)F^{\prime}(X)\leftarrow F(X)
    F(X)HK1(XK2)F(X)\leftarrow H_{K_{1}}(X\oplus K_{2})
    HK1(XK2)F(X)H_{K_{1}}(X\oplus K_{2})\leftarrow F^{\prime}(X)
F(X)F(X)YF(X)\leftarrow F(X)\oplus Y
Return (X,Y:H,I,X,K1,K2)(X,Y:H,I,\vec{X},K_{1},K_{2})

Figure 7: Hybrid games H~3\widetilde{{\textsf{H}}}_{3} and H~4\widetilde{{\textsf{H}}}_{4} for the proof of Theorem 3.2 which are rewritten versions of H3{\textsf{H}}_{3} and H4{\textsf{H}}_{4} to emphasize that their oracles are identical-until-bad. Highlighted or boxed code is only included in the correspondingly highlighted or boxed game.

Claim 3.

To compare hybrids H3{\textsf{H}}_{3} and H4{\textsf{H}}_{4} we will note their oracles only differ on a small number of inputs (in particular those labelled as bad by comments in our code) and then apply Theorem 2.1 to bound the difference between them. To aid in this we have rewritten them as H~3\widetilde{{\textsf{H}}}_{3} and H~4\widetilde{{\textsf{H}}}_{4} in Fig. 7. For both we have removed some operations performed after 𝒜\mathcal{A} halted its execution for cleanliness because these operations on registers other than W[1]W[1] cannot affect the probability that it is measured to equal 11. So we have Pr[H~3]=Pr[H3]\Pr[\widetilde{{\textsf{H}}}_{3}]=\Pr[{\textsf{H}}_{3}] and Pr[H~4]=Pr[H4]\Pr[\widetilde{{\textsf{H}}}_{4}]=\Pr[{\textsf{H}}_{4}].

Let FEv3\textsc{FEv}_{3} and FRo3\textsc{FRo}_{3} be the permutations defining the corresponding oracle in H~3\widetilde{{\textsf{H}}}_{3}. Define FEv4\textsc{FEv}_{4} and FRo4\textsc{FRo}_{4} analogously. These permutations differ only on the inputs we referred to as bad. So let SS denote the set of bad X,H,F,I,X,K1,K2X,H,F,I,\vec{X},K_{1},K_{2} for FEv (i.e. those for which 𝖻𝗈𝗈𝗅1\mathsf{bool}_{1} and either 𝖻𝗈𝗈𝗅2\mathsf{bool}_{2} or 𝖻𝗈𝗈𝗅3\mathsf{bool}_{3} hold). Let SS^{\prime} denote the set of bad K,X,H,F,I,X,K1,K2K,X,H,F,I,\vec{X},K_{1},K_{2} for FRo (i.e. those for which K=K1K=K_{1} and XK{X1,,XI}X\oplus K\in\{\vec{X}_{1},\dots,\vec{X}_{I}\}). Let 𝐃\mathbf{D} denote the distribution which always outputs (S,S,FEv3,FRo3,FEv4,FRo4,ε)(S,S^{\prime},\textsc{FEv}_{3},\textsc{FRo}_{3},\textsc{FEv}_{4},\textsc{FRo}_{4},\varepsilon). Clearly this is a valid distribution for Theorem 2.1 by our choice of SS and SS^{\prime}.

Now we can define an adversary 𝒜\mathcal{A}^{\prime} for G𝐃,b𝖽𝗂𝗌𝗍{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},b} which simulates the view of 𝒜\mathcal{A} in H~3+b\widetilde{{\textsf{H}}}_{3+b} by locally running the code of that hybrid except for during oracle queries when it uses its fbf_{b} oracle to simulate FEv and fbf^{\prime}_{b} oracle to simulate FRo. Because the simulation of these views are perfect we have that

Pr[H~3]Pr[H~4]=𝖠𝖽𝗏𝐃𝖽𝗂𝗌𝗍(𝒜)2(p+q)𝖠𝖽𝗏𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)\displaystyle\Pr[\widetilde{{\textsf{H}}}_{3}]-\Pr[\widetilde{{\textsf{H}}}_{4}]=\mathsf{Adv}^{\mathsf{dist}}_{\mathbf{D}}(\mathcal{A}^{\prime})\leq 2(p+q)\sqrt{\mathsf{Adv}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}^{\prime})}

where the inequality follows from Theorem 2.1, noting that 𝒜\mathcal{A}^{\prime} makes p+qp+q oracle queries.

To complete the proof we bound 𝖠𝖽𝗏𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)\mathsf{Adv}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}^{\prime}). In the following probability calculation we use xx and ii to denote random variables taking on the values the corresponding variables have at the end of an execution of G𝐃𝗀𝗎𝖾𝗌𝗌(𝒜){\textsf{G}}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}). Let 𝒮\mathcal{S} denote a random variable which equals SS if the measured query is to f0f_{0} and equals SS^{\prime} otherwise. Then conditioning over each possible value of ii gives

𝖠𝖽𝗏𝐃𝗀𝗎𝖾𝗌𝗌(𝒜)=Pr[x𝒮]\displaystyle\mathsf{Adv}^{\mathsf{guess}}_{\mathbf{D}}(\mathcal{A}^{\prime})=\Pr[x\in\mathcal{S}] =j=1p+qPr[x𝒮i=j]Pr[i=j]\displaystyle=\sum_{j=1}^{p+q}\Pr[x\in\mathcal{S}\mid i=j]\Pr[i=j]
=(p+q)1j=1p+qPr[x𝒮i=j].\displaystyle=(p+q)^{-1}\sum_{j=1}^{p+q}\Pr[x\in\mathcal{S}\mid i=j].

Because 𝒜\mathcal{A} is order consistent we can pick disjoint sets EE and RR with ER={1,,p+q}E\cup R=\{1,\dots,p+q\} such that iEi\in E means the ii-th query is to 𝒜\mathcal{A}’s FEv oracle and iRi\in R means that the ii-th query is to its FRo oracle. Note that |E|=q|E|=q and |R|=p|R|=p. The view of 𝒜\mathcal{A} (when run by 𝒜\mathcal{A}^{\prime}) in G𝐃𝗀𝗎𝖾𝗌𝗌{\textsf{G}}^{\mathsf{guess}}_{\mathbf{D}} matches its view in H~3\widetilde{{\textsf{H}}}_{3} so, in particular, it is independent of K1K_{1} and K2K_{2}. Hence we can think of these keys being chosen at random at the end of execution when analyzing the probability of x𝒮x\in\mathcal{S}.

For a FRo query, the check for bad inputs is if K1=KK_{1}=K and K2{XX1,,XXI}K_{2}\in\{X\oplus\vec{X}_{1},\dots,X\oplus\vec{X}_{I}\}. The variable II is counting the number of FEv queries made so far, so I<qI<q. By a union bound,

Pr[xSi=j]q/2𝖥.𝗄𝗅+𝖥.𝗂𝗅\Pr[x\in S^{\prime}\mid i=j]\leq q/2^{\mathsf{F}.\mathsf{kl}+\mathsf{F}.\mathsf{il}}

when jRj\in R.

For a FEv query, the check for bad inputs is if X{X1,,XI1}X\not\in\{\vec{X}_{1},\dots,\vec{X}_{I-1}\} and HK1(XK2)H_{K_{1}}(X\oplus K_{2}) is non-zero.999Note that the other bad inputs, for which X{X1,,XI1}X\not\in\{\vec{X}_{1},\dots,\vec{X}_{I-1}\} and F(X)F(X) is non-zero, will never occur. In H~3\widetilde{{\textsf{H}}}_{3}, each query to FRo can make a single entry of HH non-zero so it will never have more than pp non-zero entries. By a union bound,

Pr[xSi=j]p/2𝖥.𝗄𝗅+𝖥.𝗂𝗅\Pr[x\in S\mid i=j]\leq p/2^{\mathsf{F}.\mathsf{kl}+\mathsf{F}.\mathsf{il}}

when jEj\in E.

The proof is then completed by noting

j=1p+qPr[x𝒮i=j]\displaystyle\sum_{j=1}^{p+q}\Pr[x\in\mathcal{S}\mid i=j] =jRPr[xSi=j]+jEPr[xSi=j]\displaystyle=\sum_{j\in R}\Pr[x\in S^{\prime}\mid i=j]+\sum_{j\in E}\Pr[x\in S\mid i=j]
p(q/2𝖥.𝗄𝗅+𝖥.𝗂𝗅)+q(p/2𝖥.𝗄𝗅+𝖥.𝗂𝗅)=2pq/2𝖥.𝗄𝗅+𝖥.𝗂𝗅\displaystyle\leq p(q/2^{\mathsf{F}.\mathsf{kl}+\mathsf{F}.\mathsf{il}})+q(p/2^{\mathsf{F}.\mathsf{kl}+\mathsf{F}.\mathsf{il}})=2pq/2^{\mathsf{F}.\mathsf{kl}+\mathsf{F}.\mathsf{il}}

and plugging in to our earlier expression.∎

4 Double Encryption

In this section we prove the security of the double encryption key-length extension technique against fully quantum attacks. Our proof first reduces this to the ability of a quantum algorithm to solve the list disjointness problem and then extends known query lower bounds for element distinctness to list disjointness (with some modifications).

The double encryption blockcipher is constructed via two sequential application of an underlying blockcipher. Formally, given a blockcipher 𝖤𝖨𝖼𝗌(𝖤.𝗄𝗅,𝖤.𝖻𝗅)\mathsf{E}\in\mathsf{Ics}(\mathsf{E}.\mathsf{kl},\mathsf{E}.\mathsf{bl}), we define the double encryption blockcipher 𝖣𝖤[𝖤]\mathsf{DE}[\mathsf{E}] by 𝖣𝖤[𝖤](K1K2,x)=𝖤K2(𝖤K1(x))\mathsf{DE}[\mathsf{E}](K_{1}\,\|\,K_{2},x)=\mathsf{E}_{K_{2}}(\mathsf{E}_{K_{1}}(x)). Here |K1|=|K2|=𝖤.𝗄𝗅|K_{1}|=|K_{2}|=\mathsf{E}.\mathsf{kl} so 𝖣𝖤[𝖤].𝗄𝗅=2𝖤.𝗄𝗅\mathsf{DE}[\mathsf{E}].\mathsf{kl}=2\mathsf{E}.\mathsf{kl} and 𝖣𝖤[𝖤].𝖻𝗅=𝖤.𝖻𝗅\mathsf{DE}[\mathsf{E}].\mathsf{bl}=\mathsf{E}.\mathsf{bl}. Its inverse can be computed as 𝖣𝖤[𝖤]1(K1K2,x)=𝖤K11(𝖤K21(x))\mathsf{DE}[\mathsf{E}]^{-1}(K_{1}\,\|\,K_{2},x)=\mathsf{E}^{-1}_{K_{1}}(\mathsf{E}^{-1}_{K_{2}}(x)).

Classically, the meet-in-the-middle attack [10, 26] shows that this construction achieves essentially the same security a single encryption. In the quantum setting, this construction was recently considered by Kaplan [16]. They gave an attack and matching security bound for the key-recovery security of double encryption. This leaves the question of whether their security result can be extended to cover full SPRP security, which we resolve by the main theorem of this section. This theorem is proven via a reduction technique of Tessaro and Thiruvengadam [31] which they used to establish a (classical) time-memory tradeoff for the security of double encryption, by reducing its security to the list disjointness problem and conjecturing a time-memory tradeoff for that problem.

Problems and languages.

In addition to the list disjointness problem (1LD), we will also consider two versions of the element distinctness problem (ED, 1ED). In general, a problem PB specifies a relation \mathcal{R} on set on instances \mathcal{I} (i.e. \mathcal{R} is function which maps an instance LL\in\mathcal{I} and witness ww to a decision (L,w){0,1}\mathcal{R}(L,w)\in\{0,1\}). This relation induces a language ={L:w,(L,w)=1}\mathcal{L}=\{L\in\mathcal{I}:\exists w,\mathcal{R}(L,w)=1\}. Rather than think of instances as bit strings, we will think of them as functions (to which decision and search algorithms are given oracle access). To restrict attention to functions of specific sizes we let (D,R)=(D,R)\mathcal{L}({D,R})=\mathcal{L}\cap\mathcal{I}({D,R}) where (D,R)\mathcal{I}({D,R}) denotes the restriction of \mathcal{I} to functions L:[D][R]L:[D]\to[R], where DRD\leq R. To discuss instances not in the language we let =\mathcal{L}^{\prime}=\mathcal{I}\setminus\mathcal{L} and (D,R)=(D,R){\mathcal{L}^{\prime}}({D,R})=\mathcal{I}({D,R})\setminus\mathcal{L}.

Problems have decision and search versions. The goal of a decision algorithm is to output 1 (representing “acceptance”) on instances in the language and 0 (representing “rejection”) otherwise. Relevant quantities are the minimum probability P1P^{1} of accepting an instance in the language, the maximum probability P0P^{0} of accepting an instance not in the language, and the error rater EE which are formally defined by

PD,R1(𝒜)\displaystyle P_{D,R}^{1}(\mathcal{A}) =minL(D,R)Pr[𝒜[L]=1],PD,R0(𝒜)=maxL(D,R)Pr[𝒜[L]=1]\displaystyle=\min_{L\in\mathcal{L}({D,R})}\Pr[\mathcal{A}[L]=1],\ P_{D,R}^{0}(\mathcal{A})=\max_{L\in{\mathcal{L}}^{\prime}({D,R})}\Pr[\mathcal{A}[L]=1]
ED,R(𝒜)\displaystyle E_{D,R}(\mathcal{A}) =max{1PD,R1(𝒜),PD,R0(𝒜)}.\displaystyle=\max\{1-P_{D,R}^{1}(\mathcal{A}),P_{D,R}^{0}(\mathcal{A})\}.

We define the decision PB advantage of 𝒜\mathcal{A} by 𝖠𝖽𝗏D,RPB(𝒜)=PD,R1(𝒜)PD,R0(𝒜)\mathsf{Adv}^{\textsf{PB}}_{D,R}(\mathcal{A})=P_{D,R}^{1}(\mathcal{A})-P_{D,R}^{0}(\mathcal{A}). In non-cryptographic contexts, instead of looking at the difference in probability that inputs that are in or out of the language are accepted, one often looks at how far these are each from 1/21/2. This motivates the definition 𝖠𝖽𝗏D,RPB-𝖽(𝒜)=min{2PD,R1(𝒜)1,12PD,R0(𝒜)}=12ED,R(𝒜)\mathsf{Adv}^{\textsf{PB}\mbox{-}\mathsf{d}}_{D,R}(\mathcal{A})=\min\{2P_{D,R}^{1}(\mathcal{A})-1,1-2P_{D,R}^{0}(\mathcal{A})\}=1-2E_{D,R}(\mathcal{A}).

The goal of a search algorithm is to output a witness for the instance. We define its advantage to be the minimum probability it succeeds, i.e., 𝖠𝖽𝗏D,RPB-𝗌(𝒜)=minL(D,R)Pr[(L,𝒜[L])=1]\mathsf{Adv}^{\textsf{PB}\mbox{-}\mathsf{s}}_{D,R}(\mathcal{A})=\min_{L\in\mathcal{L}(D,R)}\Pr[\mathcal{R}(L,\mathcal{A}[L])=1].

Problem Witness Promise
ED xy s.t. L(x)=L(y)x\neq y{\mbox{\ s.t.\ }}L(x)=L(y) -
1ED xy s.t. L(x)=L(y)x\neq y{\mbox{\ s.t.\ }}L(x)=L(y) At most one witness.
1LD x,y s.t. L0(x)=L1(y)x,y{\mbox{\ s.t.\ }}L_{0}(x)=L_{1}(y) At most one witness. Injective L0,L1L_{0},L_{1}.
Figure 8: Summary of the element distinctness and list disjointness problems we consider.

Example problems.

The list disjointness problem asks how well an algorithm can distinguish between the case that is give (oracle access to) two lists which are disjoint or have one element in common. In particular, we interpret an instance LL as the two functions L0,L1:[D/2][R]L_{0},L_{1}:[\lfloor D/2\rfloor]\to[R] defined by Lb(x)=L(x+bD/2)L_{b}(x)=L(x+b\lfloor D/2\rfloor). Let 𝒮n\mathcal{S}_{n} denote the set of LL for which L0L_{0} and L1L_{1} are injective and which have nn elements in common, i.e. for which |{L0(1),,L0(D/2)}{L1(1),,L1(D/2)}|=n|\{L_{0}(1),\dots,L_{0}(\lfloor D/2\rfloor)\}\cap\{L_{1}(1),\dots,L_{1}(\lfloor D/2\rfloor)\}|=n. Then 1LD is defined by the relation \mathcal{R} which on input (L,(x,y))(L,(x,y)) returns 1 iff L0(x)=L1(y)L_{0}(x)=L_{1}(y) and the instance set =𝒮0𝒮1\mathcal{I}=\mathcal{S}_{0}\cup\mathcal{S}_{1} (i.e., the promise that there is at most one element in common and that the lists are individually injective). The search version of list disjointness is sometimes referred to as claw-finding.

The element distinctness problem asks how well an algorithm can detect whether all the elements in a list are distinct. Let 𝒮n\mathcal{S}^{\prime}_{n} denote the set of LL which have nn collision pairs, i.e. for which |{{x,y}:xy,L(x)=L(y)}|=n|\{\{x,y\}:x\neq y,L(x)=L(y)\}|=n. Then ED is defined by the relation \mathcal{R} which on input (L,(x,y))(L,(x,y)) returns 1 iff xyx\neq y and L(x)=L(y)L(x)=L(y) with the instance set =n=0Sn\mathcal{I}=\bigcup_{n=0}^{\infty}S^{\prime}_{n} consisting of all functions. We let 1ED denote restricting ED to =𝒮0𝒮1\mathcal{I}=\mathcal{S}^{\prime}_{0}\cup\mathcal{S}^{\prime}_{1} (i.e., the promise that there is at most one repetition in the list).

4.1 Security result

The following theorem shows that an attacker achieving constant advantage must make Ω(22k/3)\Omega(2^{2k/3}) oracle queries (ignoring log terms). Our bound is not tight for a lower parameter regimes, though future work may establish better bounds for list disjointness in these regimes.

Theorem 4.1

Consider 𝖣𝖤[]\mathsf{DE}[\cdot] with the underlying blockcipher modeled by an ideal cipher drawn from 𝖨𝖼𝗌(k,n)\mathsf{Ics}(k,n). Let 𝒜\mathcal{A} be a quantum adversary which makes at most qq queries to the ideal cipher. Then

𝖠𝖽𝗏𝖣𝖤𝗌𝗉𝗋𝗉(𝒜)11(qklgk)3/22k6+1/2k.\mathsf{Adv}^{\mathsf{sprp}}_{\mathsf{DE}}(\mathcal{A})\leq 11\sqrt[6]{(q\cdot k\lg k)^{3}/2^{2k}}+1/2^{k}.

As mentioned earlier, our proof works by first reducing the security of double encryption against quantum queries to the security of the list disjointness problem against quantum queries. This is captured in the following theorem which we prove now.

Theorem 4.2

Consider 𝖣𝖤[]\mathsf{DE}[\cdot] with the underlying blockcipher modeled by an ideal cipher drawn from 𝖨𝖼𝗌(k,n)\mathsf{Ics}(k,n). Let 𝒜\mathcal{A} be a quantum adversary which makes at most qq queries to the ideal cipher. Then for any R2kR\geq 2^{k} we can construct 𝒜\mathcal{A}^{\prime} making at most qq oracle queries such that

𝖠𝖽𝗏𝖣𝖤𝗌𝗉𝗋𝗉(𝒜)𝖠𝖽𝗏2k,R1LD-𝖽(𝒜)+1/2k.\mathsf{Adv}^{\mathsf{sprp}}_{\mathsf{DE}}(\mathcal{A})\leq\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{d}}_{2^{k},R}(\mathcal{A}^{\prime})+1/2^{k}.

We state and prove a bound on 𝖠𝖽𝗏1LD-𝖽\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{d}} in Section 4.2. Our proof applies the same reduction technique as Tessaro and Thiruvengadam [31], we are verifying that it works quantumly as well.

Proof

For b{0,1}b\in\{0,1\}, let Hb{\textsf{H}}_{b} be defined to be identical to G𝖣𝖤,b𝗌𝗉𝗋𝗉{\textsf{G}}^{\mathsf{sprp}}_{\mathsf{DE},b} except that K2K_{2} is chosen uniformly from {0,1}k{K1}\{0,1\}^{k}\setminus\{K_{1}\} rather than from {0,1}k\{0,1\}^{k}. This has no effect when b=0b=0 because the keys are not used, so 𝖯𝗋[G𝖣𝖤,0𝗌𝗉𝗋𝗉(𝒜)]=Pr[H0]\mathsf{Pr}[{\textsf{G}}^{\mathsf{sprp}}_{\mathsf{DE},0}(\mathcal{A})]=\Pr[{\textsf{H}}_{0}]. When b=1b=1 there was only a 1/2k1/2^{k} chance that K2K_{2} would have equalled K1K_{1} so 𝖯𝗋[G𝖣𝖤,1𝗌𝗉𝗋𝗉(𝒜)]Pr[H1]+1/2k\mathsf{Pr}[{\textsf{G}}^{\mathsf{sprp}}_{\mathsf{DE},1}(\mathcal{A})]\leq\Pr[{\textsf{H}}_{1}]+1/2^{k}.

Now we define a decision algorithm 𝒜\mathcal{A}^{\prime} for 1LD which uses its input lists to simulate a view for 𝒜\mathcal{A}. When the lists are disjoint 𝒜\mathcal{A}’s view will perfectly match that of H0{\textsf{H}}_{0} and when the lists have exactly one element in common 𝒜\mathcal{A}’s view will perfectly match that of H1{\textsf{H}}_{1}. Hence we have Pr[H1]=min(L,L)1κ,kPr[GL,L𝗅𝖽(𝒜)]\Pr[{\textsf{H}}_{1}]=\min_{(L,L^{\prime})\in\mathcal{L}^{\kappa,k^{\prime}}_{1}}\Pr[{\textsf{G}}^{\mathsf{ld}}_{L,L^{\prime}}(\mathcal{A})] and Pr[H0]=max(L,L)0κ,kPr[GL,L𝗅𝖽(𝒜)]\Pr[{\textsf{H}}_{0}]=\max_{(L,L^{\prime})\in\mathcal{L}^{\kappa,k^{\prime}}_{0}}\Pr[{\textsf{G}}^{\mathsf{ld}}_{L,L^{\prime}}(\mathcal{A})], so Pr[H1]Pr[H0]=𝖠𝖽𝗏2k,k𝗅𝖽(𝒜)\Pr[{\textsf{H}}_{1}]-\Pr[{\textsf{H}}_{0}]=\mathsf{Adv}^{\mathsf{ld}}_{2^{k},k^{\prime}}(\mathcal{A}^{\prime}) which gives the claimed bound.

Adversary 𝒜[L]\mathcal{A}^{\prime}[L] ρ$𝖨𝖼𝗌(0,k)\rho{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Ics}(0,k) π$𝖨𝖼𝗌(0,n)\pi{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Ics}(0,n) F$𝖨𝖼𝗌(lgR,n)F{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Ics}(\lceil\lg R\rceil,n) b$𝒜[π,π1,Ic,Inv]b^{\prime}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathcal{A}[{\pi,\pi^{-1},\textsc{Ic},\textsc{Inv}}] Return bb^{\prime} Ic(K,X,Y:ρ,π,F)\textsc{Ic}(K,X,Y:\rho,\pi,F) (i,j)ρ(K)(i,j)\leftarrow\rho(K) If i=0i=0 then
    YYFL0(j)(X)Y\leftarrow Y\oplus F_{L_{0}(j)}(X)
Else
    YYπ(FL1(j)1(X))Y\leftarrow Y\oplus\pi(F^{-1}_{L_{1}(j)}(X))
Return (K,X,Y:ρ,π,F)(K,X,Y:\rho,\pi,F)
Inv(K,X,Y:ρ,π,F)\textsc{Inv}(K,X,Y:\rho,\pi,F) (i,j)ρ(K)(i,j)\leftarrow\rho(K) If i=0i=0 then
    YYFL0(j)1(X)Y\leftarrow Y\oplus F^{-1}_{L_{0}(j)}(X)
Else
    YYFL1(j)(π1(X))Y\leftarrow Y\oplus F_{L_{1}(j)}(\pi^{-1}(X))
Return (K,X,Y:ρ,π,F)(K,X,Y:\rho,\pi,F)

Figure 9: Reduction adversary used in proof of Theorem 4.2.

The adversary 𝒜\mathcal{A}^{\prime} is defined in Fig. 9. It samples a permutation ρ\rho on {0,1}k\{0,1\}^{k}, a permutation π\pi on {0,1}n\{0,1\}^{n}, and a cipher FF. The permutation ρ\rho is used to provide a random map from the keys K{0,1}kK\in\{0,1\}^{k} to the elements of the lists L0L_{0} and L1L_{1}. We will interpret ρ(K)\rho(K) as a tuple (i,j)(i,j) with i{0,1}i\in\{0,1\} and j[2k/2]j\in[2^{k}/2]. Then KK gets mapped to Li(j)L_{i}(j). Therefore either none of the keys map to the same element or a single pair of them maps to the same element.

Adversary 𝒜\mathcal{A}’s queries to Ev and Inv are answered using π\pi and π1\pi^{-1}. Its queries to the ideal cipher are more complicated and are handled by the oracles Ic and Inv. We can verify that these oracles define permutations on bitstring inputs, so 𝒜\mathcal{A}^{\prime} is a well defined quantum adversary. Consider a key KK and interpret ρ(K)\rho(K) as a tuple (i,j)(i,j) as described above. If i=0i=0, then ideal cipher queries for it are answered as if 𝐄K()=FL0(j)()\mathbf{E}_{K}(\cdot)=F_{L_{0}(j)}(\cdot). If i=1i=1, then ideal cipher queries for it are answered as if 𝐄K()=π(FL1(j)1())\mathbf{E}_{K}(\cdot)=\pi(F^{-1}_{L_{1}(j)}(\cdot)).101010When using output of LL as keys for FF we are identifying the elements of [R][R] with elements of {0,1}lgR\{0,1\}^{\lceil\lg R\rceil} in the standard manner. If the list element KK is not mapped to by any other keys, then the indexing into FF ensures that 𝐄K()\mathbf{E}_{K}(\cdot) is independent of π\pi and 𝐄K\mathbf{E}_{K^{\prime}} for all other KK^{\prime}. If KK and KK^{\prime} map to the same list element (and i=0i=0 for KK), then 𝐄K()\mathbf{E}_{K}(\cdot) and 𝐄K()\mathbf{E}_{K}^{\prime}(\cdot) are random permutations conditioned on 𝐄K(𝐄K())=π()\mathbf{E}_{K}^{\prime}(\mathbf{E}_{K}(\cdot))=\pi(\cdot) and independent of all other 𝐄K′′()\mathbf{E}_{K^{\prime\prime}}(\cdot).

In H0{\textsf{H}}_{0}, the permutation of Ev and Inv is independent of each 𝐄K()\mathbf{E}_{K}(\cdot) which are themselves independent of each other. So this perfectly matches the view presented to 𝒜\mathcal{A} by 𝒜\mathcal{A}^{\prime} when the lists are disjoint. In H1{\textsf{H}}_{1}, each 𝐄K()\mathbf{E}_{K}(\cdot) is pairwise independent and the permutation of Ev and Inv is defined to equal 𝖤K2(𝖤K1())\mathsf{E}_{K_{2}}(\mathsf{E}_{K_{1}}(\cdot)). This perfectly matches the view presented to 𝒜\mathcal{A} by 𝒜\mathcal{A}^{\prime} when the lists have one element in common because we can think of it as just having changed the order in which the permutations 𝖤K2(𝖤K1())\mathsf{E}_{K_{2}}(\mathsf{E}_{K_{1}}(\cdot)), 𝖤K1()\mathsf{E}_{K_{1}}(\cdot), and 𝖤K2()\mathsf{E}_{K_{2}}(\cdot) were sampled.∎

4.2 The Hardness of List Disjointness

If 𝒜\mathcal{A} is an algorithm making at most qq classical oracle queries, then it is not hard to prove that 𝖠𝖽𝗏D,R1LD(𝒜)q/D\mathsf{Adv}^{\textsf{1LD}}_{D,R}(\mathcal{A})\leq q/D. If, instead, 𝒜\mathcal{A} makes as most qq quantum oracle queries, the correct bound is less straightforward. In this section, we will prove the following result.

Theorem 4.3

If 𝒜\mathcal{A} is a quantum algorithm making at most qq queries to its oracle and D32D\geq 32 is a power of 2, then

𝖠𝖽𝗏D,3D21LD(𝒜)11(qlgDlglgD)3/D26.\mathsf{Adv}^{\textsf{1LD}}_{D,3D^{2}}(\mathcal{A})\leq 11\sqrt[6]{(q\cdot\lg D\cdot\lg\lg D)^{3}/D^{2}}.

We restrict attention to the case that DD is a power of 2 only for notational simplicity in the proof. Essentially the same bound for more general DD follows from the same techniques.

Ambanis’s 𝒪(N2/3)\mathcal{O}(N^{2/3}) query algorithm for element distinctness [2] can be used to solve list disjointness and hence shows this is tight (up to logarithmic factors) for attackers achieving constant advantage. The sixth root degrades the quality of the bound for lower parameter regimes. An interesting question we leave open is whether this could be proven without the sixth root or the logarithmic factors.

Proof sketch.

The starting point for our reduction is that Ω(N2/3)\Omega(N^{2/3}) lower bounds are known both the search and decision versions of ED [1, 34].111111In the proof we actually work with the advantage upper bounds, rather than the corresponding query lower bounds. By slightly modifying Zhandry’s [34] technique for proving this, we instead get a bound on the hardness of 1ED-𝗌\textsf{1ED}\mbox{-}\mathsf{s}. Next, a simple reduction (split the list in half at random) shows that 1LD-𝗌\textsf{1LD}\mbox{-}\mathsf{s} is as hard as 1ED-𝗌\textsf{1ED}\mbox{-}\mathsf{s}.

Then a “binary search” style reduction shows that 1LD-𝖽\textsf{1LD}\mbox{-}\mathsf{d} is as hard as 1LD-𝗌\textsf{1LD}\mbox{-}\mathsf{s}. In the reduction, the 1LD-𝗌\textsf{1LD}\mbox{-}\mathsf{s} algorithm repeatedly splits its lists in half and uses the 1LD-𝖽\textsf{1LD}\mbox{-}\mathsf{d} algorithm to determine which pair of lists contains the non-disjoint entries. However, we need our reduction to work by running the 1LD-𝖽\textsf{1LD}\mbox{-}\mathsf{d} algorithm on a particular fixed size of list (the particular size we showed 1LD-𝖽\textsf{1LD}\mbox{-}\mathsf{d} is hard for) rather than running it on numerous shrinking sizes. We achieve this by padding the lists with random elements. The choice of R=3D2R=3D^{2} was made so that with good probability these random elements do not overlap with the actual list. This padding adds the lgD\lg D term to our bound.

Finally a generic technique allows us to relate the hardness of 1LD and 1LD-𝖽\textsf{1LD}\mbox{-}\mathsf{d}. Given an algorithm with high 1LD advantage we can run it multiple times to get a precise estimate of how frequently it is outputting 11 and use that to determine what we want to output. This last step is the primary cause of the sixth root in our bound; it required running the 1LD algorithm on the order of 1/δ21/\delta^{2} times to get a precise enough estimate, where δ\delta is the advantage of the 1LD algorithm. This squaring of δ\delta in the query complexity of our 1LD-𝖽\textsf{1LD}\mbox{-}\mathsf{d} algorithm (together with the fact that the query complexity is cubed in our 1ED-𝗌\textsf{1ED}\mbox{-}\mathsf{s} bound) ultimately causes the sixth root.

Constituent lemmas.

In the rest of the section we will state and prove lemmas corresponding to each of the step of the proof described above. In Section 4.3 we apply them one at a time to obtain the specific bound claimed by Theorem 4.3.

Lemma 1 (1ED-𝗌\textsf{1ED}\mbox{-}\mathsf{s} is hard)

If 𝒜1ED-𝗌\mathcal{A}_{\textsf{1ED}\mbox{-}\mathsf{s}} is a quantum algorithm for 1ED-𝗌\textsf{1ED}\mbox{-}\mathsf{s} making at most qq queries to its oracle and D32D\geq 32, then 𝖠𝖽𝗏D,3D2ED-𝗌(𝒜1ED-𝗌)9(q+2)3/D2\mathsf{Adv}^{\textsf{ED}\mbox{-}\mathsf{s}}_{D,3D^{2}}(\mathcal{A}_{\textsf{1ED}\mbox{-}\mathsf{s}})\leq 9\cdot(q+2)^{3}/D^{2}.

Proof

In [34], Zhandry shows that no QQ-query algorithm can distinguish between a random function and a random injective function with domain [D][D] and codomain [R][R] with advantage better than (π2/3)Q3/R(\pi^{2}/3)Q^{3}/R, as long as DRD\leq R. We could build a distinguisher \mathcal{B} that on input L:[D][R]L:[D]\to[R] runs (x,y)𝒜[L](x,y)\leftarrow\mathcal{A}[L]. If (x,y)(x,y) is a collision (i.e., xyx\neq y and L(x)=L(x)L(x)=L(x)), then \mathcal{B} outputs 1. It checks this by making two additional LL queries, so Q=q+2Q=q+2. Otherwise it outputs zero. Clearly, (x,y)(x,y) cannot be a collision when LL is an injection so it will always output zero. Hence, if 𝟣𝖼𝗈𝗅𝗅\mathsf{1coll} denotes the event that LL contains exactly one collision we obtain a bound of

Pr[𝟣𝖼𝗈𝗅𝗅]𝖠𝖽𝗏D,3D2ED-𝗌(𝒜1ED-𝗌)(π2/3)(q+2)3/R.\Pr[\mathsf{1coll}]\cdot\mathsf{Adv}^{\textsf{ED}\mbox{-}\mathsf{s}}_{D,3D^{2}}(\mathcal{A}_{\textsf{1ED}\mbox{-}\mathsf{s}})\leq(\pi^{2}/3)(q+2)^{3}/R. (1)

It remains to lower bound Pr[𝟣𝖼𝗈𝗅𝗅]\Pr[\mathsf{1coll}]. Note there are (D2)\binom{D}{2} possible pairs of inputs that could be collisions. Each pair has a 1/R1/R chance of colliding. By a union bound, the probability any other input has the same output as the collision is at most (D2)/R(D-2)/R, so there is at least a 1(D2)/R1-(D-2)/R probability this does not occur. Given the above there are (D2)(D-2) inputs sampled from R1R-1 possible values, so by a union bound the probability none of them collide is at least 1(D22)/(R1)1-\binom{D-2}{2}/(R-1). This gives

Pr[𝟣𝖼𝗈𝗅𝗅]D(D1)2R(1D2R)(1(D2)(D3)2(R1)).\Pr[\mathsf{1coll}]\geq\frac{D(D-1)}{2R}\cdot\left(1-\frac{D-2}{R}\right)\cdot\left(1-\frac{(D-2)(D-3)}{2(R-1)}\right).

Now setting R=3D2R=3D^{2} and applying simple bounds (e.g. D2<D1<DD-2<D-1<D and (D3)/(R1)<(D2)/R(D-3)/(R-1)<(D-2)/R) gives,

Pr[𝟣𝖼𝗈𝗅𝗅](11/D)6(113D)(116)\Pr[\mathsf{1coll}]\geq\frac{(1-1/D)}{6}\cdot\left(1-\frac{1}{3D}\right)\cdot\left(1-\frac{1}{6}\right)

Plugging this lower bound into equation 1, re-arranging, applying the bound D32D\geq 32, and rounding up to the nearest whole number gives the claimed bound 𝖠𝖽𝗏D,3D2ED-𝗌(𝒜1ED-𝗌)9(q+2)3/D3\mathsf{Adv}^{\textsf{ED}\mbox{-}\mathsf{s}}_{D,3D^{2}}(\mathcal{A}_{\textsf{1ED}\mbox{-}\mathsf{s}})\leq 9(q+2)^{3}/D^{3}.∎

Lemma 2 (1ED-𝗌\textsf{1ED}\mbox{-}\mathsf{s} hard \Rightarrow 1LD-𝗌\textsf{1LD}\mbox{-}\mathsf{s} hard)

Let DD be even. If 𝒜1LD-𝗌\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}} is a quantum algorithm for 1LD-𝗌\textsf{1LD}\mbox{-}\mathsf{s} making at most qq queries to its oracle, then there is an algorithm 𝒜1ED-𝗌\mathcal{A}_{\textsf{1ED}\mbox{-}\mathsf{s}} (described in the proof) such that 𝖠𝖽𝗏D,R1LD-𝗌(𝒜1LD-𝗌)2𝖠𝖽𝗏D,R1ED-𝗌(𝒜1ED-𝗌)\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{s}}_{D,R}(\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}})\leq 2\mathsf{Adv}^{\textsf{1ED}\mbox{-}\mathsf{s}}_{D,R}(\mathcal{A}_{\textsf{1ED}\mbox{-}\mathsf{s}}). Algorithm 𝒜1ED-𝗌\mathcal{A}_{\textsf{1ED}\mbox{-}\mathsf{s}} makes at most qq queries to its oracle.

Proof

On input a list L:[D][R]L:[D]\to[R], the algorithm 𝒜1ED-𝗌\mathcal{A}_{\textsf{1ED}\mbox{-}\mathsf{s}} will pick a random permutation π:[D][D]\pi:[D]\to[D]. It runs 𝒜1LD-𝗌[Lπ]\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}}[L\circ\pi] and then, on receiving output (x,y)[D/2]2(x,y)\in[D/2]^{2}, returns (π1(x),π1(y+D/2))(\pi^{-1}(x),\pi^{-1}(y+D/2)). The permutation π\pi serves the role of splitting LL into two sublists for 𝒜1LD-𝗌\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}} at random. As long as the original collision of LL doesn’t end up being put into the same sublist (which has probability less than 1/21/2), 𝒜1LD-𝗌\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}} will be run on a valid 1LD-𝗌\textsf{1LD}\mbox{-}\mathsf{s} instance and 𝒜1ED-𝗌\mathcal{A}_{\textsf{1ED}\mbox{-}\mathsf{s}} will succeed whenever 𝒜1LD-𝗌\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}} does. The claim follows.∎

Algorithm 𝒜1LD-𝗌[L0,L1]\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}}[L_{0},L_{1}] L$𝖨𝗇𝗃(D,R)L^{\prime}{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathsf{Inj}(D,R); L0L1LL^{\prime}_{0}\,\|\,L^{\prime}_{1}\leftarrow L
i0i\leftarrow 0; L00L0L_{0}^{0}\leftarrow L_{0}; L10L1L_{1}^{0}\leftarrow L_{1}
Repeat
    ii+1i\leftarrow i+1
    L0,lL0,rL0i1L_{0,l}\,\|\,L_{0,r}\leftarrow L_{0}^{i-1}
    L1,lL1,rL1i1L_{1,l}\,\|\,L_{1,r}\leftarrow L_{1}^{i-1}
    (j,k)(r,r)(j^{\ast},k^{\ast})\leftarrow(r,r)
    For (j,k){(l,l),(l,r),(r,l)}(j,k)\in\{(l,l),(l,r),(r,l)\} do
         // fg(x)=f(x)f\square g(x)=f(x) for x𝖣𝗈𝗆(f)x\in\mathsf{Dom}(f) else g(x)g(x)         b$𝒜1LD-𝖽[L0,jL0,L1,kL1]b{\>{\leftarrow{\raisebox{0.75pt}{$\scriptscriptstyle\$$}}}\>}\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}}[L_{0,j}\square L^{\prime}_{0},L_{1,k}\square L^{\prime}_{1}]
        If b=1b=1 then (j,k)(j,k)(j^{\ast},k^{\ast})\leftarrow(j,k)
    L0iL0,jL^{i}_{0}\leftarrow L_{0,j^{\ast}}; L1iL1,kL^{i}_{1}\leftarrow L_{1,k^{\ast}}
Until |𝖣𝗈𝗆(L0i)|=|𝖣𝗈𝗆(L1i)|=1|\mathsf{Dom}(L^{i}_{0})|=|\mathsf{Dom}(L^{i}_{1})|=1
Pick (x,y)𝖣𝗈𝗆(L0i)×𝖣𝗈𝗆(L1i)(x,y)\in\mathsf{Dom}(L^{i}_{0})\times\mathsf{Dom}(L^{i}_{1})
Return (x,y)(x,y)

Figure 10: Reduction algorithm 𝒜1LD-𝗌\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}} for Lemma 3. For notational convenience we write the two lists as separate input, rather than combined into a single list.
Lemma 3 (1LD-𝗌\textsf{1LD}\mbox{-}\mathsf{s} hard \Rightarrow 1LD-𝖽\textsf{1LD}\mbox{-}\mathsf{d} hard)

Let DD be a power of two. If 𝒜1LD\mathcal{A}_{\textsf{1LD}} is a quantum algorithm for 1LD making at most qq queries to its oracle, then there is an 1LD-𝗌\textsf{1LD}\mbox{-}\mathsf{s} algorithm 𝒜1LD-𝗌\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}} (described in the proof) such that

𝖠𝖽𝗏D,R1LD-𝗌(𝒜1LD-𝗌)1D2/R1.5(lgD2)(1𝖠𝖽𝗏D,R1LD-𝖽(𝒜1LD-𝖽)).\displaystyle\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{s}}_{D,R}(\mathcal{A}_{{\textsf{1LD}\mbox{-}\mathsf{s}}})\geq 1-D^{2}/R-1.5(\lg D-2)(1-\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{d}}_{D,R}(\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}})).

Algorithm 𝒜1LD-𝗌\mathcal{A}_{{\textsf{1LD}\mbox{-}\mathsf{s}}} makes at most 3qlgD3q\lg D queries to its oracle.

This theorem’s bound is vacuous if 𝖠𝖽𝗏D,R1LD-𝖽(𝒜1LD-𝖽)\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{d}}_{D,R}(\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}}) is too small. When applying the result we will have obtained 𝒜1LD-𝖽\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}} by amplifying the advantage of another adversary to ensure it is sufficiently large.

Proof

The algorithm 𝒜1LD-𝗌\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}} is given in Fig. 10. The intuition behind this algorithm is as follows. It wants to use the decision algorithm 𝒜1LD-𝖽\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}} to perform a binary search to find the overlap between L0L_{0} and L0L_{0}. It runs for lgD/21\lg D/2-1 rounds. In the ii-th round, it splits the current left list L0i1L^{i-1}_{0} into two sublists L0,lL_{0,l}, L0,rL_{0,r} and the current right lists L1i1L^{i-1}_{1} into two sublists L1,lL_{1,l}, L1,rL_{1,r}.121212In code, fghf\,\|\,g\leftarrow h for hh with domain 𝖣𝗈𝗆(h)={n,n+1,,m}\mathsf{Dom}(h)=\{n,n+1,\dots,m\} defines ff to be the restriction of hh to domain 𝖣𝗈𝗆(f)={n,n+1,,(n+m)/2}\mathsf{Dom}(f)=\{n,n+1,\dots,\lfloor(n+m)/2\rfloor\} and gg to be the restriction of hh to domain 𝖣𝗈𝗆(g)=𝖣𝗈𝗆(h)𝖣𝗈𝗆(f)\mathsf{Dom}(g)=\mathsf{Dom}(h)\setminus\mathsf{Dom}(f). If L0i1L^{i-1}_{0} and L1i1L^{i-1}_{1} have an element in common, then one of the pairs of sublists L0,jL_{0,j} and L1,kL_{1,k} for j,k{l,r}j,k\in\{l,r\} must have an element in common. The decision algorithm 𝒜1LD-𝖽\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}} is run on different pairs to determine which contains the overlap. We recurse with chosen pair, until we are left with lists that have singleton domains at which point we presume the entries therein give the overlap.

Because we need to run the decision algorithm 𝒜1LD-𝖽\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}} on fixed size inputs we pad the sublists to be of a fixed size using lists L0L^{\prime}_{0} and L1L^{\prime}_{1} (the two halves of an injection LL^{\prime} that we sampled locally). As long as the image of LL^{\prime} does not overlap with the images of L0L_{0} and L1L_{1}, this padding does not introduce any additional elements repetitions between or within the list input to 𝒜1LD-𝖽\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}}. By a union bound, overlaps occurs with probability at most D2/RD^{2}/R.

Conditioned on such overlaps not occurring, 𝒜1LD-𝗌\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{s}} will output the correct result if 𝒜1LD-𝖽\mathcal{A}^{\prime}_{\textsf{1LD}\mbox{-}\mathsf{d}} always answers correctly. To bound the probability of 𝒜1LD-𝖽\mathcal{A}^{\prime}_{\textsf{1LD}\mbox{-}\mathsf{d}} erring we can note that it is run 3(lgD2)3\cdot(\lg D-2) times and, each time, has at most a (1𝖠𝖽𝗏D,R1LD-𝖽(𝒜1LD-𝖽))/2(1-\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{d}}_{D,R}(\mathcal{A}^{\prime}_{\textsf{1LD}\mbox{-}\mathsf{d}}))/2 chance of error and apply a union bound.

Put together we have

𝖠𝖽𝗏D,R1LD-𝗌(𝒜1LD-𝗌)1D2/R1.5(lgD2)(1𝖠𝖽𝗏D,R1LD-𝖽(𝒜1LD-𝖽).\displaystyle\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{s}}_{D,R}(\mathcal{A}_{{\textsf{1LD}\mbox{-}\mathsf{s}}})\geq 1-D^{2}/R-1.5(\lg D-2)(1-\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{d}}_{D,R}(\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}}).

That 𝒜1LD-𝗌\mathcal{A}_{{\textsf{1LD}\mbox{-}\mathsf{s}}} makes at most 3q(lgD2)3q(\lg D-2) oracle queries is clear.∎

Lemma 4 (PB-𝖽\textsf{PB}\mbox{-}\mathsf{d} hard \Rightarrow PB hard)

Let PB be any problem. Suppose 𝒜PB\mathcal{A}_{\textsf{PB}} is a quantum algorithm for PB making at most qq queries to its oracle, with 𝖠𝖽𝗏D,RPB(𝒜PB)=δ>0\mathsf{Adv}^{\textsf{PB}}_{D,R}(\mathcal{A}_{\textsf{PB}})=\delta>0. Then for any tt\in\mathbb{N} there is an algorithm 𝒜PB-𝖽\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}} (described in the proof) such that 𝖠𝖽𝗏D,RPB-𝖽(𝒜PB-𝖽)>12/2t\mathsf{Adv}^{\textsf{PB}\mbox{-}\mathsf{d}}_{D,R}(\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}})>1-2/2^{t}. Algorithm 𝒜PB-𝖽\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}} makes q4.5(t+1)ln2/δ2q\cdot\lceil 4.5(t+1)\ln 2/\delta^{2}\rceil queries to its oracle.

Proof

For compactness, let p1=PD,R1(𝒜PB)p^{1}=P_{D,R}^{1}(\mathcal{A}_{\textsf{PB}}) denote the minimum probability that 𝒜PB\mathcal{A}_{\textsf{PB}} outputs 11 on instances in the language, p0=PD,R0(𝒜PB)p^{0}=P_{D,R}^{0}(\mathcal{A}_{\textsf{PB}}) denote the maximum probability that 𝒜PB\mathcal{A}_{\textsf{PB}} outputs 11 on instances not in the language, and δ=𝖠𝖽𝗏D,RPB(𝒜PB)=p1p0\delta=\mathsf{Adv}^{\textsf{PB}}_{D,R}(\mathcal{A}_{\textsf{PB}})=p^{1}-p^{0}. We define 𝒜PB-𝖽\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}} to be the algorithm that, on input LL, runs nn independent copies of 𝒜PB[L]\mathcal{A}_{\textsf{PB}}[L] (with n=4.5(t+1)ln2/δ2n=\lceil 4.5(t+1)*\ln 2/\delta^{2}\rceil) and calculates the average pp of all the values output by 𝒜PB[L]\mathcal{A}_{\textsf{PB}}[L]. (Think of this as an estimate of the probability 𝒜PB\mathcal{A}_{\textsf{PB}} outputs 1 on this input.) If p<p0+δ/2p<p^{0}+\delta/2, 𝒜PB-𝖽\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}} outputs 0, otherwise it outputs 1.

Let XiX_{i} denote the output of the ii-th execution of 𝒜PB-𝖽\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}}. An inequality of Hoeffding [hoeffding] bounds how far the average of independent random variables 0Xi10\leq X_{i}\leq 1 can differ from the expectation by

Pr[|i=1nXi/n𝖤[i=1nXi/n]|>ε]<2e2ε2n\displaystyle\Pr[\left|\sum_{i=1}^{n}X_{i}/n-\mathsf{E}\left[\sum_{i=1}^{n}X_{i}/n\right]\right|>\varepsilon]<2e^{-2\varepsilon^{2}n}

for any ε>0\varepsilon>0. Let pp^{\prime} denote the expected value of pp (which is also the expected value of XiX_{i}). If LL is in the language, then p1pp^{1}\leq p. Otherwise p0pp^{0}\geq p. In either case, 𝒜PB-𝖽\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}} will output the correct answer if pp does not differ from pp^{\prime} by more than δ/3\delta/3 (because this is strictly less than δ/2\delta/2). Applying the above inequality tells us that Pr[|pp|>δ/3]<2e2δ2n/92t\Pr[|p-p^{\prime}|>\delta/3]<2e^{-2\delta^{2}n/9}\leq 2^{-t}. (The value of nn was chosen to make this last inequality hold.)

Hence PD,R1(𝒜PB-𝖽)>12tP_{D,R}^{1}(\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}})>1-2^{-t}, PD,R0(𝒜PB-𝖽)<2tP_{D,R}^{0}(\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}})<2^{-t}, and 𝖠𝖽𝗏D,RPB-𝖽(𝒜PB-𝖽)>12/2t\mathsf{Adv}^{\textsf{PB}\mbox{-}\mathsf{d}}_{D,R}(\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}})>1-2/2^{t}. The bound on 𝒜PB-𝖽\mathcal{A}_{\textsf{PB}\mbox{-}\mathsf{d}}’s number of queries is clear.∎

4.3 Proof of Theorem 4.3

Let 𝒜1LD\mathcal{A}_{\textsf{1LD}} be our given list disjointness adversary which makes qq oracle queries and has advantage δ=𝖠𝖽𝗏D,R1LD(𝒜1LD)>0\delta=\mathsf{Adv}^{\textsf{1LD}}_{D,R}(\mathcal{A}_{\textsf{1LD}})>0. If we apply Lemma 4 with t=lg(12lgD)t=\lg(12\lg D), then we get an adversary 𝒜1LD-𝖽\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}} which makes q1LD-𝖽=q4.5(t+1)ln2/δ2<(10qlglgD)/δ2q_{\textsf{1LD}\mbox{-}\mathsf{d}}=q\cdot\lceil 4.5(t+1)\ln 2/\delta^{2}\rceil<(10q\lg\lg D)/\delta^{2} oracle queries. (We used here the assumption D32D\geq 32 to simplify constants.) This adversary has advantage

𝖠𝖽𝗏D,3D21LD-𝖽(𝒜1LD-𝖽)>12/2t=11/(6lg(D)).\displaystyle\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{d}}_{D,3D^{2}}(\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}})>1-2/2^{t}=1-1/(6\lg(D)).

Next applying Lemma 3, gives us 𝒜1LD-𝗌\mathcal{A}_{{\textsf{1LD}\mbox{-}\mathsf{s}}} which makes fewer than q1LD-𝗌=30q(lgD)(lglgD)/δ2q_{\textsf{1LD}\mbox{-}\mathsf{s}}=30q(\lg D)(\lg\lg D)/\delta^{2} oracle queries and has advantage

𝖠𝖽𝗏D,R1LD-𝗌(𝒜1LD-𝗌)\displaystyle\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{s}}_{D,R}(\mathcal{A}_{{\textsf{1LD}\mbox{-}\mathsf{s}}}) 1D2/R1.5(lgD2)(1𝖠𝖽𝗏D,R1LD-𝖽(𝒜1LD-𝖽))\displaystyle\geq 1-D^{2}/R-1.5(\lg D-2)(1-\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{d}}_{D,R}(\mathcal{A}_{\textsf{1LD}\mbox{-}\mathsf{d}}))
>11/31.5(lgD2)(6lgD)1>11/31/4=5/12.\displaystyle>1-1/3-1.5(\lg D-2)(6\lg D)^{-1}>1-1/3-1/4=5/12.

Lemmas 1 and 2 together bound this advantage from the other direction. In particular, we get that

5/12<𝖠𝖽𝗏D,R1LD-𝗌(𝒜1LD-𝗌)18(q1LD-𝗌+2)3/D2.\displaystyle 5/12<\mathsf{Adv}^{\textsf{1LD}\mbox{-}\mathsf{s}}_{D,R}(\mathcal{A}_{{\textsf{1LD}\mbox{-}\mathsf{s}}})\leq 18\cdot(q_{\textsf{1LD}\mbox{-}\mathsf{s}}+2)^{3}/D^{2}.

Using the assumption D32D\geq 32 we can bound q1LD-𝗌+2q_{\textsf{1LD}\mbox{-}\mathsf{s}}+2 by 31q(lgD)(lglgD)/δ231q(\lg D)(\lg\lg D)/\delta^{2}. Plugging this in and solving for δ\delta gives our claimed bound of

δ<11(qlgDlglgD)3/D26.\displaystyle\delta<11\sqrt[6]{(q\cdot\lg D\cdot\lg\lg D)^{3}/D^{2}}.

Acknowledgements

Joseph Jaeger and Stefano Tessaro were partially supported by NSF grants CNS-1930117 (CAREER), CNS-1926324, CNS-2026774, a Sloan Research Fellowship, and a JP Morgan Faculty Award. Joseph Jaeger’s work done while at the University of Washington. Fang Song thanks Robin Kothari for helpful discussion on the element distinctness problem. Fang Song was supported by NSF grants CCF-2041841, CCF-2042414, and CCF-2054758 (CAREER).

References

  • [1] S. Aaronson and Y. Shi. Quantum lower bounds for the collision and the element distinctness problems. Journal of the ACM (JACM), 51(4):595–605, 2004.
  • [2] A. Ambainis. Quantum walk algorithm for element distinctness. SIAM Journal on Computing, 37(1):210–239, 2007.
  • [3] A. Ambainis, M. Hamburg, and D. Unruh. Quantum security proofs using semi-classical oracles. In A. Boldyreva and D. Micciancio, editors, CRYPTO 2019, Part II, volume 11693 of LNCS, pages 269–295. Springer, Heidelberg, Aug. 2019.
  • [4] N. Bindel, M. Hamburg, K. Hövelmanns, A. Hülsing, and E. Persichetti. Tighter proofs of cca security in the quantum random oracle model. In Theory of Cryptography Conference, pages 61–90. Springer, 2019.
  • [5] X. Bonnetain, A. Hosoyamada, M. Naya-Plasencia, Y. Sasaki, and A. Schrottenloher. Quantum attacks without superposition queries: the offline Simon’s algorithm. In Advances in Cryptology – ASIACRYPT, pages 552–583. Springer, 2019.
  • [6] C. Chevalier, E. Ebrahimi, and Q.-H. Vu. On security notions for encryption in a quantum world. Cryptology ePrint Archive, Report 2020/237, 2020. https://ia.cr/2020/237.
  • [7] J. Czajkowski. Quantum indifferentiability of sha-3. Cryptology ePrint Archive, 2021. http://eprint.iacr.org/2021/192.
  • [8] J. Czajkowski, C. Majenz, C. Schaffner, and S. Zur. Quantum lazy sampling and game-playing proofs for quantum indifferentiability. Cryptology ePrint Archive, Report 2019/428, 2019. https://eprint.iacr.org/2019/428.
  • [9] Ö. Dagdelen, M. Fischlin, and T. Gagliardoni. The Fiat-Shamir transformation in a quantum world. In K. Sako and P. Sarkar, editors, ASIACRYPT 2013, Part II, volume 8270 of LNCS, pages 62–81. Springer, Heidelberg, Dec. 2013.
  • [10] W. Diffie and M. E. Hellman. Exhaustive cryptanalysis of the nbs data encryption standard. IEEE Computer, 10(6), 1977.
  • [11] S. Even and Y. Mansour. A construction of a cipher from a single pseudorandom permutation. Journal of Cryptology, 10(3):151–162, June 1997.
  • [12] L. K. Grover. A fast quantum mechanical algorithm for database search. In Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, STOC ’96, pages 212–219, New York, NY, USA, 1996. Association for Computing Machinery.
  • [13] A. Hosoyamada and Y. Sasaki. Cryptanalysis against symmetric-key schemes with online classical queries and offline quantum computations. In Cryptographers’ Track at the RSA Conference, pages 198–218. Springer, 2018.
  • [14] K. Hövelmanns, E. Kiltz, S. Schäge, and D. Unruh. Generic authenticated key exchange in the quantum random oracle model. In IACR International Conference on Public-Key Cryptography, pages 389–422. Springer, 2020.
  • [15] J. Jaeger, F. Song, and S. Tessaro. Quantum key-length extension. Cryptology ePrint Archive, 2021. http://eprint.iacr.org/2021/579.
  • [16] M. Kaplan. Quantum attacks against iterated block ciphers. arXiv preprint arXiv:1410.1434, 2014.
  • [17] M. Kaplan, G. Leurent, A. Leverrier, and M. Naya-Plasencia. Quantum differential and linear cryptanalysis. IACR Trans. Symm. Cryptol., 2016(1):71–94, 2016. https://tosc.iacr.org/index.php/ToSC/article/view/536.
  • [18] S. Katsumata, S. Yamada, and T. Yamakawa. Tighter security proofs for GPV-IBE in the quantum random oracle model. Journal of Cryptology, 34(1):1–46, 2021.
  • [19] J. Kilian and P. Rogaway. How to protect DES against exhaustive key search. In N. Koblitz, editor, CRYPTO’96, volume 1109 of LNCS, pages 252–267. Springer, Heidelberg, Aug. 1996.
  • [20] J. Kilian and P. Rogaway. How to protect DES against exhaustive key search (an analysis of DESX). Journal of Cryptology, 14(1):17–35, Jan. 2001.
  • [21] E. Kiltz, V. Lyubashevsky, and C. Schaffner. A concrete treatment of Fiat-Shamir signatures in the quantum random-oracle model. In J. B. Nielsen and V. Rijmen, editors, EUROCRYPT 2018, Part III, volume 10822 of LNCS, pages 552–586. Springer, Heidelberg, Apr. / May 2018.
  • [22] V. Kuchta, A. Sakzad, D. Stehlé, R. Steinfeld, and S.-F. Sun. Measure-rewind-measure: tighter quantum random oracle model proofs for one-way to hiding and cca security. In Advances in Cryptology – EUROCRYTPT 2020, pages 703–728. Springer, 2020.
  • [23] H. Kuwakado and M. Morii. Security on the quantum-type even-mansour cipher. In 2012 International Symposium on Information Theory and its Applications, pages 312–316, 2012.
  • [24] G. Leander and A. May. Grover meets simon - quantumly attacking the FX-construction. In T. Takagi and T. Peyrin, editors, ASIACRYPT 2017, Part II, volume 10625 of LNCS, pages 161–178. Springer, Heidelberg, Dec. 2017.
  • [25] B. Mennink and A. Szepieniec. XOR of PRPs in a quantum world. In T. Lange and T. Takagi, editors, Post-Quantum Cryptography - 8th International Workshop, PQCrypto 2017, pages 367–383. Springer, Heidelberg, 2017.
  • [26] R. C. Merkle and M. E. Hellman. On the security of multiple encryption. Communications of the ACM, 24(7):465–467, 1981.
  • [27] A. Rosmanis. Tight bounds for inverting permutations via compressed oracle arguments. arXiv preprint arXiv:2103.08975, 2021.
  • [28] P. W. Shor. Algorithms for quantum computation: Discrete logarithms and factoring. In 35th FOCS, pages 124–134. IEEE Computer Society Press, Nov. 1994.
  • [29] D. R. Simon. On the power of quantum computation. SIAM journal on computing, 26(5):1474–1483, 1997.
  • [30] E. E. Targhi and D. Unruh. Post-quantum security of the Fujisaki-Okamoto and OAEP transforms. In M. Hirt and A. D. Smith, editors, TCC 2016-B, Part II, volume 9986 of LNCS, pages 192–216. Springer, Heidelberg, Oct. / Nov. 2016.
  • [31] S. Tessaro and A. Thiruvengadam. Provable time-memory trade-offs: Symmetric cryptography against memory-bounded adversaries. In A. Beimel and S. Dziembowski, editors, TCC 2018, Part I, volume 11239 of LNCS, pages 3–32. Springer, Heidelberg, Nov. 2018.
  • [32] D. Unruh. Revocable quantum timed-release encryption. J. ACM, 62(6), Dec. 2015.
  • [33] M. Zhandry. How to construct quantum random functions. In 53rd FOCS, pages 679–687. IEEE Computer Society Press, Oct. 2012.
  • [34] M. Zhandry. A note on the quantum collision and set equality problems. Quantum Information and Computation, 15(7& 8), 2015.
  • [35] M. Zhandry. How to record quantum queries, and applications to quantum indifferentiability. In A. Boldyreva and D. Micciancio, editors, CRYPTO 2019, Part II, volume 11693 of LNCS, pages 239–268. Springer, Heidelberg, Aug. 2019.

Appendix 0.A Probabilistic Analysis for Proof of Theorem 3.1

In this appendix we give a detailed probability analysis of Claim (i) from the proof of Theorem 3.1.

The view of 𝒜\mathcal{A} when run by 𝒜\mathcal{A}^{\prime} in G𝐃,1𝖽𝗂𝗌𝗍{\textsf{G}}^{\mathsf{dist}}_{\mathbf{D},1} is determined by f1f_{1}, f11f^{-1}_{1}, and z=(T,T1)z=(T,T^{-1}). These are chosen such that T[Mi]=f1(K1,MiK2)K2T[M_{i}]=f_{1}(K_{1},M_{i}\oplus K_{2})\oplus K_{2} for i=1,,qi=1,\dots,q^{\prime} and T1[Yi]=f11(K1,YiK2)K2T^{-1}[Y_{i}]=f^{-1}_{1}(K_{1},Y_{i}\oplus K_{2})\oplus K_{2} for i=q+1,,qi=q^{\prime}+1,\dots,q. Consequently to ensure this matches the view from G𝖥,1𝗌𝗉𝗋𝗉{\textsf{G}}^{\mathsf{sprp}}_{\mathsf{F},1} we need to show that 𝐃\mathbf{D} choses (f1,K1,K2)(f_{1},K_{1},K_{2}) uniformly from 𝖨𝖼𝗌(k,n)×{0,1}k×{0,1}n\mathsf{Ics}(k,n)\times\{0,1\}^{k}\times\{0,1\}^{n}. It is clear that K1K_{1} and K2K_{2} are uniform. Furthermore, f1(K,)=f0(K,)f_{1}(K,\cdot)=f_{0}(K,\cdot) for KK1K\neq K_{1} so these are sampled correctly. Hence we can think of these values as fixed and argue that the distribution induced over f1(K1,)f_{1}(K_{1},\cdot) is uniform over all permutations on {0,1}n\{0,1\}^{n}.

Let 𝐟𝖨𝖼𝗌(k,n)\mathbf{f}\in\mathsf{Ics}(k,n), N=2nN=2^{n}, and EE denote the event that f1(K1,)=𝐟()f_{1}(K_{1},\cdot)=\mathbf{f}(\cdot). Let E1E_{1} denote the event that T[Mi]=𝐟(MiK2)K2T[M_{i}]=\mathbf{f}(M_{i}\oplus K_{2})\oplus K_{2} for i=1,,qi=1,\dots,q after Step 1. The second for loop of Step 3 programs f1f_{1} to satisfy f1(K1,MiK2)=T[Mi]K2f_{1}(K_{1},M_{i}\oplus K_{2})=T[M_{i}]\oplus K_{2} so E1E_{1} is a necessary condition for EE. Note that E1E_{1} requires QQ values to have been sampled correctly in Step 1’s for loops where Q=|{𝐟(MiK2)K2:1iq}{𝐟(YiK2)K2:qiq}|Q=|\{\mathbf{f}(M_{i}\oplus K_{2})\oplus K_{2}:1\leq i\leq q^{\prime}\}\cup\{\mathbf{f}(Y_{i}\oplus K_{2})\oplus K_{2}:q^{\prime}\leq i\leq q\}|. Hence,

Pr[E]=Pr[E|E1](NQ)!N!.\Pr[E]=\Pr[E|E_{1}]\cdot\frac{(N-Q)!}{N!}.

Let E2E_{2} denote the event that Step 2 samples an f0f_{0} which is consistent with 𝐟\mathbf{f}. That is to say, that f0f_{0} is chosen such that 𝐟()=𝒪𝒪\mathbf{f}(\mathcal{I}\cup\mathcal{I}^{\prime})=\mathcal{O}\cup\mathcal{O}^{\prime} and 𝐟(x)=f0(K1,x)\mathbf{f}(x)=f_{0}(K_{1},x) for xx\not\in\mathcal{I}\cup\mathcal{I}^{\prime}. The first for loop in Step 3 programs f1(K1,x)=f0(K1,x)f_{1}(K_{1},x)=f_{0}(K_{1},x) for xx\not\in\mathcal{I}\cup\mathcal{I}^{\prime}. The second and third for loop in Step 3 programs f1(K1,)f_{1}(K_{1},\mathcal{I}\cup\mathcal{I}^{\prime}) to have values in 𝒪𝒪\mathcal{O}\cup\mathcal{O}^{\prime} so E2E_{2} is a necessary condition for EE. Let M(f0)=||=|𝒪𝒪|M(f_{0})=|\mathcal{I}\setminus\mathcal{I}^{\prime}|=|\mathcal{O}\setminus\mathcal{O}^{\prime}| and let E2mE^{m}_{2} denote the event that M(f0)=mM(f_{0})=m.

Pr[E|E1]=mPr[E2m|E1]Pr[E2|E1,E2m]Pr[E|E1,E2m,E2].\Pr[E|E_{1}]=\sum_{m}\Pr[E^{m}_{2}|E_{1}]\cdot\Pr[E_{2}|E_{1},E^{m}_{2}]\cdot\Pr[E|E_{1},E^{m}_{2},E_{2}].

We can think of Step 2 as lazily sampling f0(K1,)f_{0}(K_{1},\cdot) by first sampling f0(K1,x)f_{0}(K_{1},x) for xx\in\mathcal{I}, then sampling f01(K1,y)f^{-1}_{0}(K_{1},y) for y𝒪𝒪y\in\mathcal{O}\setminus\mathcal{O}^{\prime}, and then sampling f0(K1,x)f_{0}(K_{1},x) for xx\not\in\mathcal{I}\cup\mathcal{I}^{\prime}. The event E2E_{2} requires that the mm values sampled in this second step are the elements of 𝐟1(𝒪𝒪)\mathbf{f}^{-1}(\mathcal{O}^{\prime}\setminus\mathcal{O}) and that on the third step 𝐟(x)\mathbf{f}(x) is sampled for f0(K1,x)f_{0}(K_{1},x) for each xx\not\in\mathcal{I}\cup\mathcal{I}^{\prime}. Hence,

Pr[E2|E1,E2m]=1(NQm)1(NQm)!.\Pr[E_{2}|E_{1},E^{m}_{2}]=\frac{1}{\binom{N-Q}{m}}\cdot\frac{1}{(N-Q-m)!}.

For EE to occur (conditioned on E1E_{1}, E2mE^{m}_{2}, and E2E_{2}) the third for loop in Step 3 must sample mm values correctly, so Pr[E|E1,E2m,E2]=1/m!\Pr[E|E_{1},E^{m}_{2},E_{2}]=1/m!. Putting everything together we have

Pr[E]=(NQ)!N!mPr[E2m|E1]m!(NQm)!(NQ)!1(NQm)!1m!=1N!.\displaystyle\Pr[E]=\frac{(N-Q)!}{N!}\sum_{m}\Pr[E^{m}_{2}|E_{1}]\cdot\frac{m!\cdot(N-Q-m)!}{(N-Q)!}\cdot\frac{1}{(N-Q-m)!}\cdot\frac{1}{m!}=\frac{1}{N!}.

So f1f_{1} is uniformly distributed, as desired.