Realizing Chosen Ciphertext Security Generically in Attribute-Based Encryption and Predicate Encryption

Venkata Koppula Brent Waters Weizmann Institute of Science∗ UT Austin† February 25, 2019

Abstract We provide generic and black box transformations from any chosen plaintext secure Attribute-Based Encryption (ABE) or One-sided Predicate Encryption system into a chosen ciphertext secure system. Our transformation requires only the IND-CPA security of the original ABE scheme coupled with a pseudorandom generator (PRG) with a special security property. n In particular, we consider a PRG with an n bit input s ∈ {0, 1} and n · ` bit output y1, . . . , yn where each yi is an ` bit string. Then for a randomly chosen s the following two distributions should

be computationally indistinguishable. In the first distribution ri,si = yi and ri,s¯i is chosen randomly for i ∈ [n]. In the second distribution all ri,b are chosen randomly for i ∈ [n], b ∈ {0, 1}.

1 Introduction

In Attribute-Based Encryption [SW05] (ABE) every ciphertext CT that encrypts a message m is associated with an attribute string x, while each secret, as issued by an authority, will be associated with a predicate function C. A user with a secret key sk that is associated with function C will be able to decrypt a ciphertext associated with x and recover the message if and only if C(x) = 1. Additionally, security of ABE systems guarantees that an attacker with access to several keys cannot learn the contents of an encrypted message so long as none of them are so authorized. Since the introduction of Attribute-Based Encryption and early constructions [GPSW06] over a decade ago, there have been many advances in the field ranging from supporting expressive functionality [GVW13, BGG+14], to techniques for adaptive security[Wat09, LOS+10, OT10, LW12, Att14, Wee14, CGW15], short sized ciphertexts[ALdP11], multi-authority [Cha07, CC09, LW11] and partially hiding attributes [GVW15, GKW17, WZ17] to name just a few. In almost all of these cases and in most other papers, the treatment of ABE focused on the chosen plaintext (IND-CPA) definition of ABE. This is despite the fact that chosen ciphertext security [NY90, RS91, DDN91] — where the attacker can make oracle decryption queries to keys it does not have — is arguably the right definition of security for the same reasons it is the right definition for standard public key [Sho98]. Likely, most of these works target IND-CPA security since the authors already have their hands full with putting forth new concepts and techniques in manuscripts that often run for many pages. In these circumstances it seems reasonable for such works to initially target chosen plaintext definitions and then for later works to circle back and build toward chosen ciphertext security. Unfortunately, closing the loop to chosen ciphertext security can be tricky in practice. First, there are a rather large and growing number of ABE constructions. Writing papers to address moving each of these to chosen ciphertext security seems burdensome to authors and program committees alike. One line of work [GPSW06, YAHK11, NP15, BL16] to mediate this problem is to identify features in ABE constructions,

∗E-mail:[email protected] †E-mail:[email protected]. Research supported by NSF CNS-1414082, DARPA SafeWare, Microsoft Faculty Fellow- ship, and Packard Foundation Fellowship.

1 which if present mean that CPA security implies chosen ciphertext security. Yamada et. al [YAHK11] showed that certain delegability or verifiability properties in ABE systems imply chosen ciphertext security by the Canetti-Halevi-Katz[CHK04] transformation. Their generality, however, is limited by the need to manually inspect and prove that each construction has such a property. In fact, many schemes might not have these properties. Recent trends for both functionality and proofs techniques might actually work against these properties. For example, an ABE scheme has the verification property roughly if it is possible to inspect a ciphertext and determine if it is well formed and what keys can decrypt it. This property emerged naturally in many of the pairing-based schemes prominent at the time, but is less obvious to prove in LWE-based constructions and actually can runs contrary to the predicate encryption goal of hiding an attribute string x from users that cannot decrypt. See for example the one-sided predicate encryption constructions of [GVW15, GKW17, WZ17]. If we desire a truly generic transformation to chosen ciphertext security, then there are essentially two pathways available. The first option is to apply some variant of the Fujisaki-Okamoto [FO99] transformation (first given for transforming from IND-CPA to IND-CCA security in public key encryption). Roughly, the encryption algorithm will encrypt as its message the true message m appended with a random bitstring r using the random coins H(r) where H is a hash function modeled as a random oracle. The CCA-secure decryption algorithm will apply the original decryption algorithm to a ciphertext CT and recover m0|r0. Next, it re-encrypts the ciphertext under H(r0) to get a ciphertext CT0 and outputs the message if CT = CT0; otherwise it rejects. The upside of this approach is that the added overhead is fairly low as it just adds one additional call to encryption as part of the decryption routine. On the downside the security analysis of this technique appears intrinsically tied to the random oracle model [BR93]. The second option is to augment encryption by appending a non-interactive zero knowledge proof [BFM88] that a ciphertext was well formed. This approach has been well studied and explored in the context of stan- dard public key encryption [NY90] and should translate to the ABE context. Additionally, there are standard model NIZK proof assumptions under factoring and pairing-based and lattice based [PS19] assumptions.1 A drawback of this approach is that applying any generic gate by gate NIZK to an encryption system will be quite expensive in terms of computational overhead— this will be needed for any generic conversion.

1.1 Our Contribution In this work we provide a black box transformation for chosen ciphertext security of any ABE or one-sided predicate encryption system.2 Our transformation requires only the existence of a IND-CPA secure ABE system as well as a pseudo- random generator (PRG) with a special security property which we call the hinting property. This special security property can either be assumed for an “ordinary” (e.g., AES-based) PRG or provably obtained from either the Computational Diffie-Hellman assumption or the Learning with Errors assumption. Our transformation increases ciphertext size by roughly a factor of the security parameter — it requires 2 · n sub-ciphertexts for a parameter n. Additionally, it requires about 2n additional encryptions of the original system for both the new encryption and decryption routines. While this overhead is an increase over the original CPA system and will likely incur more overhead than hand-tailored CCA systems, it is a significant performance improvement over NIZKs that operate gate by gate over the original encryption circuit. We also wish to emphasize that our transformation applies to ordinary public key encryption as well as ABE. While chosen ciphertext security for PKE has been known for sometime from the CDH and LWE assumptions, we believe that our work provides new insights into the problem and might lead to furthering the understanding of whether IND-CPA security ultimately implies chosen ciphertext security.

1The realization of NIZKs from the Learning with Errors assumption is a very recent and exciting development[PS19] and occured after the initial posting of this work. 2The original definition of predicate encryption [BW07, KSW08] required hiding whether an attribute string of a challenge ciphertext was x0 or x1 from an attacker that had a key C where C(x0) = C(x1). A weaker form of predicate encryption is where this guarantee is given only if C(x0) = C(x1) = 0, but not when C(x0) = C(x1) = 1. This weaker form has been called predicate encryption with one-sided security and anonymous Attribute-Based Encryption. For this paper we will use the term one-sided predicate encryption.

2 Hinting Property for PRGs : Let PRG be a function that maps n bits to (n + 1) · n bits (output to be parsed as n + 1 strings, each of length n). Consider the following experiment between a challenger and an n adversary. The challenger chooses an n bit string s, computes PRG(s) = z0z1z2 . . . zn (each zi ∈ {0, 1} ). n Next, it chooses n uniformly random strings v1, v2, . . . , vn each from {0, 1} . It then constructs a 2 × n th 3 matrix M as follows: if the i bit of s is 0, then M0,i = zi,M1,i = vi, else M0,i = vi,M1,i = zi. Finally, the challenger either outputs z0 together with M, or it outputs 2n+1 uniformly random strings. A pseudorandom generator is said to satisfy the hinting property if any polynomial time adversary has negligible advantage in this experiment. Note that the seed s is used at two places : first to compute the strings z0, z1, z2, . . . , zn, and then to decide where to place each zi in the matrix M. Hence, the second piece of information (i.e. the position of zi strings serves as an extra hint on the PRG). One could simply assume this property of a particular pseudo random generator. Indeed, this seems rather plausible that ordinary types of PRGs would have it. Alternately, we show how to construct PRGs that provably have this property under either the Computational Diffie-Hellman assumption or the LWE assumption. Our constructions of these PRGs use techniques that closely follow previous works [DG17a, DG17b, BLSV18, DGHM18, GH18] for a related group of primitives going under a variety of names: Chameleon Encryption, One-Time Signature with Encryption, Batch Encryption, One Way Function with Encryption. We note that while the technical innards for the CDH and LWE realizations of our PRG are similar to the above works, (unlike the above examples) our definition itself does not attach any new functionality requirements to PRG; it simply demands a stronger security property. Next, we present an overview of our CCA construction. As a warm-up, we will first show how to use any CPA-secure public key encryption (PKE) scheme, together with hinting PRGs to construct a CCA-1 secure PKE scheme. Recall, CCA-1 security is a weaker variant of the CCA security game where the adversary is allowed decryption queries only before sending the challenge messages. After sending the challenge messages, the adversary receives the challenge ciphertext, and must send its guess.

CCA-1 secure PKE from CPA-secure PKE and hinting PRGs The construction also uses a (stan- dard) pseudorandom generator G with sufficiently long stretch. Let (Setup, Enc, Dec) be any CPA secure scheme, and H : {0, 1}n → {0, 1}(n+1)·n a hinting PRG. We require the CPA scheme to have two properties which can be obtained ‘for free’. First, we require that the scheme should have perfect decryption correctness for most public/secret keys. This can be obtained via the transformation of [DNR04]. Next, we require that any ciphertext can be decrypted given the encryption randomness. This is also easily obtained by choosing a random string r during encryption, and appending a one-time pad of the message using r. The setup of our CCA-1 scheme runs the PKE setup 2n times, obtaining 2n public key/secret key pairs pk , sk . The new public key consists of the 2n public keys pk , while the new b,i b,i i∈[n],b∈{0,1} b,i i∈[n],b∈{0,1} secret key includes only of n out of the 2n secret keys, namely {sk0,i}i∈[n] (this secret hiding principle[FS90] has been used in many CCA constructions, including the initial CCA systems [NY90, DDN91]). To encrypt a message m, the encryption algorithm first chooses a uniformly random tag t = t1t2 . . . tn, where each ti is n a sufficiently long string. Next, it chooses a seed s ← {0, 1} and computes H(s) = z0z1 . . . zn. It uses z0 to mask the message m; that is, it computes c = m ⊕ z0. The remaining ciphertext will contain n ‘signals’ that help the decryption algorithm to recover s bit by bit, which in turn will allow it to compute z0 and hence unmask c. th th The i signal (for each i ∈ [n]) has three components c0,i, c1,i, c2,i. If the i bit of s is 0, then c0,i is an encryption of a random string xi using the public key pk0,i and randomness zi, c1,i is an encryption of n th 0 using pk1,i (encrypted using true randomness), and c2,i = G(xi). If the i bit of s is 1, then c0,i is an n encryption of 0 using public key pk0,i (encrypted using true randomness), c0,i is an encryption of a random th string xi using public key pk1,i and randomness zi, and c2,i = G(xi)+ti (recall ti is the i component in the tag). So half the ciphertexts are encryptions of zero, while the remaining are encryptions of random strings (with blocks of the hinting PRG output being used as randomness), and the positioning of the zero/random encryptions reveals the seed s.

3 More compactly, Msi,i = zi and Msi,i = vi.

3 The final ciphertext includes the tag t = (t1t2 . . . tn), the ‘main’ component c, and n signals (c0,i, c1,i, c2,i). A noteworthy point about the ciphertext: first, the components {c2,i}i serve as a perfectly-binding com- mitment to the seed s. However, this commitment also has certain ‘non-malleability’ feature; given a ciphertext/commitment with tag t, an adversary cannot obtain a ciphertext/commitment for some other tag t0 - this feature is necessary for the scheme to be CCA secure.

To decrypt, the decryption algorithm first decrypts each c0,i (recall the secret key is {sk0,i}i∈[n]) to obtain y1y2 . . . yn. It then checks if G(yi) = c2,i. If so, it guesses that si = 0, else it guesses that si = 1. With this estimate for s, the decryption algorithm can compute H(s) = z0z1 . . . zn and then compute c ⊕ z0 to learn the message m. While this decryption procedure works correctly, we would like to prevent malicious decryption queries (made during the CCA/CCA-1 experiment), and hence the decryption algorithm needs to enforce additional checks. In particular, the decryption algorithm therefore needs to check that the guess th for s is indeed correct. If the i bit of s is guessed to be 0, then the decryption algorithm checks that c0,i th is a valid ciphertext - it simply re-encrypts yi and checks if this equals c0,i. If the i bit of s is guessed to be 1, then the decryption algorithm first recovers the messaage underlying ciphertext c1,i. Note that c1,i should be encrypted using randomness zi, hence using zi, one can recover messagey ˜i from c1,i (using the randomness recovery property of the PKE scheme). It then re-encryptsy ˜i and checks if it is equal to c1,i, and also checks that c2,i = G(˜yi) + ti. Finally, if all these checks pass, the decryption algorithm outputs z0 ⊕ c. To summarize, at a very high level, we build a partial trapdoor where the decryption algorithm will recover some of the coins used for encryption. These are then used to partially re-encrypt the ciphertext and test for validity. Influenced by Garg and Hajiabadi[GH18], we will prove security not by removing the signals for each bit position, but by adding misinformation that drowns out the original signal. Note that to prove security, we need to remove the information of z0 (and hence information of s) from two places - first, from the commitment {c2,i}i; second, from the positions where the zi values are used for encrypting. For the first one, in the proof, we set the challenge tag t∗ such that the signal is ambiguous at each index. More formally, ∗ ∗ ∗ in the challenge ciphertext c0,i is an encryption of yi, c1,i is encryption ofy ˜i, and G(yi) = G(˜yi) + ti . Replacing the encryptions of zeroes with encryptions of these carefully chosen strings involves a delicate argument, which crucially relies on the perfect correctness of our scheme (see discussion in Section 4 for more details). When this is done for all indices, all information about s will be lost from the message space and we are almost done; however, one loose end remains. Each ciphertext at position (si, i) will be encrypted under randomness ri which came from running the pseudorandom generator on s; whereas each ciphertext at position (¯si, i) will be encrypted under fresh random coins. To complete the proof we need a computational assumption that will allow us to change all the encryption coins to being chosen freshly at random. Here, we use the security of hinting PRGs, and that completes our proof.

CCA Security To achieve CCA security, we need to make a few tweaks to the above scheme. The setup algorithm also chooses n pairwise independent hash functions h1, h2, . . . , hn. The encryption algorithm chooses a signing/verification key for a (one-time) signature scheme. Next, instead of choosing a tag t uni- formly at random, it sets ti = hi(vk) (where vk is the verification key). Finally, the encryption algorithm computes a signature on all the ciphertext components, and the final ciphertext consists of all these compo- nents together with the signature and the verification key. To prove security, we first ensure that none of the decryption queries correspond to the challenge ciphertext’s verification key (this follows from the security of the signature scheme). After this point, the proof follows along the lines of the CCA-1 scheme.

Moving to Attribute Based Encryption/Predicate Encryption - For ABE/PE, the scheme is al- tered as follows. First, the public key consists of n ABE/PE public keys and n PKE public keys. Let pk0,i th th denote the i ABE/PE public key, and pk1,i the i PKE public key. The master secret key only consists of the n ABE/PE master secret keys. The main difference in the encryption algorithm is that the ciphertexts c0,i are now ABE/PE ciphertexts. Suppose we want to encrypt message m for attribute x. Then m is

4 masked using z0 as before, and the c0,i component is an encryption of zero/random message for attribute x th using public key pk0,i and randomness being truly random/zi, depending on the i bit of seed s. We conclude by remarking that while this work focuses on Attribute-Based Encryption and One-sided Predicate Encryption, we believe our transformation could apply to other specialized forms of encryption. For example, we believe it should immediately translate to any secure broadcast encryption [FN94] system. As another example, we believe our technique should also apply to ABE systems that are IND-CPA secure under a bounded number of key generation queries. Our technique, however, does not appear to apply to standard predicate encryption as defined in [BW07, KSW08] (notions very similar to full blown functional encryption). The core issue is that to test the validity of a ciphertext our decryption algorithm needs to obtain the attribute string x to perform re-encryption. In one-sided predicate encryption, if a user has a secret key for C and C(x) = 1 we essentially give up on hiding x and allow this to be recovered; whereas for full hiding we might want to still hide information about x even if C(x) = 1. Finally, we note that even if we cast the notions of ABE aside our work might provide another path to exploring the longstanding open problem of achieving chosen ciphertext security from chosen plaintext security. The primary barrier is in how to achieve a PRG with this hinting security.

1.2 Additional Comparisons It is instructive to take a closer look at how our work relates to and builds upon the trapdoor function construction of Garg and Hajiabadi[GH18]. Briefly and in our terminology, Garg and Hajiabadi gave a framework where the evaluation algorithm chooses an input s ∈ {0, 1}n and use this to first produces a value y that produces part of the output. Next, for each position (si, i) the evaluation algorithm produces a signal using s and the public parameters of the TDF using a primitive called “one way function with encryption”. At the opposite position (¯si, i) the evaluation algorithm outputs a random string ri of sufficient length. With very high probability the random string zi will not correspond to the valid signal for y at position (¯si, i). The inversion algorithm will use knowledge of the TDF secret key plus y to go recover the input s bit by bit. At each position i if a signal is present at (0, i) it records si = 0 and sets si = 1 if the signal is at (1, i). If the signal is at both 0 and 1, then recovery fails. One can observe that for almost all choices of public parameters there exist some valid inputs that will cause failure on inversion. To prove security the reduction algorithm at each position change the string zi from random to a signal under y. The security properties of the one way function with encryption make this undetectable. Once, this is done the only information about s will be contained in y. Since many choices of s will map to y, inverting to the chosen s at this point will be statistically infeasible. Our work as described above follows a similar approach in that a seed s is signaled bit by bit. And that a step of proving security is to add misinformation in by adding a counter signal in at positions (¯si, i). An important distinction is that in the work of Garg and Hajiabadi the signaling and inversion process is very tightly coupled in the one way function with encryption primitive. One could imagine trying to build an Attribute-Based version of one way function with encryption and then try to yield a CCA encryption from the resulting trapdoor. This runs into two problems. First, it would require a tailored construction for each type of ABE scheme that we want and then we are back to hacking CCA into each type of ABE variant. Second, since the GH scheme allows for ambiguous inputs, it can be difficult for mapping into chosen ciphertext secure schemes. In particular, this issue caused GH to need an adaptive version of one way function with encryption to bridge from TDFs to CCA security and this adaptive version was not realizable from the CDH assumption. In our work the signaling strategy is decoupled from the recovery of the signals. In particular, the form of the signals comes from our computation of the (non-hinting) PRG, while recovery is realized from simply invoking the ABE decryption algorithm. We also get perfect correctness since a non-signal will be an encryption of the all 0’s string. Also, with high probability our setup algorithm will choose parameters for which it is (information theoretically) impossible to create ambiguous signals. So once the ABE parameters are setup by an honest party (and with overwhelming probability, land in a good spot), there will be no further opportunity to take advantage of conflicting signals by an attacker via a decryption query.

5 We also believe that it might be interesting to swing some of our techniques back to the trapdoor function regime. For example, consider the GH TDF, but where we added values a1, . . . , an to the public parameters. We could modify the evaluation algorithm such that at position i, the algorithm gives the one-way function with encryption output ei if si = 0 and gives ei ⊕ ai if si = 1. This modification would allow us to drop the additional zi values from the GH construction and make the output of the TDF shorter. In addition, while there would still be a negligible correctness error, it could be possible to rest this error solely in the choice of public parameters and for a “good” choice of parameters there would be no further error from evaluation. This last claim would require making sure that the ai values were sufficiently long relative to y. We believe the techniques from [RS10] can be used here to achieve CCA security. We finally remark again that our realizations of our hinting PRG largely follow in line with recent works [DG17a, DG17b, BLSV18, DGHM18, GH18]. In particular, our CDH realization follows closely to [DG17a] and our LWE realization to [BLSV18, DGHM18]. It may have been possible to build our hinting PRG from one of the previous abstractions, but we chose to provide direct number theoretic realizations. We believe that one important distinction is that our hinting PRG is simply a PRG with stronger security properties; unlike the above abstractions our definition in of itself does not ask for expanded functionality. An intriguing open question is if this can be leveraged to obtain further instances with provable security.

Independent Work Independently, Garg, Gay and Hajiabadi [GGH18] recently built upon the work of [GH18] to build trapdoors from one way function with encryption that has improved correctness proper- ties. In particular, the base construction of [GGH18] generates parameters that with high probability will allow inversion on all inputs, whereas any parameters generated from the [GH18] construction will always have inversion failure on some small fraction of inputs. They then build upon using erasure codes and a “smoothness” property to get CCA secure determinstic encryption with shorter ciphertexts. In addition, they show a modification to the Peikert-Waters [PW08] DDH-based Lossy TDF that gets a better ciphertext rate. The initial direction of getting better correctness in TDFs is similar to our “swinging techniques back” comment above, but otherwise the works pursue separate goals and techniques.

1.3 Toward Bridging Chosen Ciphertext Security in PKE One classical open problem in cryptography is whether chosen plaintext security implies chosen ciphertext security in standard public key encryption. From a cursory glance one can see that it is easy to swap out the ABE system from our construction for a plain old public key encryption system and the same proof will go through — this time for obtaining chosen ciphertext secure public key encryption. Thus the “only” barrier for moving from IND-CPA to IND-CCA security is in the hinting PRG. An interesting open question is just how strong this barrier is. From our viewpoint, the hinting security is something that most natural PRGs would likely have. In trying to understand whether it or something similar could be built from general assumptions (e.g. PKE or one way functions) it could be useful to first try to build a separation from our hinting PRG and a standard one. Do there exist PRGs that do not meet the security definition of hinting PRG? As a first stab at the problem, one might consider PRGs where there is an initial trusted setup algorithm that produces a set of public parameters, which are then used for every subsequent evaluation. In this setting one could imagine a counterexample where the public parameters produced by the setup algorithm include an obfuscated program which will assist in breaking the hinting security, but not be helpful enough to break standard security. Using obfuscation in a similar manner has been useful for achieving other separation results. If we consider PRGs that do not allow for such setup, the task appears to be more challenging. One could try to embed such an obfuscated program in the first block of the PRG output, but this block would need to still look random for standard PRG security. However, as it turns out there is a much simpler way to achieve a separation. Consider the case where ` = 1 then the identity function on the seed will be a pseudorandom function for the trivial reason that it does not expand. However, this function will not be hinting secure. To get a separation with expansion one can build on this to consider a PRG where the seed is split into two parts; where in one part of the seed

6 has each of its bits given out in the clear exactly once. And where the rest of the bits of the output are generated pseudorandomly from the rest of the seed. Altogether we believe that our work opens up a new avenue for exploring the connection of chosen plaintext and ciphertext security.

2 One-sided Predicate Encryption

A predicate encryption (PE) scheme PE, for set of attribute spaces X = {Xλ} , predicate classes C = λ∈N {Cλ} and message spaces M = {Mλ} , consists of four polytime algorithms (Setup, Enc, KeyGen, Dec) λ∈N λ∈N with the following syntax.

Setup(1λ) → (pp, msk). The setup algorithm takes as input the security parameter λ and a description of attribute space Xλ, predicate class Cλ and message space Mλ, and outputs the public parameters pp and the master secret key msk.

Enc(pp, m, x) → ct. The encryption algorithm takes as input public parameters pp, a message m ∈ Mλ and an attribute x ∈ Xλ. It outputs a ciphertext ct.

KeyGen(msk,C) → skC . The key generation algorithm takes as input master secret key msk and a predicate C ∈ Cλ. It outputs a secret key skC .

Dec(skC , ct) → m or ⊥. The decryption algorithm takes as input a secret key skC and a ciphertext ct. It outputs either a message m ∈ Mλ or a special symbol ⊥.

Correctness. A key-policy predicate encryption scheme is said to be correct if for all λ ∈ N,(pp, msk) ← λ Setup(1 ), for all x ∈ Xλ, C ∈ Cλ, m ∈ Mλ, skC ← KeyGen(msk,C), ct ← Enc(pp, m, x), the following holds

Correctness for decryptable ciphertexts : C(x) = 1 ⇒ Pr [Dec(skC , ct) = m] = 1,

Correctness for non-decryptable ciphertexts : C(x) = 0 ⇒ Pr [Dec(skC , ct) = ⊥] ≥ 1 − negl(λ), where negl(·) are negligible functions, and the probabilities are taken over the random coins used during key generation and encryption procedures.

Recovery from Randomness Property. A key-policy predicate encryption scheme is said to have recov- ery from randomness property if there is an additional algorithm Recover that takes as input public param- eters pp, ciphertext ct, string r and outputs y ∈ (Mλ × Xλ) ∪ {⊥} and satisfies the following condition: for λ all λ ∈ N,(pp, msk) ← Setup(1 ), for all x ∈ Xλ, m ∈ Mλ, ct = Enc(pp, m, x; r), Recover(pp, ct, r) = (m, x). If there is no (m, x, r) tuple such that ct = Enc(pp, m, x; r), then Recover(pp, ct, r) =⊥.

Security. In this work, we will be considering predicate encryption systems with one-sided security. One can consider both security against chosen plaintext attacks and chosen ciphertext attacks. First, we will present one-sided security against chosen plaintext attacks. Definition 2.1 (One-Sided Security against Chosen Plaintext Attacks). A predicate encryption scheme PE = (Setup, Enc, KeyGen, Dec) is said to be one-sided secure against chosen plaintext attacks if for every stateful PPT adversary A, there exists a negligible function negl(·), such that the following holds:

 λ  (pp, msk) ← Setup(1 ) KeyGen(msk,·) KeyGen(msk,·) 1 Pr A (ct) = b : ((m0, x0), (m1, x1)) ← A (pp)  − ≤ negl(λ) 2 b ← {0, 1}; ct ← Enc(pp, mb, xb) where every predicate query C, made by adversary A to the KeyGen(msk, ·) oracle, must satisfy the condition that C(x0) = C(x1) = 0.

7 The notion of one-sided security against chosen plaintext attacks could alternatively be captured by a simulation based definition [GVW15]. Goyal et al. [GKW17] showed that if a PE scheme satisfies Defini- tion 2.1, then it also satisfies the simulation based definition of [GVW15].

Next, we present the definition for capturing chosen ciphertext attacks on predicate encryption schemes. Here, we will assume that the key generation algorithm is deterministic. Definition 2.2 (One-Sided Security against Chosen Ciphertext Attacks). A predicate encryption scheme PE = (Setup, Enc, KeyGen, Dec) with deterministic key generation is said to be one-sided secure against chosen ciphertext attacks if for every stateful PPT adversary A, there exists a negligible function negl(·), such that the following quantity  (pp, msk) ← Setup(1λ)  1 KeyGen(msk,·),ODec(msk,·,·) ∗ KeyGen(msk,·),ODec(msk,·,·) Pr A (ct ) = b : ((m0, x0), (m1, x1)) ← A (pp)  − ∗ 2 b ← {0, 1}; ct ← Enc(pp, mb, xb) is at most negl(λ), where

• the oracle ODec(msk, ·, ·) takes as input a ciphertext ct and a circuit C. It computes skC = KeyGen(msk,C) and outputs Dec(skC , ct). • every predicate query C, made by adversary A to the KeyGen(msk, ·) oracle, must satisfy the condition that C(x0) = C(x1) = 0. • every post-challenge query (C, ct) made by the adversary A to ODec must satisfy the condition that ∗ ∗ either ct 6= ct or if ct = ct , then C(x0) = C(x1) = 0. Remark 2.1. Note that the above definition addresses chosen ciphertext attacks against systems with deterministic key generation. An analogous definition for general schemes (that is, with randomized key generation) would involve maintaining key handles and allowing the adversary to choose the key to be used for the decryption queries. We choose the simpler definition since any scheme’s key generation can be made deterministic by using a pseudorandom function. In particular, the setup algorithm chooses a PRF key K which is included as part of the master secret key. To derive a key for circuit C, the algorithm first computes r = PRF(K,C) and then uses r as randomness for the randomized key generation algorithm.

2.1 ABE schemes with ‘recovery from randomness’ property Any ABE scheme satisfying one-sided CPA security can be transformed into another ABE scheme that is also one-sided CPA secure, and has the ‘recovery from randomness’ property. The encryption algorithm simply uses part of the randomness to compute a symmetric key encryption of the message and attribute, with part of the randomness as the encryption key. More formally, let E = (Setup, Enc, KeyGen, Dec) be an ABE scheme that satisfies one-sided CPA security (see Definition 2.1), and let (SKE.Setup, SKE.Enc, SKE.Dec) be a symmetric key CPA secure encryption schceme. consider the following scheme E0 = (Setup0, Enc0, KeyGen0, Dec0, Recover), where Setup0 = Setup and KeyGen0 = KeyGen. 0 Enc (pk, m, x): The encryption algorithm first samples three random strings r1, r2, r3. It computes ct1 = λ Enc(pk, m, x; r1). Next, it computes ske.sk = SKE.Setup(1 ; r2). Finally, it computes ct2 = SKE.Enc(ske.sk, (m, x); r3) and outputs (ct1, ct2). 0 Dec (sk, (ct1, ct2)): The decryption algorithm simply decrypts ct1 using sk, and ignores ct2. It outputs Dec(sk, ct1). λ Recover((ct1, ct2), r = (r1, r2, r3)): The recovery algorithm first computes ske.sk = SKE.Setup(1 ; r2). It outputs y ← SKE.Dec(ske.sk, ct2). Assuming the symmetric key encryption scheme satisfies perfect correctness, this ABE scheme has perfect recovery from randomness property. To argue CPA security, we can first use the security of the SKE scheme |m|+|x| to switch ct2 to an encryption of 0 . Then, we can use the one-sided CPA security.

8 3 Hinting PRGs

A hinting PRG scheme is a PRG with a stronger security guarantee than standard PRGs. A hinting PRG takes n bits as input, and outputs n · ` output bits. In this security game, the challenger outputs 2n strings, each of ` bits. In one scenario, all these 2n strings are uniformly random. In the other case, half the strings are obtained from the PRG evaluation, and the remaining half are uniformly random. Moreover, these 2n strings are output as a 2 × n matrix, where in the ith column, the top entry is pseudorandom if the ith bit of the seed is 0, else the bottom entry is pseudorandom. As a result, these 2n strings give a ‘hint’ about the seed, and hence this property is stronger than regular PRGs. Note, if this hint is removed and the top entries in each column were pseudorandom (and the rest uniformly random), then this can be achieved using regular PRGs. Below, we define this primitive formally. The informal description above had two simplifications. First, the definition below considers PRGs with setup (although one can analogously define such a primitive without setup). Second, we assume the PRG outputs (n + 1) · ` bits, where the first ` bits do not contain any extra hint about the seed. Finally, for our CCA application, we introduce some notation in order to represent the n + 1 blocks of the PRG output. Instead of describing the PRG as a function that outputs (n + 1) · ` bits, we have an evaluation algorithm that takes as input an index i ∈ {0, 1, . . . , n}, and outputs the ith block of the PRG output. Let n(·, ·) be a polynomial. A n-hinting PRG scheme consists of two PPT algorithms Setup, Eval with the following syntax.

Setup(1λ, 1`): The setup algorithm takes as input the security parameter λ, and length parameter `, and outputs public parameters pp and input length n = n(λ, `). Eval (pp, s ∈ {0, 1}n, i ∈ [n] ∪ {0}): The evaluation algorithm takes as input the public parameters pp, an n bit string s, an index i ∈ [n] ∪ {0} and outputs an ` bit string y.

Definition 3.1. A hinting PRG scheme (Setup, Eval) is said to be secure if for any PPT adverasry A, polynomial `(·) there exists a negligible function negl(·) such that for all λ ∈ N, the following holds:

 λ `(λ) n  (pp, n) ← Setup(1 , 1 ), s ← {0, 1} ,    0 ` 1  β n β o β ← {0, 1}, y0 ← {0, 1} , y0 = Eval(pp, s, 0),  1 Pr 1 ← A pp, y0 , yi,b : 0 `  − ≤ negl(·)  i∈[n],b∈{0,1} yi,b ← {0, 1} ∀ i ∈ [n], b ∈ {0, 1},  2 y1 = Eval(pp, s, i), y1 ← {0, 1}` ∀ i ∈ [n] i,si i,si

4 CCA Secure Public Key Encryption Scheme

Let PKECPA = (CPA.Setup, CPA.Enc, CPA.Dec) be a IND-CPA secure public key encryption scheme with randomness-decryptable ciphertexts and perfect decryption correctness, S = (ss.Setup, ss.Sign, ss.Verify) a strongly unforgeable one time signature scheme and HPRG = (HPRG.Setup, HPRG.Eval) a hinting PRG λ+1 scheme. We will assume that our encryption scheme has message space {0, 1} . Let `PKE(·) be a polyno- mial repesenting the number of bits of randomness used by CPA.Enc, and `vk(·) the size of verification keys 4 output by ss.Setup. For simplicity of notation, we will assume `(·) = `PKE(·), `out(λ) = `vk(λ) + 3λ and λ `out(λ) PRGλ : {0, 1} → {0, 1} a family of secure pseudorandom generators.

We will now describe our CCA secure public key encryption scheme PKECCA = (CCA.Setup, CCA.Enc, `(λ) CCA.Dec) with message space Mλ = {0, 1} . For simplicity of notation, we will skip the dependence of ` and `out on λ.

CCA.Setup(1λ): The setup algorithm performs the following steps.

4Alternatively, we could set ` to be max of these two polynomials.

9 1. It chooses (HPRG.pp, 1n) ← HPRG.Setup(1λ, 1`). λ 2. It chooses 2n different PKECPA keys. Let (cpa.skb,i, cpa.pkb,i) ← CPA.Setup(1 ) for each b ∈ {0, 1}, i ∈ [n].

`out `out 3. It then chooses ai ← {0, 1} for each i ∈ [n] and B ← {0, 1} .   4. It sets cca.pk = HPRG.pp,B, a , cpa.pk  and cca.sk = (cpa.sk ) . i b,i b∈{0,1},i∈[n] 0,i i∈[n]   CCA.Enc(cca.pk, m, x): Let cca.pk = HPRG.pp,B, a , cpa.pk  . The encryption algorithm i b,i b∈{0,1},i∈[n] does the following:

1. It first chooses s ← {0, 1}n. It sets c = HPRG.Eval(HPRG.pp, s, 0) ⊕ m. 2. Next, it chooses signature keys (ss.sk, ss.vk) ← ss.Setup(1λ). λ ` 3. For each i ∈ [n], it chooses vi ← {0, 1} and ri ← {0, 1} , sets rei = HPRG.Eval(HPRG.pp, s, i). 4. Next, for each i ∈ [n], it does the following: λ+1 • If si = 0, it sets c0,i = CPA.Enc(cpa.pk0,i, 1|vi; rei), c1,i = CPA.Enc(cpa.pk1,i, 0 ; ri) and c2,i = PRG(vi). λ+1 • If si = 1, it sets c0,i = CPA.Enc(cpa.pk0,i, 0 ; ri), c1,i = CPA.Enc(cpa.pk1,i, 1|vi; rei) and 5 c2,i = PRG(vi) + ai + B · ss.vk. .   5. Finally, it sets M = c, (c0,i, c1,i, c2,i)i∈[n] , computes σ ← ss.Sign(ss.sk,M) and outputs (ss.vk, M, σ) as the ciphertext.     CCA.Dec(cca.sk, cca.pk, cca.ct): Let the ciphertext cca.ct be parsed as ss.vk, c, M = (c0,i, c1,i, c2,i)i∈[n] , σ   and cca.sk = (cpa.sk0,i)i∈[n] . The decryption algorithm does the following:

1. It first verifies the signature σ. It checks if ss.Verify(ss.vk, M, σ) = 1, else it outputs ⊥. 2. Next, the decryption algorithm computes d = PKE.Find(cca.pk, cca.sk, cca.ct) (where PKE.Find is defined in Figure 1), and outputs PKE.Check(cca.pk, cca.ct, d) (where PKE.Check is defined in Figure 2).

PKE.Find(cca.pk, cca.sk, cca.ct)

  Inputs: Public Key cca.pk = HPRG.pp,B, a , cpa.pk  i b,i b∈{0,1},i∈[n]

Secret Key cca.sk = (cpa.sk0,i)i∈[n]     Ciphertext cca.ct = ss.vk, c, M = (c0,i, c1,i, c2,i)i∈[n] , σ Output: d ∈ {0, 1}n

• For each i ∈ [n], do the following:

1. Let mi = CPA.Dec(cpa.sk0,i, c0,i).

2. If mi = 1|vi and PRG(vi) = c2,i, set di = 0. Else set di = 1.

• Output d = d1d2 . . . dn.

Figure 1: Routine PKE.Find

5 Here, we assume the verification key is embedded in F2`out , and the addition and multiplication are performed in F2`out .

10 PKE.Check(cca.pk, cca.ct, d)

  Inputs: Public Key cca.pk = HPRG.pp,B, a , cpa.pk  i b,i b∈{0,1},i∈[n]     Ciphertext cca.ct = ss.vk, c, M = (c0,i, c1,i, c2,i)i∈[n] , σ d ∈ {0, 1}n Output: msg ∈ {0, 1}`

• Let flag = true. For i = 1 to n, do the following:

1. Let rei = HPRG.Eval(HPRG.pp, d, i). 2. If di = 0, let y ← CPA.Recover(cpa.pk0,i, c0,i, rei). Perform the following checks. If any of the checks fail, set flag = false and exit loop. – m 6=⊥.

– CPA.Enc(cpa.pk0,i, y; rei) = c0,i. – m = 1|v and PRG(v) = c2,i.

3. If di = 1, let m ← CPA.Recover(cpa.pk1,i, c1,i, rei). Perform the following checks. If any of the checks fail, set flag = false and exit loop. – m 6=⊥.

– CPA.Enc(cpa.pk1,i, m; rei) = c1,i. – m = 1|v and c2,i = PRG(v) + ai + B · ss.vk. • If flag = true, output c ⊕ HPRG.Eval(HPRG.pp, d, 0). Else output ⊥.

Figure 2: Routine PKE.Check

4.1 Discussion We will now make a few observations about our construction and then proceed to give a brief overview our proof that appears in the next subsection. First, for each i ∈ [n] if si = 0 the encryption algorithm will choose a random vi and signal that this bit is a 0 by encrypting 1|vi to the position (0, i) and giving c2,i = PRG(vi) in the clear. In the opposite position of (1, i) it will encrypt the all 0’s string. Likewise, if si = 1 it will signal a 1 by encrypting 1|vi to the position (1, i) and giving c2,i = PRG(vi) + ai + B · ss.vk in the clear. With all but negligible probability it is impossible to signal both 0 and 1 simultaneously for an index i. This follows from the fact that ai is chosen randomly and that the space of verification keys is much smaller than 2`out(λ). We observe that this argument has some flavor of Naor’s bit commitment scheme [Nao89]. Second, we observe that even though one is supposed to encrypt the all 0’s string to position (¯si, i) the PKE.Find routine will not immediately quit if discovers something else. Instead it simply sets di = 0 if decryption outputs 1|vi and c2,i = PRG(vi); otherwise it sets di = 1. Thus, the decryption routine may refrain from immediately aborting even though when it “knows” the ciphertext was not formed entirely correctly. This will be critical to a proof step. Our proof of security will be organized as a sequence of security games which we show to be indistin- guishable. In the first proof step we apply a standard argument using strongly unforgeable signatures to change the decryption oracle to reject all ciphertexts corresponding to ss.vk∗ where ss.vk∗ is the verification key used by the challenge ciphertext. Next, for each i we choose the public parameter values ai such that it is possible for one to signal both 0 and 1 at index i, but that this ambiguity is only possible for a ciphertext corresponding to ss.vk∗. To do λ ∗ ∗ ∗ this it chooses uniformly random wi ← {0, 1} , and sets ai = PRG(vi ) − PRG(wi) − ss.vk · B if si = 0, ∗ ∗ else ai = PRG(wi) − PRG(vi ) − ss.vk · B. This change can be shown to be undetectable by a standard pseudorandom generator argument. The effect of this change is that it allows the possibility of ambiguous

11 signaling at both 0 and 1 in the challenge ciphertext. However, for all possible decryption queries where ss.vk 6= ss.vk∗ this remains impossible. Our next goal will be to use the IND-CPA security of the underlying PKE scheme to introduce signals on ∗ ∗ the opposite path s . To do this, however, for all i where si = 1 we must first change the decryption routine to use cpa.sk1,i to decrypt the sub-ciphertext at position (1, i) instead of using cpa.sk0,i (at position (0, i)). Consider a particular ciphertext query and let di be the bit reported by the original find algorithm on that 0 ciphertext query and di be the bit reported by a the new decryption procedure on that same ciphertext. We 0 want to argue that if di 6= di then the PKE.Check procedure will abort and output ⊥ on both encryptions. 0 The first possibility is that di = 0 and di = 1; however, that should be information theoretically impossible as it would entail signaling both a 0 and 1 for a query with ss.vk 6= ss.vk∗. The other possibility is that 0 di = 1 and di = 0; i.e. that there is not a signal present at either side. In this case the first decryption routine will have di = 1, but then when running PKE.Check it will fail to find a signal at position (1, i) and 0 abort. Likewise, the second decryption routine will have di = 0, but then fail to find a signal at position (0, i), so both routines will behave identically in this case as well. Once the oracle decryption is set to follow the seed s∗ we can straightforwardly use CPA security to ∗ introduce ambiguous signals in the messages for all positions (s i, i). Once this change is made we can change the oracle decryption routine again. This time it will only decrypt at positions (1, i) for all i ∈ [n] and only use cpa.sk1,i. A similar argument to before can be applied to make this change. All information about s is gone except to the lingering amount in the random coins used to encrypt. We can immediately apply the hinting PRG to change to a game where these values can be moved to be uniformly at random. At this point the message will be hidden.

4.2 Security Proof We will now show that the above construction satisfies the CCA security definition. Our proof proceeds via a sequence of hybrids. First, we will describe all hybrids, and then show that the hybrids are computationally indistinguishable.

4.2.1 Hybrids

Hybrid H0 : This corresponds to the original security game.

• Setup Phase

1. The challenger first chooses (HPRG.pp, 1n) ← HPRG.Setup(1λ, 1`). λ 2. Next it chooses 2n different PKECPA keys. Let (cpa.skb,i, cpa.pkb,i) ← CPA.Setup(1 ) for each i ∈ [n], b ∈ {0, 1}. ∗ n ∗ λ ∗ ∗ 3. The challenger chooses s ← {0, 1} , vi ← {0, 1} for each i ∈ [n], and (ss.sk , ss.vk ) ← λ ∗ ∗ ss.Setup(1 ). It sets rei = HPRG.Eval(HPRG.pp, s , i). (These components will be used during the challenge phase.) `out `out 4. It then chooses ai ← {0, 1} for each i ∈ [n] and B ← {0, 1} .   5. It sends cca.pk = HPRG.pp,B, a , cpa.pk  to A, and sets the secret key cca.sk = i b,i b∈{0,1},i∈[n]

(cpa.sk0,i)i∈[n].

• Pre-challenge Query Phase

– Decryption Queries   1. For each query ct = ss.vk,M = c, (c0,i, c1,i, c2,i)i , σ , the challenger first checks the sig- nature σ. 2. Next, the challenger first computes d = PKE.Find (cca.pk, cca.sk, cca.ct). 3. It outputs PKE.Check (cca.pk, cca.ct, d).

12 • Challenge Phase

∗ ∗ 1. The adversary sends two challenge messages (m0, m1). 2. The challenger chooses a bit β ∈ {0, 1}. ∗ ∗ 3. It sets c = HPRG.Eval(HPRG.pp, s, 0) ⊕ mβ. ∗ ∗ ∗ 4. It sets (c0,i, c1,i, c2,i) as follows. ∗ ∗ ∗ ∗ ∗ λ+1 – If si = 0, it sets c0,i = CPA.Enc(cpa.pk0,i, 1|vi ; rei ), c1,i ← CPA.Enc(cpa.pk1,i, 0 ) and ∗ ∗ c2,i = PRG(vi ). ∗ ∗ λ+1 ∗ ∗ ∗ – If si = 1, it sets c0,i ← CPA.Enc(cpa.pk0,i, 0 ), c1,i = CPA.Enc(cpa.pk1,i, 1|vi ; rei ) and ∗ ∗ ∗ c2,i = PRG(vi ) + ai + B · ss.vk . ∗ ∗ ∗ ∗ ∗ ∗  ∗ ∗ ∗ 5. Finally, it computes a signature σ on M = c , c0,i, c1,i, c2,i using ss.sk and sends (ss.vk , M, σ ) to A. • Post-challenge Query Phase

– Decryption Queries These are handled as in the pre-challenge phase, with the restriction that all queries (ct,C) must satisfy that ct 6= ct∗.

• Finally, the adversary sends its guess b.

Hybrid H1 : This hybrid is similar to the previous one, except that during the decryption queries, the challenger checks if ss.vk = ss.vk∗. If so, it rejects.

Hybrid H2 : In this hybrid, the challenger changes Step 4 of the setup phase. It chooses uniformly random λ ∗ ∗ ∗ ∗ ∗ wi ← {0, 1} , and sets ai = PRG(vi )−PRG(wi)−ss.vk ·B if si = 0, else ai = PRG(wi)−PRG(vi )−ss.vk ·B.

Hybrid H3 : This hybrid is similar to the previous one, except that the challenger modifies the way decryption queries are handled. Instead of using PKE.Find, the challenger uses PKE.Find-1 (defined in Figure 3). The PKE.Find routine decrypts only the c0,i values. If decryption works, it guesses di = 0, else th ∗ it guesses di = 1. The PKE.Find-1 routine decrypts either c0,i or c1,i, depending on the i bit of s . Note that the PKE.Check routine is identical in both experiments.

∗ Hybrid H4 : In this step, the challenger modifies the challenge ciphertext. For all i ∈ [n] such that si = 0, ∗ the challenger sets c1,i ← CPA.Enc(cpa.pk1,i, 1|wi).

∗ Hybrid H5 : In this step, the challenger modifies the challenge ciphertext. For all i ∈ [n] such that si = 1, ∗ 6 the challenger sets c0,i ← CPA.Enc(cpa.pk0,i, 1|wi).

Hybrid H6 : This step is similar to the previous one, except for the decryption queries in the pre- challenge/post-challenge phase. Instead of using PKE.Find-1, the challenger uses PKE.Find-2 (defined in Figure 4). Note that this routine does not require any of the predicate encryption secret keys.7

6 Note that hybrids H4 and H5 could have been clubbed into a single hybrid. We chose this distinction so that the hybrids for the PKE CCA proof are similar to the hybrids for our Predicate Encryption security proof. 7We could have simplified this step by using PKE.Find instead of using PKE.Find-2. However, looking ahead, our proof for ABE/PE systems will require an analogous PKE.Find-2 routine. Hence, we chose to add this minor additional complication here as well.

13  ∗ PKE.Find-1(cca.pk, cpa.sks∗,i , cca.ct, s ) i b∈{0,1},i∈[n]

  Inputs: Public Key cca.pk = HPRG.pp,B, a , cpa.pk  i b,i b∈{0,1},i∈[n]  Secret Keys cpa.sks∗,i i i∈[n]     Ciphertext cca.ct = ss.vk, c, M = (c0,i, c1,i, c2,i)i∈[n] , σ String s∗ ∈ {0, 1}n Output: d ∈ {0, 1}n

• For each i ∈ [n], do the following:

∗ – If si = 0,

1. Let mi = CPA.Dec(cpa.sk0,i, c0,i).

2. If mi = 1|vi and PRG(vi) = c2,i, set di = 0. Else set di = 1. ∗ – Else if si = 1,

1. Let mi = CPA.Dec(cpa.sk1,i, c1,i). ∗ 2. If mi = 1|vi and PRG(vi) + ai + B · ss.vk = c2,i, set di = 1. Else set di = 0.

• Output d = d1d2 . . . dn.

Figure 3: Routine PKE.Find-1

PKE.Find-2(cca.pk, (cpa.sk1,i)i∈[n] , cca.ct)

  Inputs: Public Key cca.pk = HPRG.pp,B, a , cpa.pk  i b,i b∈{0,1},i∈[n]

Secret Keys (cpa.sk1,i)i∈[n]     Ciphertext cca.ct = ss.vk, c, M = (c0,i, c1,i, c2,i)i∈[n] , σ Output: d ∈ {0, 1}n

• For each i ∈ [n], do the following:

1. Let mi = CPA.Dec(cpa.sk1,i, c1,i). ∗ 2. If mi = 1|vi and PRG(vi) + ai + B · ss.vk = c2,i, set di = 1. Else set di = 0.

• Output d = d1d2 . . . dn.

Figure 4: Routine PKE.Find-2

Hybrid H7 : This hybrid is identical to the previous one, and the only difference here is change of variable ∗ ∗ names. In particular, we will swap the variable names vi and wi if si = 1. This change affects the setup ∗ ∗ phase (where the ai values are set), and the challenge phase (where we set c0,i and c1,i). Also, we rename ∗ ∗ ∗ ∗ ∗ the rei and ri variables to ri,0 and ri,1, depending on si . For clarity, we will present the entire setup phase ∗ ∗ and challenge phase below. Note that with this change, the challenger only uses s to set rei . • Setup Phase

1. The challenger first chooses (HPRG.pp, 1n) ← HPRG.Setup(1λ, 1`). λ 2. Next it chooses 2n different PKE keys. Let (cpa.skb,i, cpa.pkb,i) ← CPA.Setup(1 ) for each b ∈ {0, 1}, i ∈ [n].

14 ∗ n ∗ λ λ ∗ ∗ 3. The challenger chooses s ← {0, 1} , vi ← {0, 1} , wi ← {0, 1} for each i ∈ [n], and (ss.sk , ss.vk ) ← λ ∗ ∗ ∗ ` ss.Setup(1 ). It sets ri,s∗ = HPRG.Eval(HPRG.pp, s , i) and r ∗ ← {0, 1} . (These components i i,si will be used during the challenge phase.) `out ∗ ∗ 4. It then chooses B ← {0, 1} and sets ai = PRG(v ) − PRG(wi) − B · ss.vk for each i ∈ [n].  i  5. It sends cca.pk = HPRG.pp,B, a , cpa.pk  to A, and sets the secret key cca.msk = i b,i b∈{0,1},i∈[n]

(cpa.sk1,i)i∈[n]. • Challenge Phase

∗ ∗ 1. The adversary sends two tuples (m0, m1). 2. The challenger chooses a bit β ∈ {0, 1}. ∗ ∗ 3. It sets c = HPRG.Eval(HPRG.pp, s, 0) ⊕ mβ. ∗ ∗ ∗ 4. It sets (c0,i, c1,i, c2,i) as follows. ∗ ∗ ∗ ∗ ∗ ∗ – It sets c0,i = CPA.Enc(cpa.pk0,i, 1|vi ; ri,0), c1,i = CPA.Enc(cpa.pk1,i, 1|wi; ri,1) and c2,i = ∗ ∗ PRG(vi ) = PRG(wi) + ai + B · ss.vk . ∗ ∗ ∗ ∗ ∗ ∗  ∗ ∗ ∗ 5. Finally, it computes a signature σ on M = c , c0,i, c1,i, c2,i using ss.sk and sends (ss.vk , M, σ ) to A.

∗ ` Hybrid H8 : In this hybrid, the challenger chooses both ri,b uniformly at random from {0, 1} .

4.2.2 Analysis x Let advA denote the advantage of an adversary A in Hybrid Hx. Lemma 4.1. Assuming ss is a strongly unforgeable one-time signature scheme, for any PPT adversary A, 0 1 there exists a negligible function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ). Proof. This proof follows from the security of ss. The only difference between these two hybrids is that the challenger, on receiving a decryption query, rejects if it contains ss.vk∗. Suppose there exists a PPT 0 1 adversary A such that |advA − advA| is non-negligible. We can use A to break the security of ss. The reduction algorithm B receives a verification key vk∗ from the signature scheme’s challenger. The reduction algorithm chooses all other components by itself. Next, during the pre-challenge decryption queries, if any decryption query has vk∗ in it and the signature verification passes, then the reduction algorithm outputs this as a forgery. ∗ ∗ During the challenge phase, the reduction algorithm receives (m0, m1). It chooses β, and computes ∗ ∗ ∗ ∗ ∗  ∗ ∗ M = c0, c0,i, c1,i, c2,i as in H0. Finally, it sends M to the challenger, and receives signature σ . It sends (vk∗,M ∗, σ∗) to A. The adversary then makes polynomially many decryption/key generation queries. If there exists some de- cryption query with verification key vk∗ that verifies, then the reduction algorithm outputs the corresponding message and signature as a forgery. 0 1 2 Clearly, B s advantage is at least advA − advA. Lemma 4.2. Assuming PRG is a secure pseudorandom generator, for any PPT adversary A, there exists a 1 2 negligible function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ). Proof. The proof of this lemma follows from the security of PRG. The only difference between the two hybrids is the choice of ai. In H1, all ai are chosen uniformly at random. In H2, the challenger chooses λ ∗ ∗ ∗ ∗ wi ← {0, 1} for each i, and sets ai as either PRG(vi )−PRG(wi)−ss.vk ·B or PRG(wi)−PRG(vi )−ss.vk ·B, depending on si. Since wi is not used anywhere else in both these hybrid experiments, we can use PRG security to argue that any PPT adversary has nearly identical advantage in H1 and H2. Lemma 4.3. Assuming correctness for decryptable ciphertexts for PKE scheme, for any adversary A, there 2 3 exists a negligible function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ).

15 Proof. This is an information-theoretic step, and holds for all adversaries (not necessarily polynomial time). The only difference between these two hybrids is with respect to the decryption queries. In H2, the challenger uses the routine PKE.Find to get a string d, and then checks if d is valid (using PKE.Check). In H3, the challenger uses PKE.Find-1 to compute the string d. In fact, one can prove a more general statement: note that PKE.Find corresponds to PKE.Find-1 with last input set to be 0n. We can show that for any two strings s∗ and s0, decryption using PKE.Find-1(·, ·, ·, s∗) is statistically indistinguishable from decryption 0 using PKE.Find-1(·, ·, ·, s ). For simplicity, we will present indistinguishability of H2 and H3, where in H2, the challenger uses PKE.Find for decryption queries. We will argue that with overwhelming probability, for any decryption query ct, either PKE.Find and PKE.Find-1 output the same d, or they output d and d0 respectively but PKE.Check rejects both. In particular, ∗ it suffices to show that there exists a negligible function negl(·) such that for all λ ∈ N, s∗ ∈ [n] and ss.vk , the following event’s probability (denoted by p, parameterized by s∗ and ss.vk∗) is at most negl(λ):

 ∃ct s.t. HPRG.pp ← HPRG.Setup(1λ, 1`),B ← {0, 1}`out  ∗ ∗ λ  ct = (ss.vk, (c0, (c0,i, c1,i, c2,i)) , σ) , ss.vk 6= ss.vk vi , wi ← {0, 1} ,  ∗  ∗ si ∗   PKE.Find(pk, sk, ct) = d ai = (PRG(vi ) − PRG(wi)) · (−1) − B · ss.vk ,   0 ∗ 0 λ   PKE.Find-1(pk, sk , ct, s ) = d (cpa.pkb,i, cpa.skb,i) ← CPA.Enc(1 )  0 0  PKE.Check(pk, ct, d) 6= PKE.Check(pk, ct, d ) sk = (cpa.sk ) , sk = cpa.sk ∗ 0,i i si ,i i

where the probability is over the random coins used in PredECCA.Setup. Now, p ≤ p0 +p1, where pb is defined as the following event’s probability:

  ∃ct s.t. λ ` `out ∗ HPRG.pp ← HPRG.Setup(1 , 1 ),B ← {0, 1}  ct = (ss.vk, (c0, (c0,i, c1,i, c2,i)) , σ) , ss.vk 6= ss.vk ∗ λ   vi , wi ← {0, 1} ,  PKE.Find(pk, sk, ct) = d ∗  ∗ si ∗   0 ∗ 0 ai = (PRG(vi ) − PRG(wi)) · (−1) − B · ss.vk ,   PKE.Find-1(pk, sk , ct, s ) = d λ   ∗ 0 (cpa.pkb,i, cpa.skb,i) ← CPA.Enc(1 )   i : first index s.t. si = 1, di = b, di = b 0   sk = (cpa.sk0,i) , sk = cpa.sks∗,i PKE.Check(pk, ct, d) 6= PKE.Check(pk, ct, d0) i i i

We will show that pb ≤ negl(·) for both b ∈ {0, 1}. To prove this, let us first consider the following event:

 λ  pPRG = Pr ∃ α1, α2 ∈ {0, 1} , i ∈ [n], ss.vk s.t. PRG(α1) = PRG(α2) + ai + B · ss.vk

`out ∗ λ 0 where the probability is over the choice of B ← {0, 1} and vi , wi ← {0, 1} . Then pb ≤ pPRG + pb, where 0 0 pb is like pb, except for an additional condition that ∀γ, δ, PRG(γ) 6= PRG(δ) + ai + B · ss.vk. It is formally defined as the following event’s probability:

 ∃ct s.t.  ∗ λ ` `out  ct = (ss.vk, (c0, (c0,i, c1,i, c2,i)) , σ) , ss.vk 6= ss.vk HPRG.pp ← HPRG.Setup(1 , 1 ),B ← {0, 1}   ∗ λ   PKE.Find(pk, sk, ct) = d vi , wi ← {0, 1} ,  0 ∗  ∗ 0 ∗ si ∗   PKE.Find-1(pk, sk , ct, s ) = d ai = (PRG(vi ) − PRG(wi)) · (−1) − B · ss.vk ,   ∗ 0 λ   i : first index s.t. si = 1, di = b, di = b (cpa.pkb,i, cpa.skb,i) ← CPA.Enc(1 )   0   ∀γ, δ, PRG(γ) 6= PRG(δ) + a + B · ss.vk sk = (cpa.sk ) , sk = cpa.sk ∗  i 0,i i si ,i i  PKE.Check(pk, ct, d) 6= PKE.Check(pk, ct, d0)

0 0 Hence, it suffices to show that pPRG ≤ negl(λ), p0 ≤ negl(λ) and p1 ≤ negl(λ).

Claim 4.1. pPRG ≤ negl(λ).

∗ ∗ Proof. We will prove a stronger statement: for all ss.vk ,s and {vi, wi}i∈[n], the following probability is at most n · 2−λ:  ∃ γ, δ ∈ {0, 1}λ, i ∈ [n], ss.vk 6= ss.vk∗ s.t.  Pr s∗ PRG(γ) = PRG(δ) + (PRG(vi) − PRG(wi)) · (−1) i + B · ss.vk

16 where the probability is over the choice of B. Fix any integer i ∈ [n]. Consider the following sets.

S = PRG(x): x ∈ {0, 1}λ −  s∗ λ S = PRG(x) − PRG(y) − (PRG(vi) − PRG(wi)) · (−1) i : x, y ∈ {0, 1} ∗ − si  ∗ Svk = { PRG(x) − PRG(y) − (PRG(vi) − PRG(wi)) · (−1) /(ss.vk − ss.vk ): x, y ∈ {0, 1}λ, ss.vk ∈ {0, 1}`vk }

λ − 2λ − The set S has size at most 2 . As a result, the set S has size at most 2 . Finally, the set Svk has size at most 22λ+`vk . If we choose a uniformly random element from {0, 1}`out ≡ {0, 1}3λ+`vk , then this element falls − −λ in Svk with probability at most 2 . This concludes our proof. 0 Claim 4.2. p0 = 0. 0 Proof. This follows from the definitions of PKE.Find, PKE.Find-1 and p0. Note that PKE.Find sets di = 0 only if the decrypted value 1|vi satisfies PRG(vi) = c2,i, and PKE.Find-1 sets di = 1 only if the decrypted 0 value 1|wi satisfies PRG(wi) + ai + B · ss.vk = c2,i. This, together with the requirement in p0 that ∀ γ, δ, 0 PRG(γ) 6= PRG(δ) + ai + B · ss.vk, implies that p0 = 0. 0 Claim 4.3. Assuming correctness for decryptable ciphertexts , p1 = 0. Proof Intuition. We will first present an overview of the proof, and discuss a subtle but important point in the construction/proof. 0 0 Let E1 denote the event corresponding to p1. For this event to happen, there exists an index i such ∗ th that si = 1, and the i iteration of both PKE.Find and PKE.Find-1 fail to find a signal (that is, either the decryption fails, or the PRG check fails). Let d be the string output by PKE.Find, and d0 the string output 0 0 by PKE.Find-1 (therefore di = di = 1). We need to show that PKE.Check outputs ⊥ for both d and d . Suppose PKE.Check does not output ⊥ for d. Then, this means that there exists a v such that c1,i is a PKE th encryption of 1|v and PRG(v) + ai + B · ss.vk = c2,i. In this case, the i iteration of PKE.Find-1 should set 0 di = 1, which is a contradiction. The other case, where PKE.Check does not output ⊥ for d0, is similar. This means there exists v, x such that c0,i is an encryption of 1|v for attribute x, C(x) = 1 and PRG(v) = c2,i. Using perfect correctness of the PKE scheme, we can argue that PKE.Find should have set di = 0, which is a contradiction.

∗ 0 0 Proof. Suppose si = 1, di = 1, di = 0, and PKE.Check outputs different value for both d and d . Let 0 0 0 rei = HPRG.Eval(HPRG.pp, d, i), rei = HPRG.Eval(HPRG.pp, d , i), m ← CPA.Recover(cpa.pk1,i, c1,i, rei), m ← 0 0 CPA.Recover(cpa.pk0,i, c0,i, rei ). Since PKE.Check outputs different values for d and d , it does not output ⊥ for at least one of them in the ith iteration. We will consider two cases. th Case 1: PKE.Check does not output ⊥ for d in the i iteration: As a result, m = 1|v, c1,i = CPA.Enc(cpa.pk1,i, m; rei) and PRG(v) + ai + B · ss.vk = c2,i. This means that CPA.Dec(sk1,i, c1,i) = 1|v (by perfect correctness 0 of the PKE decryption algorithm). However, this means di = 1 (by definition of PKE.Find-1). Hence Case 1 cannot occur. 0 th Case 2: PKE.Check does not output ⊥ for d in the i iteration: As a result, m = 1|v, c0,i = CPA.Enc(cpa.pk0,i, m; rei), and PRG(v) = c2,i. This means that CPA.Dec(cpa.sk0,i, c0,i) = 1|v (since we have perfect correctness for PredE decryption).However, by definition of PKE.Find, di = 0. Hence Case 2 cannot occur.

Lemma 4.4. Assuming PKE is IND-CPA secure, for any PPT adversary A, there exists a negligible function 3 4 negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ).

Proof. The only difference in the two hybrids is with respect to the challenge ciphertext. In H3, the challenger ∗ λ+1 ∗ ∗ sets c1,i to be encryption of 0 for all i ∈ [n] such that si = 0. In H4, the challenger sets c1,i to be encryption ∗ of 1|wi. Note that the decryption queries require cpa.sk1,i only if si = 1. As a result, using the IND-CPA security of PKE, it follows that the two hybrids are computationally indistinguishable.

17 Lemma 4.5. Assuming PKE is IND-CPA secure, for any PPT adversary A, there exists a negligible function 4 5 negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ).

Proof. The proof of this lemma is similar to the proof of the previous lemma (Lemma 4.4). In H4, the ∗ λ+1 ∗ ∗ challenger sets c0,i to be encryption of 0 for all i ∈ [n] such that si = 1. In H5, the challenger sets c0,i ∗ to be encryption of 1|wi. Note that the decryption queries require cpa.sk0,i only if si = 0. As a result, using the IND-CPA security of PKE, it follows that the two hybrids are computationally indistinguishable. Lemma 4.6. Assuming correctness for decryptable ciphertexts for PKE scheme, for any adversary A, there 5 6 exists a negligible function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ). Proof. This proof is similar to the proof of Lemma 4.3. In particular, recall that the proof of Lemma 4.3 works for any s∗, s0, and note that PKE.Find-2 simply corresponds to PKE.Find-1(·, ·, ·, 1n).

6 7 Lemma 4.7. advA = advA.

Proof. This follows from the definition of the two hybrids. The only difference between H6 and H7 is that ∗ ∗ the variable names vi and wi are swapped if si = 1. As a result, any adversary has identical advantage in both hybrids. Lemma 4.8. Assuming HPRG satisfies Definition 3.1, for any PPT adversary A, there exists a negligible 7 8 function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ). 7 8 Proof. Suppose there exists a PPT adversary A such that |advA − advA| = . We will use A to build a PPT reduction algorithm B that breaks the security of HPRG.   ∗  ∗  The reduction algorithm first receives HPRG.pp and r0, rb,i from the challenger. It i∈[n],b∈{0,1} ∗ ∗ ∗ `out  λ chooses {vi , wi},(ss.sk , ss.vk ), sets {ai}, chooses B ← {0, 1} , (cpa.pkb,i, cpa.skb,i) ← PredE.Setup(1 )  and sends HPRG.pp,B, ai, cpa.pkb,i to A. Next, it receives decryption queries, which can be handled using ∗ ∗ ∗ {cpa.sk1,i} (as in H6/H7). For the challenge ciphertext, it chooses β ← {0, 1}, sets c0 = mb ⊕ r0, computes ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ c0,i = CPA.Enc(cpa.pk0,i, 1|vi ; r0,i), c1,i = CPA.Enc(cpa.pk1,i, 1|wi; r1,i), c2,i = PRG(vi ) = PRG(wi ) + ai + ∗ ∗ ∗ ∗ ∗  B · ss.vk and finally computes a signature on c , c0,i, c1,i, c2,i . It sends the ciphertext to the adversary. The post-challenge queries are handled as the pre-challenge queries. Finally, the adversary sends its guess 0 0 ∗ β . If β 6= β , the reduction algorithm guesses that all rb,i are uniformly random. This reduction algorithm has advantage  in the hinting PRG security game.

8 Lemma 4.9. For any adversary A, advA = 0. ∗ Proof. Note that in hybrid H9, there is no information about mβ in the challenge ciphertext, since c0 is  ∗ ∗ uniformly random and the c0,i components are encryptions to attribute x0. Hence, there is no information about β in the challenge ciphertext, and any adversary has zero advantage in H9.

5 CCA Secure Predicate Encryption Scheme

Let PredE = (PredE.Setup, PredE.Enc, PredE.KeyGen, PredE.Dec) be a predicate encryption scheme with randomness-decryptable ciphertexts and one-sided security against chosen plaintext attacks, PKE = (CPA.Setup, CPA.Enc, CPA.Dec) an IND-CPA secure public key encryption scheme with randomness-decryptable ci- phertexts, S = (ss.Setup, ss.Sign, ss.Verify) a strongly unforgeable one time signature scheme and HPRG = (HPRG.Setup, HPRG.Eval) a hinting PRG scheme. We will assume both our encryption schemes have mes- λ+1 sage space {0, 1} . Let `PredE(·) be a polynomial repesenting the number of bits of randomness used by PredE.Enc, `PKE(·) the number of random bits used by CPA.Enc, and `vk(·) the size of verification keys output 8 by ss.Setup. For simplicity of notation, we will assume `(·) = `PredE(·) = `PKE(·), `out(λ) = `vk(λ) + 3λ and λ `out(λ) PRGλ : {0, 1} → {0, 1} a family of secure pseudorandom generators.

8Alternatively, we could set ` to be max of these two polynomials.

18 We will now describe our CCA-one-sided secure predicate encryption scheme PredECCA = (PredECCA.Setup, `(λ) PredECCA.Enc, PredECCA.KeyGen, PredECCA.Dec) with message space Mλ = {0, 1} . For simplicity of no- tation, we will skip the dependence of ` and `out on λ.

λ n λ ` PredECCA.Setup(1 ): The setup algorithm first chooses (HPRG.pp, 1 ) ← HPRG.Setup(1 , 1 ). Next it λ chooses n different PredE keys and PKE keys. Let (pred.mski, pred.pki) ← PredE.Setup(1 ), (cpa.ski, cpa.pki) ← λ `out `out CPA.Setup(1 ) for each i ∈ [n]. It then chooses ai ← {0, 1} for each i ∈ [n] and B ← {0, 1} . It   sets pe.cca.pk = HPRG.pp,B, (ai, pred.pki, cpa.pki)i∈[n] and pe.cca.msk = (pred.mski, cpa.ski)i∈[n].   PredECCA.Enc(pe.cca.pk, m, x): Let pe.cca.pk = HPRG.pp,B, (ai, pred.pki, cpa.pki)i∈[n] . The encryption n algorithm first chooses s ← {0, 1} . It sets c0 = HPRG.Eval(HPRG.pp, s, 0) ⊕ m. Next, it chooses λ λ ` signature keys (ss.sk, ss.vk) ← ss.Setup(1 ). For each i ∈ [n], it chooses vi ← {0, 1} and ri ← {0, 1} , sets rei = HPRG.Eval(HPRG.pp, s, i) and does the following: λ+1 • If si = 0, it sets c0,i = PredE.Enc(pred.pki, 1|vi, x; rei), c1,i = CPA.Enc(cpa.pki, 0 ; ri) and c2,i = PRG(vi). λ+1 • If si = 1, it sets c0,i = PredE.Enc(pred.pki, 0 , x; ri), c1,i = CPA.Enc(cpa.pki, 1|vi; rei) and c2,i = 9 PRG(vi) + ai + B · ss.vk. .   Finally, it sets M = c0, (c0,i, c1,i, c2,i)i∈[n] , computes σ ← ss.Sign(ss.sk,M) and outputs (ss.vk, M, σ) as the ciphertext.

PredECCA.KeyGen(pe.cca.msk,C): Let pe.cca.msk = (pred.mski, cpa.ski)i∈[n]. The key generation algorithm   computes pred.ski ← PredE.KeyGen(pred.mski,C) and outputs pe.cca.sk = C, (pred.ski)i∈[n] .     PredECCA.Dec(pe.cca.sk, pe.cca.pk, pe.cca.ct): Let the ciphertext pe.cca.ct be parsed as ss.vk, c0,M = (c0,i, c1,i, c2,i)i∈[n] , σ   and pe.cca.sk = C, (pred.ski)i∈[n] . The decryption algorithm first verifies the signature σ. It checks if ss.Verify(ss.vk, M, σ) = 1, else it outputs ⊥. Next, the decryption algorithm computes d = Find(pe.cca.pk, pe.cca.sk, pe.cca.ct) (where Find is defined in Figure 5), and outputs Check(pe.cca.pk, pe.cca.ct, C, d) (where Check is defined in Figure 6).

Find(pe.cca.pk, pe.cca.sk, pe.cca.ct)

  Inputs: Public Key pe.cca.pk = HPRG.pp,B, (ai, pred.pki, cpa.pki)i∈[n]

Secret Key pe.cca.sk = (pred.ski)i∈[n]     Ciphertext pe.cca.ct = ss.vk, c0,M = (c0,i, c1,i, c2,i)i∈[n] , σ Output: d ∈ {0, 1}n

• For each i ∈ [n], do the following:

1. Let mi = PredE.Dec(pred.ski, c0,i).

2. If mi = 1|vi and PRG(vi) = c2,i, set di = 0. Else set di = 1.

• Output d = d1d2 . . . dn.

Figure 5: Routine Find

9 Here, we assume the verification key is embedded in F2`out , and the addition and multiplication are performed in F2`out .

19 Check(pe.cca.pk, pe.cca.ct, C, d)

  Inputs: Public Key pe.cca.pk = HPRG.pp,B, (ai, pred.pki, cpa.pki)i∈[n]     Ciphertext pe.cca.ct = ss.vk, c0,M = (c0,i, c1,i, c2,i)i∈[n] , σ

Circuit C ∈ Cλ d ∈ {0, 1}n Output: msg ∈ {0, 1}`

• Let flag = true. For i = 1 to n, do the following:

1. Let rei = HPRG.Eval(HPRG.pp, d, i). 2. If di = 0, let y ← PredE.Recover(pred.pki, c0,i, rei). Perform the following checks. If any of the checks fail, set flag = false and exit loop. – y = (m, x) 6=⊥. – C(x) = 1.

– PredE.Enc(pred.pki, m, x; rei) = c0,i. – m = 1|v and PRG(v) = c2,i.

3. If di = 1, let m ← CPA.Recover(cpa.pki, c1,i, rei). Perform the following checks. If any of the checks fail, set flag = false and exit loop. – m 6=⊥.

– CPA.Enc(cpa.pki, m; rei) = c1,i. – m = 1|v and c2,i = PRG(v) + ai + B · ss.vk.

• If flag = true, output c0 ⊕ HPRG.Eval(HPRG.pp, d, 0). Else output ⊥.

Figure 6: Routine Check

5.1 Security Proof The security proof works via a sequence of hybrid experiments, and the hybrid experiments are very similar to the ones used for the PKE construction.

20 We will now show that the above construction satisfies Definition 2.2. Our proof proceeds via a se- quence of hybrids. First, we will describe all hybrids, and then show that the hybrids are computationally indistinguishable.

5.1.1 Hybrids

Hybrid H0 : This corresponds to the original security game (as described in Definition 2.2). • Setup Phase

1. The challenger first chooses (HPRG.pp, 1n) ← HPRG.Setup(1λ, 1`). λ 2. Next it chooses n different PredE keys and PKE keys. Let (pred.mski, pred.pki) ← PredE.Setup(1 ), λ (cpa.ski, cpa.pki) ← CPA.Setup(1 ) for each i ∈ [n]. ∗ n ∗ λ ∗ ∗ 3. The challenger chooses s ← {0, 1} , vi ← {0, 1} for each i ∈ [n], and (ss.sk , ss.vk ) ← λ ∗ ∗ ss.Setup(1 ). It sets rei = HPRG.Eval(HPRG.pp, s , i). (These components will be used during the challenge phase.) `out `out 4. It then chooses ai ← {0, 1} for each i ∈ [n] and B ← {0, 1} .   5. It sends pe.cca.pk = HPRG.pp,B, (ai, pred.pki, cpa.pki)i∈[n] to A, and sets the master secret key

pe.cca.msk = (pred.mski, cpa.ski)i∈[n]. • Pre-challenge Query Phase

– Decryption Queries    1. For each query ct = ss.vk,M = c0, (c0,i, c1,i, c2,i)i , σ ,C , the challenger first checks the signature σ.

2. Next, it computes pe.cca.skC ← PredECCA.KeyGen(msk,C). Let skC = (skC,i)i∈[n]. 3. The challenger first computes d = Find (pe.cca.pk, pe.cca.skC , pe.cca.ct). 4. Next, it outputs Check (pe.cca.pk, pe.cca.ct, C, d).

– Key Generation Queries: For each query C, the challenger outputs the secret key pe.cca.skC = PredECCA.KeyGen(pe.cca.msk,C). • Challenge Phase

∗ ∗ ∗ ∗ 1. The adversary sends two tuples (x0, m0), (x1, m1) such that for all key queries C in the pre- ∗ ∗ challenge query phase, C(x0) = C(x1) = 0. 2. The challenger chooses a bit β ∈ {0, 1}. ∗ ∗ 3. It sets c = HPRG.Eval(HPRG.pp, s, 0) ⊕ mβ. ∗ ∗ ∗ 4. It sets (c0,i, c1,i, c2,i) as follows. ∗ ∗ ∗ ∗ ∗ ∗ λ+1 – If si = 0, it sets c0,i = PredE.Enc(pred.pki, 1|vi , xβ; rei ), c1,i ← CPA.Enc(cpa.pki, 0 ) and ∗ ∗ c2,i = PRG(vi ). ∗ ∗ λ+1 ∗ ∗ ∗ ∗ – If si = 1, it sets c0,i ← PredE.Enc(pred.pki, 0 , xβ), c1,i = CPA.Enc(cpa.pki, 1|vi ; rei ) and ∗ ∗ ∗ c2,i = PRG(vi ) + ai + B · ss.vk . ∗ ∗ ∗ ∗ ∗ ∗  ∗ ∗ ∗ 5. Finally, it computes a signature σ on M = c , c0,i, c1,i, c2,i using ss.sk and sends (ss.vk , M, σ ) to A. • Post-challenge Query Phase

– Decryption Queries These are handled as in the pre-challenge phase, with the restriction that all ∗ ∗ ∗ queries (ct,C) must satisfy that ct 6= ct or C(x0) = C(x1) = 0. – Key Generation Queries These are handled as in the pre-challenge phase, with the restriction ∗ ∗ that all queries C must satisfy C(x0) = C(x1) = 0. • Finally, the adversary sends its guess b.

21 Hybrid H1 : This hybrid is similar to the previous one, except that during the decryption queries, the challenger checks if ss.vk = ss.vk∗. If so, it rejects.

Hybrid H2 : In this hybrid, the challenger changes Step 4 of the setup phase. It chooses uniformly random λ ∗ ∗ ∗ ∗ ∗ wi ← {0, 1} , and sets ai = PRG(vi )−PRG(wi)−ss.vk ·B if si = 0, else ai = PRG(wi)−PRG(vi )−ss.vk ·B.

Hybrid H3 : This hybrid is similar to the previous one, except that the challenger modifies the way decryption queries are handled. Instead of using Find, the challenger uses Find-1 (defined in Figure 7). The Find routine decrypts only the c0,i values. If decryption works, it sets si = 0, else it sets si = 1. The Find-1 th ∗ routine decrypts either c0,i or c1,i, depending on the i bit of s . Note that the Check routine is identical in both experiments.

∗ Find-1(pe.cca.pk, (pred.ski, cpa.ski)i∈[n] , pe.cca.ct, s )

  Inputs: Public Key pe.cca.pk = HPRG.pp,B, (ai, pred.pki, cpa.pki)i∈[n]

Secret Keys (pred.ski, cpa.ski)i∈[n]     Ciphertext pe.cca.ct = ss.vk, c0,M = (c0,i, c1,i, c2,i)i∈[n] , σ String s∗ ∈ {0, 1}n Output: d ∈ {0, 1}n

• For each i ∈ [n], do the following:

∗ – If si = 0,

1. Let mi = PredE.Dec(pred.ski, c0,i).

2. If mi = 1|vi and PRG(vi) = c2,i, set di = 0. Else set di = 1. ∗ – Else if si = 1,

1. Let mi = CPA.Dec(cpa.ski, c1,i). ∗ 2. If mi = 1|vi and PRG(vi) + ai + B · ss.vk = c2,i, set di = 1. Else set di = 0.

• Output d = d1d2 . . . dn.

Figure 7: Routine Find-1

∗ Hybrid H4 : In this step, the challenger modifies the challenge ciphertext. For all i ∈ [n] such that si = 0, ∗ the challenger sets c1,i ← CPA.Enc(cpa.pk, 1|wi).

∗ Hybrid H5 : In this step, the challenger modifies the challenge ciphertext. For all i ∈ [n] such that si = 1, ∗ ∗ the challenger sets c0,i ← PredE.Enc(pred.pk, 1|wi, xβ).

Hybrid H6 : This step is similar to the previous one, except for the decryption queries in the pre- challenge/post-challenge phase. Instead of using Find-1, the challenger uses Find-2 (defined in Figure 8). Note that this routine does not require any of the predicate encryption secret keys.

Hybrid H7 : This hybrid is identical to the previous one, and the only difference here is change of variable ∗ ∗ names. In particular, we will swap the variable names vi and wi if si = 1. This change affects the setup ∗ ∗ phase (where the ai values are set), and the challenge phase (where we set c0,i and c1,i). Also, we rename ∗ ∗ ∗ ∗ ∗ the rei and ri variables to r0,i and r1,i, depending on si . For clarity, we will present the entire setup phase ∗ ∗ and challenge phase below. Note that with this change, the challenger only uses s to set rei .

22 Find-2(pe.cca.pk, (cpa.ski)i∈[n] , pe.cca.ct)

  Inputs: Public Key pe.cca.pk = HPRG.pp,B, (ai, pred.pki, cpa.pki)i∈[n]

Secret Keys (cpa.ski)i∈[n]     Ciphertext pe.cca.ct = ss.vk, c0,M = (c0,i, c1,i, c2,i)i∈[n] , σ Output: d ∈ {0, 1}n

• For each i ∈ [n], do the following:

1. Let mi = CPA.Dec(cpa.ski, c1,i). ∗ 2. If mi = 1|vi and PRG(vi) + ai + B · ss.vk = c2,i, set di = 1. Else set di = 0.

• Output d = d1d2 . . . dn.

Figure 8: Routine Find-2

• Setup Phase

1. The challenger first chooses (HPRG.pp, 1n) ← HPRG.Setup(1λ, 1`). λ 2. Next it chooses n different PredE keys and PKE keys. Let (pred.mski, pred.pki) ← PredE.Setup(1 ), λ (cpa.ski, cpa.pki) ← CPA.Setup(1 ) for each i ∈ [n]. ∗ n ∗ λ λ ∗ ∗ 3. The challenger chooses s ← {0, 1} , vi ← {0, 1} , wi ← {0, 1} for each i ∈ [n], and (ss.sk , ss.vk ) ← λ ∗ ∗ ∗ ` ss.Setup(1 ). It sets ri,s∗ = HPRG.Eval(HPRG.pp, s , i) and r ∗ ← {0, 1} . (These components i i,si will be used during the challenge phase.) `out ∗ ∗ 4. It then chooses B ← {0, 1} and sets ai = PRG(v ) − PRG(wi) − B · ss.vk for each i ∈ [n].  i  5. It sends pe.cca.pk = HPRG.pp,B, (ai, pred.pki, cpa.pki)i∈[n] to A, and sets the master secret key

pe.cca.msk = (pred.mski, cpa.ski)i∈[n]. • Challenge Phase

∗ ∗ ∗ ∗ 1. The adversary sends two tuples (x0, m0), (x1, m1) such that for all key queries C in the pre- ∗ ∗ challenge query phase, C(x0) = C(x1) = 0. 2. The challenger chooses a bit β ∈ {0, 1}. ∗ ∗ 3. It sets c = HPRG.Eval(HPRG.pp, s, 0) ⊕ mβ. ∗ ∗ ∗ 4. It sets (c0,i, c1,i, c2,i) as follows. ∗ ∗ ∗ ∗ ∗ ∗ ∗ – It sets c0,i = PredE.Enc(pred.pki, 1|vi , xβ; r0,i), c1,i = CPA.Enc(cpa.pki, 1|wi; r1,i) and c2,i = ∗ ∗ PRG(vi ) = PRG(wi) + ai + B · ss.vk . ∗ ∗ ∗ ∗ ∗ ∗  ∗ ∗ ∗ 5. Finally, it computes a signature σ on M = c , c0,i, c1,i, c2,i using ss.sk and sends (ss.vk , M, σ ) to A.

∗ ` Hybrid H8 : In this hybrid, the challenger chooses both rb,i uniformly at random from {0, 1} .

 ∗ ∗ Hybrid H9 : In this hybrid, the challenger computes c0,i as encryptions for attribute x0. As a result, the ciphertext contains no information about the bit β chosen by the challenger.

x Analysis Let advA denote the advantage of an adversary A in Hybrid Hx. Lemma 5.1. Assuming ss is a strongly unforgeable one-time signature scheme, for any PPT adversary A, 0 1 there exists a negligible function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ).

23 Proof. This proof follows from the security of ss. The only difference between these two hybrids is that the challenger, on receiving a decryption query, rejects if it contains ss.vk∗. Suppose there exists a PPT 0 1 adversary A such that |advA − advA| is non-negligible. We can use A to break the security of ss. The reduction algorithm B receives a verification key vk∗ from the signature scheme’s challenger. The reduction algorithm chooses all other components by itself. Next, during the pre-challenge decryption queries, if any decryption query has vk∗ in it and the signature verification passes, then the reduction algorithm outputs this as a forgery. ∗ ∗ ∗ ∗ During the challenge phase, the reduction algorithm receives (x0, m0) and (x1, m1). It chooses β, and ∗ ∗ ∗ ∗ ∗  ∗ computes M = c , c0,i, c1,i, c2,i as in H0. Finally, it sends M to the challenger, and receives signature σ∗. It sends (vk∗,M ∗, σ∗) to A. The adversary then makes polynomially many decryption/key generation queries. If there exists some de- cryption query with verification key vk∗ that verifies, then the reduction algorithm outputs the corresponding message and signature as a forgery. 0 1 2 Clearly, B s advantage is at least advA − advA. Lemma 5.2. Assuming PRG is a secure pseudorandom generator, for any PPT adversary A, there exists a 1 2 negligible function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ). Proof. The proof of this lemma follows from the security of PRG. The only difference between the two hybrids is the choice of ai. In H1, all ai are chosen uniformly at random. In H2, the challenger chooses λ ∗ ∗ ∗ ∗ wi ← {0, 1} for each i, and sets ai as either PRG(vi )−PRG(wi)−ss.vk ·B or PRG(wi)−PRG(vi )−ss.vk ·B, depending on si. Since wi is not used anywhere else in both these hybrid experiments, we can use PRG security to argue that any PPT adversary has nearly identical advantage in H1 and H2. Lemma 5.3. Assuming correctness for decryptable ciphertexts for PredE and PKE schemes, for any adver- 2 3 sary A, there exists a negligible function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ). Proof. This is an information-theoretic step, and holds for all adversaries (not necessarily polynomial time). The only difference between these two hybrids is with respect to the decryption queries. In H2, the challenger uses the routine Find to get a string d, and then checks if d is valid (using Check). In H3, the challenger uses Find-1 to compute the string d. In fact, one can prove a more general statement: note that Find corresponds to Find-1 with last input set to be 0n. We can show that for any two strings s∗ and s0, decryption using Find-1(·, ·, ·, s∗) is statistically indistinguishable from decryption using Find-1(·, ·, ·, s0). For simplicity, we will present indistinguishability of H2 and H3, where in H2, the challenger uses Find for decryption queries. We will argue that with overwhelming probability, for any decryption query (ct,C), either Find and Find-1 output the same d, or they output d and d0 respectively but Check rejects both. In particular, it suffices to ∗ show that there exists a negligible function negl(·) such that for all λ ∈ N, s∗ ∈ [n] and ss.vk , the following event’s probability (denoted by p, parameterized by s∗ and ss.vk∗) is at most negl(λ):

 ∃(ct,C) s.t. HPRG.pp ← HPRG.Setup(1λ, 1`),B ← {0, 1}`out  ∗ λ  ct = (ss.vk, (c0, (c0,i, c1,i, c2,i)) , σ) vi , wi ← {0, 1} ,  ∗ ∗  ∗ si ∗   ss.vk 6= ss.vk ai = (PRG(vi ) − PRG(wi)) · (−1) − B · ss.vk ,   λ   Find(pk, sk, ct) = d (pred.pki, pred.mski) ← PredE.Enc(1 )   ∗ 0 λ   Find-1(pk, sk, ct, s ) = d (cpa.pki, cpa.ski) ← CPA.Enc(1 )  0 Check(pk, ct, C, d) 6= Check(pk, ct, C, d ) sk = (PredECCA.KeyGen(pred.mski,C))i

where the probability is over the random coins used in PredECCA.Setup. Now, p ≤ p0 +p1, where pb is defined as the following event’s probability:

24  ∃(ct,C) s.t.  HPRG.pp ← HPRG.Setup(1λ, 1`),B ← {0, 1}`out  ct = (ss.vk, (c0, (c0,i, c1,i, c2,i)) , σ) ∗ λ   ∗ vi , wi ← {0, 1} ,   ss.vk 6= ss.vk ∗ s∗ ∗  a = (PRG(v ) − PRG(w )) · (−1) i − B · ss.vk ,  Find(pk, sk, ct) = d i i i   (pred.pk , pred.msk ) ← PredE.Enc(1λ)   Find-1(pk, sk, ct, s∗) = d0 i i   (cpa.pk , cpa.sk ) ← CPA.Enc(1λ)   i : first index s.t. s∗ = 1, d = b, d0 = b i i   i i i sk = (PredE .KeyGen(pred.msk ,C))  Check(pk, ct, C, d) 6= Check(pk, ct, C, d0) CCA i i

We will show that pb ≤ negl(·) for both b ∈ {0, 1}. To prove this, let us first consider the following event:

 λ  pPRG = Pr ∃ α1, α2 ∈ {0, 1} , i ∈ [n], ss.vk s.t. PRG(α1) = PRG(α2) + ai + B · ss.vk

`out ∗ λ 0 where the probability is over the choice of B ← {0, 1} and vi , wi ← {0, 1} . Then pb ≤ pPRG + pb, where 0 0 pb is like pb, except for an additional condition that ∀γ, δ, PRG(γ) 6= PRG(δ) + ai + B · ss.vk. It is formally defined as the following event’s probability:

 ∃(ct,C) s.t.  λ ` `out  ct = (ss.vk, (c0, (c0,i, c1,i, c2,i)) , σ) HPRG.pp ← HPRG.Setup(1 , 1 ),B ← {0, 1}   ∗ ∗ λ   ss.vk 6= ss.vk vi , wi ← {0, 1} ,  ∗  ∗ si ∗   Find(pk, sk, ct) = d ai = (PRG(vi ) − PRG(wi)) · (−1) − B · ss.vk ,   ∗ 0 λ   Find-1(pk, sk, ct, s ) = d (pred.pki, pred.mski) ← PredE.Enc(1 )   ∗ 0 λ   i : first index s.t. s = 1, di = b, d = b (cpa.pk , cpa.ski) ← CPA.Enc(1 )   i i i   ∀γ, δ, PRG(γ) 6= PRG(δ) + ai + B · ss.vk sk = (PredECCA.KeyGen(pred.mski,C))i  Check(pk, ct, C, d) 6= Check(pk, ct, C, d0)

0 0 Hence, it suffices to show that pPRG ≤ negl(λ), p0 ≤ negl(λ) and p1 ≤ negl(λ).

Claim 5.1. pPRG ≤ negl(λ).

∗ ∗ Proof. We will prove a stronger statement: for all ss.vk ,s and {vi, wi}i∈[n], the following probability is at most n · 2−λ:  ∃ γ, δ ∈ {0, 1}λ, i ∈ [n], ss.vk 6= ss.vk∗ s.t.  Pr s∗ PRG(γ) = PRG(δ) + (PRG(vi) − PRG(wi)) · (−1) i + B · ss.vk where the probability is over the choice of B. Fix any integer i ∈ [n]. Consider the following sets.

S = PRG(x): x ∈ {0, 1}λ −  s∗ λ S = PRG(x) − PRG(y) − (PRG(vi) − PRG(wi)) · (−1) i : x, y ∈ {0, 1} ∗ − si  ∗ Svk = { PRG(x) − PRG(y) − (PRG(vi) − PRG(wi)) · (−1) /(ss.vk − ss.vk ): x, y ∈ {0, 1}λ, ss.vk ∈ {0, 1}`vk }

λ − 2λ − The set S has size at most 2 . As a result, the set S has size at most 2 . Finally, the set Svk has size at most 22λ+`vk . If we choose a uniformly random element from {0, 1}`out ≡ {0, 1}3λ+`vk , then this element falls − −λ in Svk with probability at most 2 . This concludes our proof. 0 Claim 5.2. p0 = 0. 0 Proof. This follows from the definitions of Find, Find-1 and p0. Note that Find sets di = 0 only if the decrypted value 1|vi satisfies PRG(vi) = c2,i, and Find-1 sets di = 1 only if the decrypted value 1|wi 0 satisfies PRG(wi) + ai + B · ss.vk = c2,i. This, together with the requirement in p0 that ∀ γ, δ, PRG(γ) 6= 0 PRG(δ) + ai + B · ss.vk, implies that p0 = 0. 0 Claim 5.3. Assuming correctness for decryptable ciphertexts , p1 = 0.

25 ∗ 0 0 Proof. Suppose si = 1, di = 1, di = 0, and Check outputs different value for both d and d . Let rei = 0 0 0 0 HPRG.Eval(HPRG.pp, d, i), rei = HPRG.Eval(HPRG.pp, d , i), m ← PredE.Recover(cpa.pki, c1,i, rei), (m , x ) ← 0 0 PredE.Recover(pred.pki, c0,i, rei ). Since Check outputs different values for d and d , it does not output ⊥ for at least one of them in the ith iteration. We will consider two cases. th Case 1: Check does not output ⊥ for d in the i iteration: As a result, m = 1|v, c1,i = CPA.Enc(cpa.pki, m; rei) and PRG(v) + ai + B · ss.vk = c2,i. This means that CPA.Dec(ski, c1,i) = 1|v (by perfect correctness of 0 the PKE decryption algorithm). However, this means di = 1 (by definition of Find-1). Hence Case 1 cannot occur. 0 th Case 2: Check does not output ⊥ for d in the i iteration: As a result, m = 1|v, c0,i = PredE.Enc(pred.pki, m, x; rei), C(x) = 1 and PRG(v) = c2,i. This means that PredE.Dec(pred.ski, c0,i) = 1|v (since C(x) = 1 and we have perfect correctness for PredE decryption).However, by definition of Find, di = 0. Hence Case 2 cannot occur.

Lemma 5.4. Assuming PKE is IND-CPA secure, for any PPT adversary A, there exists a negligible function 3 4 negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ).

Proof. The only difference in the two hybrids is with respect to the challenge ciphertext. In H3, the challenger ∗ λ+1 ∗ ∗ sets c1,i to be encryption of 0 for all i ∈ [n] such that si = 0. In H4, the challenger sets c1,i to be encryption ∗ of 1|wi. Note that the decryption queries require cpa.ski only if si = 1. As a result, using the IND-CPA security of PKE, it follows that the two hybrids are computationally indistinguishable. Lemma 5.5. Assuming PredE satisfies Definition 2.1, for any PPT adversary A, there exists a negligible 4 5 function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ). Proof. The proof of this lemma is similar to the proof of the previous lemma (Lemma 5.4). Note that in ∗ hybrids H3,H4 and H5, the challenger does not use the PredE secret key pred.skC,i for decryption if si = 1. As a result, we can use the IND-CPA security of PredE (as defined in Definition 2.1).Strictly speaking, this proof does not require the 1-sided attribute hiding. It suffices if the scheme PredE satisfies ABE security.

To prove this lemma, we will define n + 1 hybrid experiments H4,i for i ∈ [n] ∪ {0}. In hybrid H4,i∗ , all ciphertext components {c0,i}i≤i∗ are prepared as in H5, while all the remaining ones are prepared as in H4. ∗ Note that H4,0 corresponds to H4, while H4,n corresponds to H5. Also, the string s is common for all these ∗ intermediate hybrids, and therefore if si = 0, then the experiments H4,i−1 and H4,i are identical. Suppose there exists a PPT adversary A that can distinguish between H4,i∗−1 and H4,i∗ with advan- tage . We will use A to break the security of the underlying predicate encryption system. The reduc- ∗ ∗ tion algorithm receives public key pk from the PE challenger. It sets pred.pki∗ = pk , and it chooses (pred.pki, pred.mski)i6=i∗ . Next, it receives key generation and decryption queries. For any key generation query C, it receives skC from the challenger; it sets pred.ski∗ = skC , and chooses the remaining by itself. For any decryption query (ct,C), note that the reduction algorithm does not need to query the challenger ∗ for a secret key corresponding to C. If si∗ = 1, then the reduction algorithm uses the PKE secret key ∗ ∗ at the i index (and if si∗ = 0, then H4,i∗−1 and H4,i∗ are identical). On receiving the challenge tuples ∗ ∗ ∗ ∗ λ+1 (m0, x0), (m1, x1), the reduction algorithm chooses β ← {0, 1}. It sends (0 , 1|wi) as the challenge mes- ∗ ∗ sages, and xβ as the challenge attribute, and receives ci∗ . It computes the remaining challenge ciphertext by itself, and sends it to the adversary. The post challenge queries are handled similar to the pre-challenge ones. Finally, the adversary sends its guess, which is forwarded to the challenger.

Lemma 5.6. Assuming correctness for decryptable ciphertexts for PredE and PKE schemes, for any adver- 5 6 sary A, there exists a negligible function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ). Proof. This proof is similar to the proof of Lemma 5.3. In particular, recall that the proof of Lemma 5.3 works for any s∗, s0, and note that Find-2 simply corresponds to Find-1(·, ·, ·, 1n).

26 6 7 Lemma 5.7. advA = advA.

Proof. This follows from the definition of the two hybrids. The only difference between H6 and H7 is that ∗ ∗ the variable names vi and wi are swapped if si = 1. As a result, any adversary has identical advantage in both hybrids.

Lemma 5.8. Assuming HPRG satisfies Definition 3.1, for any PPT adversary A, there exists a negligible 7 8 function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ). 6 7 Proof. Suppose there exists a PPT adversary A such that |advA − advA| = . We will use A to build a PPT reduction algorithm B that breaks the security of HPRG.   ∗  ∗  The reduction algorithm first receives HPRG.pp and r0, ri,b from the challenger. It i∈[n],b∈{0,1} ∗ ∗ ∗ `out  λ chooses {vi , wi},(ss.sk , ss.vk ), sets {ai}, chooses B ← {0, 1} , (pred.pki, pred.mski) ← PredE.Setup(1 ) ,  λ (cpa.pki, cpa.ski) ← CPA.Setup(1 ) and sends (HPRG.pp,B, (ai, pred.pki, cpa.pki)) to A. Next, it receives either decryption queries or key generation queries. Key generation and decryption queries can be han- dled using {pred.mski} and {cpa.ski} (as in H6/H7). For the challenge ciphertext, it chooses β ← {0, 1}, ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ sets c = mb ⊕ r0, computes c0,i = PredE.Enc(pred.pki, 1|vi , xβ; ri,0), c1,i = CPA.Enc(cpa.pki, 1|wi; ri,1), ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗  c2,i = PRG(vi ) = PRG(wi ) + ai + B · ss.vk and finally computes a signature on c , c0,i, c1,i, c2,i . It sends the ciphertext to the adversary. The post-challenge queries are handled as the pre-challenge queries. 0 0 ∗ Finally, the adversary sends its guess β . If β 6= β , the reduction algorithm guesses that all ri,b are uniformly random. This reduction algorithm has advantage  in the hinting PRG security game. Lemma 5.9. Assuming PredE satisfies Definition 2.1, for any PPT adversary A, there exists a negligible 8 9 function negl(·) such that for all λ ∈ N, |advA − advA| ≤ negl(λ).

Proof. Using the security of PredE, we can argue that any PPT adversary has nearly same advantage in H8 and H9.

9 Lemma 5.10. For any adversary A, advA = 0. ∗ Proof. Note that in hybrid H9, there is no information about mβ in the challenge ciphertext, since c is  ∗ ∗ uniformly random and the c0,i components are encryptions to attribute x0. Hence, there is no information about β in the challenge ciphertext, and any adversary has zero advantage in H9.

5.2 Proving Security of Attribute-Based Encryption Systems We remark that our above proof technique will apply to an Attribute-Based Encryption system that does not guarantee hiding of the attribute string x (i.e. is not a one-sided predicate encryption system.) Recall, that the IND-CPA and IND-CCA functionality and security definitions of ABE correspond exactly to those of one-sided PE of Section 2 with the exception that in the challenge ciphertext attributes given by the ∗ ∗ attacker we have x0 = x1. We observe none of the steps in the above proof use the fact that the scheme is one-sided PE, except ∗ ∗ for the last step that changes the c0,i ciphertext from encrypting under the attribute xβ to x0. In an ABE ∗ ∗ chosen ciphertext security game, this last step in unnecessary since we already have xβ = x0 by fiat.

27 Acknowledgements

We thank for fruitful discussions. And we thank Rishab Goyal for pointing out the simple argument for separating hinting security from standard security in PRGs.

References

[ALdP11] Nuttapong Attrapadung, BenoˆıtLibert, and Elie de Panafieu. Expressive key-policy attribute- based encryption with constant-size ciphertexts. In Public Key Cryptography - PKC 2011 - 14th International Conference on Practice and Theory in Public Key Cryptography, Taormina, Italy, March 6-9, 2011. Proceedings, pages 90–108, 2011. [Att14] Nuttapong Attrapadung. Dual system encryption via doubly selective security: Framework, fully secure functional encryption for regular languages, and more. In Advances in Cryptology - EUROCRYPT 2014 - 33rd Annual International Conference on the Theory and Applications of Cryptographic Techniques, Copenhagen, Denmark, May 11-15, 2014. Proceedings, pages 557– 577, 2014. [BFM88] Manuel Blum, Paul Feldman, and Silvio Micali. Non-interactive zero-knowledge and its appli- cations. In STOC, pages 103–112, 1988. [BGG+14] , Craig Gentry, Sergey Gorbunov, , Valeria Nikolaenko, Gil Segev, Vinod Vaikuntanathan, and Dhinakaran Vinayagamurthy. Fully key-homomorphic encryption, arith- metic circuit ABE and compact garbled circuits. In Advances in Cryptology - EUROCRYPT 2014 - 33rd Annual International Conference on the Theory and Applications of Cryptographic Techniques, Copenhagen, Denmark, May 11-15, 2014. Proceedings, pages 533–556, 2014. [BL16] Johannes Bl¨omerand Gennadij Liske. Construction of fully cca-secure predicate encryptions from pair encoding schemes. In Topics in Cryptology - CT-RSA 2016 - The Cryptographers’ Track at the RSA Conference 2016, San Francisco, CA, USA, February 29 - March 4, 2016, Proceedings, pages 431–447, 2016. [BLSV18] Zvika Brakerski, Alex Lombardi, Gil Segev, and Vinod Vaikuntanathan. Anonymous ibe, leakage resilience and circular security from new assumptions. In Advances in Cryptology - EUROCRYPT 2018 - 37th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Tel Aviv, Israel, April 29 - May 3, 2018 Proceedings, Part I, pages 535–564, 2018. [BR93] Mihir Bellare and Phillip Rogaway. Random oracles are practical: A paradigm for designing efficient protocols. In ACM Conference on Computer and Communications Security, pages 62– 73, 1993. [BW07] Dan Boneh and Brent Waters. Conjunctive, subset, and range queries on encrypted data. In Proceedings of the 4th conference on Theory of cryptography, TCC’07, pages 535–554, Berlin, Heidelberg, 2007. Springer-Verlag. [CC09] Melissa Chase and Sherman S. M. Chow. Improving privacy and security in multi-authority attribute-based encryption. In ACM Conference on Computer and Communications Security, pages 121–130, 2009. [CGW15] Jie Chen, Romain Gay, and Hoeteck Wee. Improved dual system ABE in prime-order groups via predicate encodings. In Advances in Cryptology - EUROCRYPT 2015 - 34th Annual Interna- tional Conference on the Theory and Applications of Cryptographic Techniques, Sofia, Bulgaria, April 26-30, 2015, Proceedings, Part II, pages 595–624, 2015. [Cha07] Melissa Chase. Multi-authority attribute based encryption. In TCC, pages 515–534, 2007.

28 [CHK04] Ran Canetti, Shai Halevi, and Jonathan Katz. Chosen-ciphertext security from Identity Based Encryption. In EUROCRYPT ’04, volume 3027 of LNCS, pages 207–222, 2004. [DDN91] Danny Dolev, Cynthia Dwork, and Moni Naor. Non-malleable cryptography (extended abstract). In Proceedings of the 23rd Annual ACM Symposium on Theory of Computing, May 5-8, 1991, New Orleans, Louisiana, USA, pages 542–552, 1991.

[DG17a] Nico D¨ottling and Sanjam Garg. Identity-based encryption from the diffie-hellman assumption. In Advances in Cryptology - CRYPTO 2017 - 37th Annual International Cryptology Conference, Santa Barbara, CA, USA, August 20-24, 2017, Proceedings, Part I, pages 537–569, 2017. [DG17b] Nico Dttling and Sanjam Garg. From selective ibe to full ibe and selective hibe. TCC, 2017.

[DGHM18] Nico D¨ottling, Sanjam Garg, Mohammad Hajiabadi, and Daniel Masny. New constructions of identity-based and key-dependent message secure encryption schemes. In Public-Key Cryptog- raphy - PKC 2018 - 21st IACR International Conference on Practice and Theory of Public-Key Cryptography, Rio de Janeiro, Brazil, March 25-29, 2018, Proceedings, Part I, pages 3–31, 2018. [DNR04] Cynthia Dwork, Moni Naor, and . Immunizing encryption schemes from decryp- tion errors. In Advances in Cryptology - EUROCRYPT 2004, International Conference on the Theory and Applications of Cryptographic Techniques, Interlaken, Switzerland, May 2-6, 2004, Proceedings, pages 342–360, 2004. [FN94] Amos Fiat and Moni Naor. Broadcast encryption. In Proceedings of the 13th Annual Interna- tional Cryptology Conference on Advances in Cryptology, CRYPTO ’93, pages 480–491, 1994.

[FO99] Eiichiro Fujisaki and Tatsuaki Okamoto. Secure integration of asymmetric and symmetric en- cryption schemes. In CRYPTO ’99, volume 1666 of LNCS, pages 537–554. Springer, 1999. [FS90] Uriel Feige and Adi Shamir. Witness indistinguishable and witness hiding protocols. In Proceed- ings of the 22nd Annual ACM Symposium on Theory of Computing, May 13-17, 1990, Baltimore, Maryland, USA, pages 416–426, 1990. [GGH18] Sanjam Garg, Romain Gay, and Mohammad Hajiabadi. New techniques for efficient trap- door functions and applications. Cryptology ePrint Archive, Report 2018/872, 2018. https: //eprint.iacr.org/2018/872. [GH18] Sanjam Garg and Mohammad Hajiabadi. Trapdoor functions from the computational diffie- hellman assumption. In Advances in Cryptology - CRYPTO 2018 - 38th Annual International Cryptology Conference, Santa Barbara, CA, USA, August 19-23, 2018, Proceedings, Part II, pages 362–391, 2018. [GKW17] Rishab Goyal, Venkata Koppula, and Brent Waters. Lockable obfuscation. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, pages 612–621, 2017.

[GPSW06] Vipul Goyal, Omkant Pandey, Amit Sahai, and Brent Waters. Attribute-based encryption for fine-grained access control of encrypted data. In Proceedings of the 13th ACM conference on Computer and communications security, CCS ’06, 2006. [GVW13] Sergey Gorbunov, Vinod Vaikuntanathan, and Hoeteck Wee. Attribute-based encryption for circuits. In STOC, 2013.

[GVW15] Sergey Gorbunov, Vinod Vaikuntanathan, and Hoeteck Wee. Predicate encryption for circuits from lwe. In Annual Cryptology Conference, 2015.

29 [KSW08] Jonathan Katz, Amit Sahai, and Brent Waters. Predicate encryption supporting disjunctions, polynomial equations, and inner products. In Proceedings of the theory and applications of cryptographic techniques 27th annual international conference on Advances in cryptology, EU- ROCRYPT’08, 2008. [LOS+10] Allison B. Lewko, Tatsuaki Okamoto, Amit Sahai, Katsuyuki Takashima, and Brent Waters. Fully secure functional encryption: Attribute-based encryption and (hierarchical) inner product encryption. In EUROCRYPT, pages 62–91, 2010. [LW11] Allison B. Lewko and Brent Waters. Decentralizing attribute-based encryption. In EURO- CRYPT, pages 568–588, 2011.

[LW12] Allison B. Lewko and Brent Waters. New proof methods for attribute-based encryption: Achiev- ing full security through selective techniques. In Advances in Cryptology - CRYPTO 2012 - 32nd Annual Cryptology Conference, Santa Barbara, CA, USA, August 19-23, 2012. Proceed- ings, pages 180–198, 2012. [Nao89] Moni Naor. Bit commitment using pseudo-randomness. In Advances in Cryptology - CRYPTO ’89, 9th Annual International Cryptology Conference, Santa Barbara, California, USA, August 20-24, 1989, Proceedings, pages 128–136, 1989. [NP15] Mridul Nandi and Tapas Pandit. Generic conversions from cpa to cca secure functional encryp- tion. Cryptology ePrint Archive, Report 2015/457, 2015. https://eprint.iacr.org/2015/457. [NY90] Moni Naor and Moti Yung. Public-key cryptosystems provably secure against chosen ciphertext attacks. In Proceedings of the 22nd Annual ACM Symposium on Theory of Computing, May 13-17, 1990, Baltimore, Maryland, USA, pages 427–437, 1990. [OT10] Tatsuaki Okamoto and Katsuyuki Takashima. Fully secure functional encryption with general relations from the decisional linear assumption. In CRYPTO, pages 191–208, 2010. [PS19] Chris Peikert and Sina Shiehian. Noninteractive zero knowledge for np from (plain) learning with errors. Cryptology ePrint Archive, Report 2019/158, 2019. https://eprint.iacr.org/ 2019/158. [PW08] Chris Peikert and Brent Waters. Lossy trapdoor functions and their applications. In Proceedings of the 40th Annual ACM Symposium on Theory of Computing, Victoria, British Columbia, Canada, May 17-20, 2008, pages 187–196, 2008.

[Reg05] Oded Regev. On lattices, learning with errors, random linear codes, and cryptography. In Proceedings of the 37th Annual ACM Symposium on Theory of Computing, Baltimore, MD, USA, May 22-24, 2005, pages 84–93, 2005. [RS91] Charles Rackoff and Daniel R. Simon. Non-interactive zero-knowledge proof of knowledge and chosen ciphertext attack. In Advances in Cryptology - CRYPTO ’91, 11th Annual International Cryptology Conference, Santa Barbara, California, USA, August 11-15, 1991, Proceedings, pages 433–444, 1991. [RS10] Alon Rosen and Gil Segev. Chosen-ciphertext security via correlated products. SIAM J. Com- put., 39(7):3058–3088, 2010.

[Sho98] Victor Shoup. Why chosen ciphertext security matters, 1998. [SW05] Amit Sahai and Brent Waters. Fuzzy identity-based encryption. In EUROCRYPT, pages 457– 473, 2005.

30 [Wat09] Brent Waters. Dual system encryption: Realizing fully secure ibe and hibe under simple as- sumptions. In CRYPTO, pages 619–636, 2009. [Wee14] Hoeteck Wee. Dual system encryption via predicate encodings. In Theory of Cryptography - 11th Theory of Cryptography Conference, TCC 2014, San Diego, CA, USA, February 24-26, 2014. Proceedings, pages 616–637, 2014. [WZ17] Daniel Wichs and Giorgos Zirdelis. Obfuscating compute-and-compare programs under LWE. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, pages 600–611, 2017. [YAHK11] Shota Yamada, Nuttapong Attrapadung, Goichiro Hanaoka, and Noboru Kunihiro. Generic con- structions for chosen-ciphertext secure attribute based encryption. In Public Key Cryptography - PKC 2011 - 14th International Conference on Practice and Theory in Public Key Cryptography, Taormina, Italy, March 6-9, 2011. Proceedings, pages 71–89, 2011.

A Constructions of Hinting PRG A.1 Construction Based on the CDH Assumption A.1.1 Computational Diffie Hellman Assumption Assumption 1. Let G be any group of prime order p. The Computational Diffie-Hellman (CDH) assumption holds on G if for any PPT adversary A, there exists a negligible function negl(·) such that for all λ ∈ N, the following probability is at most negl(λ):

ab a b Pr[g ← A(g, g , g ): g ← G, a, b ← Zp]

A.1.2 Construction We will now describe our CDH based hinting PRG scheme. Setup(1λ, 1`): The setup algorithm chooses a prime p of λ bits. Next, it sets n = log p + 2λ. It then chooses

a group G of size p. Next, it chooses 2 · n uniformly random group elements {gi,b ← G}i∈[n],b∈{0,1}, 2 · (n + 1) · ` uniformly random integers {ρi,j,b ← Zp}i∈[n]∪{0},j∈[`],b∈{0,1}. For each i ∈ [n], j ∈ [`], b ∈ {0, 1}, it sets a 2 × n matrix Hi,j,b as follows: ( ⊥ if (k, β) = (i, b) ∀(β, k) ∈ {0, 1} × [n], Hi,j,b[β, k] = ρi,j,b gk,β otherwise

Similarly, for each j ∈ [`], it sets H0,j as follows:

ρ0,j,0 ∀(β, k) ∈ {0, 1} × [n], H0,j[β, k] = gk,β

 ` Finally, it chooses the randomness for hardcore bit extraction. It chooses r0,j ← {0, 1}hcb j∈[`] and    `hcb ri,j,b ← {0, 1} i∈[n],j∈[`],b∈{0,1}. The setup algorithm sets pp = {H0,j, r0,j}j∈[`] , {Hi,j,b, ri,j,b}i∈[n],j∈[`],b∈{0,1} .   Eval(pp, s, i): Let pp = {H0,j, r0,j}j∈[`] , {Hi,j,b, ri,j,b}i∈[n],j∈[`],b∈{0,1} . If i 6= 0, the evaluation algorithm Qn does the following: For each j ∈ [`], the evaluation algorithm sets zj = hcb ( k=1 Hi,j,si [sk, k]; ri,j,si ) and outputs z = z1z2 . . . z`. Qn If i = 0, the evaluation algorithm does the following: For each j ∈ [`], it sets zj = hcb ( k=1 H0,j[sk, k]; r0,j) and outputs z = z1z2 . . . z`.

31 A.1.3 Proof of Security To prove security, we will first present a sequence of hybrid experiments, and then show that the hybrid experiments are computationally indistinguishable.

Hybrid H0 : This is the original security game. The challenger chooses a uniformly random string n   s ← {0, 1} , chooses {gi,b}i,b, {ρi,j,b}i,j,b, sets public parameters pp = {H0,j}j , {Hi,j,b}i,j,b as in the ` construction. Next, it sets y0 = Eval(pp, s, 0), yi,s = Eval(pp, s, i) and yi,s ← {0, 1} . It outputs pp,  i i y0, (yi,0, yi,1)i .

0 0 Next, we define n · ` hybrid experiments H1,i,j for i ∈ [n], j ∈ [`]. For any tuples (i, j) and (i , j ), we say 0 0 0 0 0 that (i, j)  (i , j ) if either i < i or (i = i and j ≤ j ). Also, let H0 ≡ H1,1,0 and H1,i,` ≡ H1,i+1,0.

∗ ∗ Hybrid H1,i ,j : In this hybrid, the challenger does not choose all {yi,si }i uniformly at random. Instead,  ρ  for all (i, j)  (i∗, j∗), it sets the jth bit of y to be hcb Qn g k,j,si ; r . For all j > j∗, the jth bit i,si k=1 k,sk i,j,si ∗ ∗ of yi ,si∗ are chosen uniformly at random. For all i > i , the string yi,si is chosen uniformly at random from {0, 1}`.

Hybrid H2 : This hybrid is identical to H1,n,`, except for syntactic changes. The challenger chooses n {gi,b ← G}i,b, {ρi,j,b}i,j,b and sets pp as in the previous hybrid. Next, it chooses s ← {0, 1} and computes Qn th ρ0,j,0 h = k=1 gi,si . It then uses h to compute y0 and {yi}i. It sets the j bit of y0 as hcb (h ; r0,j), and the th ρ j bit of yi,b as hcb (h i,j,b ; ri,j,b).

Hybrid H3 : This hybrid is similar to the previous one, except that the challenger chooses h ← G.

∗ Next, we consider ` hybrid experiments H4,j∗ for j ∈ [`], where we switch each bit of y0 to be uniformly random. Let H4,0 ≡ H3.

∗ Hybrid H4,j∗ : This hybrid is similar to H3, except that some bits of y0 are uniformly random. For j ≤ j , th ∗ th the challenger chooses the j bit of y0 uniformly at random. For all j > j , the j bit of y0 is computed ρ0,j,0 as hcb (h ; r0,j).

∗ ∗ ∗ ∗ Next, we define ` · n hybrid experiments H5,i∗,j∗ for each i ∈ [n], j ∈ [`]. For each (i, j)  (i , j ), we th switch the j bit of yi,0 and yi,1 to be uniformly random.

∗ ∗ th Hybrid H5,i∗,j∗ : In this experiment, for all (i, j)  (i , j ), the challenger sets the j bit of yi,0 and yi,1 th ρ to be a uniformly random bit. For all other (i, j), it sets the j bit of yi,b to be hcb (h i,j,b ; ri,j,b).

Analysis We need to show that the hybrids H0 and H5,n,` are computationally indistinguishable. Let A advx denote the advantage of an adversary A in hybrid Hx.

First, we will show that the hybrids H1,i,j are computationally indistinguishable for all i ∈ [n], j ∈ [`]. Lemma A.1. Assuming CDH is hard on G, for any PPT adversary A and indices i∗ ∈ [n], j∗ ∈ [`], there A A exists a negligible function negl(·) such that for all λ ∈ N, |adv1,i∗,j∗ − adv1,i∗,j∗−1| ≤ negl(λ).

A A Proof. Suppose there exists a PPT adversary A such that |adv1,i∗,j∗ − adv1,i∗,j∗−1| ≥ . Using A, one can build a PPT algorithm B that can distinguish between the following distributions with advantage :

32  a a `hcb Dist1 = (g, g , h, hcb(h ; r), r): g, h ← G, a ← Zp, r ← {0, 1}

 a `hcb Dist2 = (g, g , h, β, r): g, h ← G, a ← Zp, r ← {0, 1} , β ← {0, 1}

n The algorithm B receives (g, g1, g2, b, r) from the challenger. It chooses s ← {0, 1} , {ai,b ← p} ∗ Z (i,b)6=(i ,si∗ ) a ∗ ∗ ∗ and sets gi,b = g i,b for all (i, b) 6= (i , si∗ ). Next, it chooses ρi,j,b ← Zp and ri,j,b for all (i, j, b) 6= (i , j , si∗ ).   ∗ ∗ ∗ Q ∗ ∗ It sets ri ,j ,si∗ = r and sets gi ,si∗ = g1/ k6=i∗ gk,sk . It implicitly sets ρi ,j ,si∗ to be the discrete log of g2 with respect to g. ρi,j,b Using g, g1, g2, {ai,b} ∗ and {ρi,j,b} ∗ ∗ , the reduction algorithm can compute g (i,b)6=(i ,si∗ ) (i,j,b)6=(i ,j ,si∗ ) k,β ∗ ∗ ∗ ∗ i,j,b ρi,j,b ∗ ∗ for all (k, β, i, j, b) 6= (i , si∗ , i , j , si∗ ). If (k, β) = (i , si∗ ), it sets gk,β = g1 . If (i, j, b) = (i , j , si∗ ), i,j,b ak,β ∗ ∗ ∗ ∗ it sets gk,β = g2 . Since Hi ,j ,si∗ [si , i ] =⊥, the reduction algorithm can compute the entire public

parameters. As a result, the reduction algorithm can also compute yk,sk (for all k) using pp. For (i, j)  ∗ ∗ th ∗ ∗ (i , j ), B can compute the j bit of yi,si using ρi,j,si . For the j bit of yi ,si∗ , B uses the challenge bit b. ∗ ∗ All other bits of yi ,si∗ are chosen uniformly at random, and for all i > i , it sets yi,si to be a uniformly random ` bit string. Finally, it sends the yi,b strings to the adversary, and forwards the adversary’s guess to the challenger. a Clearly, if b is a uniformly random bit, then the adversary’s view is same as in H1,i∗,j∗−1. If g1 = g and a ∗ ρi∗,j∗,s ∗ a ∗ Q i b = hcb(h ; r), then the j bit of yi ,si∗ is hcb (( k gk,sk ) ), which is equal to hcb (h ). Hence, the adversary’s view is same as in H1,i∗,j∗ .

Finally, using the hardcore-bit’s property, if there exists a PPT algorithm B that can distinguish between 0 Dist1 and Dist2 with non-negligible advantage, then there exists another PPT algorithm B that can compute ha with non-negligible probability. This algorithm B0 can be used to break the CDH assumption on G.

A A Observation 1. For any adversary A, adv1,n,` = adv2 . Proof. The proof of this observation follows directly from the definition of the hybrid experiments.

Lemma A.2. For any adversary A, there exists a negligible function negl(·) such that for all λ ∈ N, A A |adv2 − adv3 | ≤ negl(λ). Proof. The proof of this lemma follows from the Leftover Hash Lemma. Since we set n = log p + 2λ, the following distributions have statistical distance at most 2−λ: ( ) n X Dist1 = {ab,i}b∈{0,1},i∈[n] , a : ab,i ← Zp, s ← {0, 1} , a = asi,i i n o Dist2 = {ab,i}b∈{0,1},i∈[n] , a : ab,i ← Zp, a ← Zp

ai Q Let g be any generator of G. Then, by setting gi,si = g , h = i gi,si is statistically indistinguishable from a g , even if g and {ai}i are given. This concludes our proof. Lemma A.3. Assuming CDH is hard on G, for any PPT adversary A and indices j∗ ∈ [`], there exists a A A negligible function negl(·) such that for all λ ∈ N, |adv4,j∗ − adv4,j∗−1| ≤ negl(λ). Proof. As in the proof of Lemma A.1, we will use such a PPT adversary A to build a PPT algorithm B that can distinguish between Dist1 and Dist2 (defined in proof of Lemma A.1). The reduction algorithm receives challenge (g, g1, g2, b, r). It sets h = g1, implicitly sets ρ0,j∗,0 to be the discrete log of g2 with respect to g. It a ai,b k,β chooses {ai,b}i,b, sets gi,b = g for all i, b. Next, it chooses {ρi,j,b}(i,j,b)6=(0,j∗,0), and sets H0,j∗ [β, k] = g2 ∗ for all (k, β). For all j 6= j , it sets H0,j using g and {ai,b}i,b. Finally, the reduction algorithm sets r0,j∗ = r, ∗ and all other components of the public parameters are chosen honestly. The j bit of y0 is set to be b; for

33 ∗ j < j , the bits are computed using g1 and ρ0,j. The advantage of B in distinguishing Dist1 and Dist2 is 0 same as the difference of A s advantage in H4,j∗ and H4,j∗−1. Once we have such a PPT algorithm B, it can be used to break the CDH assumption, using the hardcore-bit property. Lemma A.4. Assuming CDH is hard on G, for any PPT adversary A and indices i∗ ∈ [`], j∗ ∈ [`], there A A exists a negligible function negl(·) such that for all λ ∈ N, |adv5,i∗,j∗ − adv5,i∗,j∗−1| ≤ negl(λ). Proof. The proof of this lemma is similar to the proof of Lemma A.3.

A.2 Construction Based on the LWE Assumption A.2.1 Learning with Errors Assumption The Learning with Errors (LWE) problem was introduced by Regev [Reg05], who showed that solving LWE on average is as hard as quantumly solving several standard lattice based problems in the worst case. The LWE assumption states that no polynomial time adversary can distinguish between the following oracles. In one case, the oracle chooses a uniformly random secret s, and for each query, it chooses a vector a uniformly at random, scalar e from a noise distribution and outputs (a, sT ·a+e). In the second case, the oracle simply outputs a uniformly random vector a together with a uniformly random scalar u. Regev showed that if there exists a polynomial time adversary that can break the LWE assumption, then there exists a polynomial time quantum algorithm that can solve some hard lattice problems in the worst case. We will use a variant of the LWE assumption, where the challenger outputs some LWE samples, followed by a challenge, which is either an LWE sample or a uniformly random element. This version is as hard as the standard version.

Assumption 2 (Learning with Errors). Let n and q be positive integers and χ a noise distribution over Zq. The Learning with Errors assumption LWEn,q,χ, parameterized by n, q, χ, states that for any polynomial N, the following distributions are computationally indistinguishable:  n   ai ← Zq for each i ∈ [N],   T T a, s ← n, (ai, s · ai + ei) i , (a, s · a + e): Zq  e, ei ← χ for each i ∈ [N]  ≈c  n   ai ← Zq for each i ∈ [N],   T a, s ← n, r ← (ai, s · ai + ei) i , (a, r): Zq Zq  e, ei ← χ for each i ∈ [N] 

A.2.2 Construction We will now describe our LWE based hinting PRG scheme.

 Setup(1λ, 1`): The setup algorithm chooses LWE dimension d, modulus p = 2d , noise parameter σ = poly(λ), noise distribution χ = Dσ and n = d · log p + 2λ . It then chooses 2 · n uniformly random vectors a ← d , 2·(n+1)·` uniformly random vectors v ← d . i,b Zp i∈[n],b∈{0,1} i,j,b Zp i∈[n]∪{0},j∈[`],b∈{0,1} k,β For each i ∈ [n], j ∈ [`], b ∈ {0, 1}, it chooses ei,j,b ← χ for each i, k ∈ [n], j ∈ [`], b, β ∈ {0, 1}, sets a 2 × n matrix Hi,j,b as follows: ( ⊥ if (k, β) = (i, b) ∀(β, k) ∈ {0, 1} × [n], Hi,j,b[β, k] = T k,β ak,β · vi,j,b + ei,j,b otherwise

k,β Similarly, it chooses ej ← χ for each j ∈ [`], k ∈ [n], b, β ∈ {0, 1}. For each j ∈ [`], it sets H0,j as follows: T k,β ∀(β, k) ∈ {0, 1} × [n], H0,j[β, k] = ak,β · v0,j,0 + ej   The setup algorithm sets pp = {H0,j}j∈[`] , {Hi,j,b}i∈[n],j∈[`],b∈{0,1} .

34   Eval(pp, s, i): Let pp = {H0,j}j∈[`] , {Hi,j,b}i∈[n],j∈[`],b∈{0,1} . If i 6= 0, the evaluation algorithm does the Pn following: For each j ∈ [`], the evaluation algorithm sets zj = msb ( k=1 Hi,j,si [sk, k]) and outputs z = z1z2 . . . z`. Pn If i = 0, the evaluation algorithm does the following: For each j ∈ [`], it sets zj = msb ( k=1 H0,j[sk, k]) and outputs z = z1z2 . . . z`.

A.2.3 Proof of Security To prove security, we will first present a sequence of hybrid experiments, and then show that the hybrid experiments are computationally indistinguishable.

Hybrid H0 : This is the original security game. The challenger chooses a uniformly random string n   s ← {0, 1} , chooses {ai,b}i,b, {vi,j,b}i,j,b, sets public parameters pp = {H0,j}j , {Hi,j,b}i,j,b as in the ` construction. Next, it sets y0 = Eval(pp, s, 0), yi,s = Eval(pp, s, i) and yi,s ← {0, 1} . It outputs pp,  i i y0, (yi,0, yi,1)i .

0 0 Next, we define n · ` hybrid experiments H1,i,j for i ∈ [n], j ∈ [`]. For any tuples (i, j) and (i , j ), we say 0 0 0 0 0 that (i, j)  (i , j ) if either i < i or (i = i and j ≤ j ). Also, let H0 ≡ H1,1,0 and H1,i,` ≡ H1,i+1,0.

Hybrid H1,i∗,j∗ : In this hybrid, the challenger does not choose all {yi,s } uniformly at random. Instead,   i i  for all (i, j)  (i∗, j∗), it sets the jth bit of y to be msb Pn aT · v + ek,sk . For all j > j∗, i,si k=1 k,sk i,j,si i,j,si th ∗ ∗ the j bit of yi ,si∗ are chosen uniformly at random. For all i > i , the string yi,si is chosen uniformly at random from {0, 1}`.

Hybrid H2 : This hybrid is similar to H1,n,`, except for the manner in which the yi,b strings are computed. Let χ0 be the distribution obtained by adding n samples from the χ distribution. The challenger chooses a ← d , {v } and sets pp as in H . Next, it chooses s ← {0, 1}n and computes a = i,b Zp i,b i,j,b i,j,b 1,n,` Pn th T  k=1 ai,si . It then uses a to compute y0 and {yi,b}i. It sets the j bit of y0 as msb a · v0,j,0 + e0,j , th T  0 and the j bit of yi,b as msb a · vi,j,b + ei,j,b , where all the {e0,j}j and {ei,j,b}i,j,b are chosen from χ distribution.

d Hybrid H3 : This hybrid is similar to the previous one, except that the challenger chooses a ← Zp.

∗ Next, we consider ` hybrid experiments H4,j∗ for j ∈ [`], where we switch each bit of y0 to be uniformly random. Let H4,0 ≡ H0.

∗ Hybrid H4,j∗ : This hybrid is similar to H3, except that some bits of y0 are uniformly random. For j ≤ j , th ∗ th the challenger chooses the j bit of y0 uniformly at random. For all j > j , the j bit of y0 is computed T  as msb a · v0,j,0 + e0,j .

∗ ∗ ∗ ∗ Next, we define ` · n hybrid experiments H5,i∗,j∗ for each i ∈ [n], j ∈ [`]. For each (i, j)  (i , j ), we th switch the j bit of yi,0 and yi,1 to be uniformly random.

∗ ∗ th Hybrid H5,i∗,j∗ : In this experiment, for all (i, j)  (i , j ), the challenger sets the j bit of yi,0 and yi,1 th T  to be a uniformly random bit. For all other (i, j), it sets the j bit of yi,b to be msb a · vi,j,b + ei,j,b .

35 Analysis We need to show that the hybrids H0 and H5,n,` are computationally indistinguishable. Let A advx denote the advantage of an adversary A in hybrid Hx, and let H1,1,0 ≡ H0, H1,i,0 ≡ H1,i−1,`.

First, we will show that the hybrids H1,i,j are computationally indistinguishable for all i ∈ [n], j ∈ [`]. ∗ ∗ Lemma A.5. Assuming LWEp,d,χ is hard, for any PPT adversary A and indices i ∈ [n], j ∈ [`], there A A exists a negligible function negl(·) such that for all λ ∈ N, |adv1,i∗,j∗ − adv1,i∗,j∗−1| ≤ negl(λ). A A Proof. Suppose there exists an adversary A such that adv1,i∗,j∗ − adv1,i∗,j∗−1 = . We will show a PPT algorithm B that breaks LWEp,d,χ with advantage . n The reduction algorithm chooses s ← {0, 1} and vectors {vi,j,b} ∗ ∗ . It queries the LWE (i,j,b)6=(i ,j ,si∗ ) ∗ ∗ challenger for 2n−1 queries and one challenge, and receives {(ak,β, hk,β)} where ai ,si∗ , hi ,si∗ is the challenge ∗ ∗ tuple and the remaining are LWE samples. The reduction algorithm sets Hi ,j ,si∗ [β, k] = hk,β if (k, β) 6= ∗ (i , si∗ ), and ⊥ otherwise. The remaining matrices {Hi,j,b} ∗ ∗ and {H0,j} are computed using (i,j,b)6=(i ,j ,si∗ ) j {ai,b} and {vi,j,b} ∗ ∗ . This completes the public parameters. (i,j,b)6=(i ,j ,si∗ ) For the evaluations, the reduction algorithm computes y0, all {yi,b} ∗ as in hybrids H1,i∗,j∗−1/H1,i∗,j∗ . (i,b)6=(i ,si∗ ) th th ∗ It also computes all bits of yi ,si∗ , except the j one. For the j bit, the reduction algorithm computes   0 P ∗ ∗ ∗ ∗ msb k6=i Hi ,j ,si∗ [sk, k] + hi ,j ,si∗ . The adversary A sends its guess b , and B forwards the same to the LWE challenger.

∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ If (ai ,j ,si∗ , hi ,j ,si∗ ) form an LWE sample, then this hybrid corresponds to H1,i ,j . If hi ,j ,si∗ is truly random, then this corresponds to H1,i∗,j∗−1. Therefore, B can break LWEp,d,χ with advantage .

Lemma A.6. For any adversary A, there exists a negligible function negl(·) such that for all λ ∈ N, A A |adv1,n,` − adv2 | ≤ negl(λ). th Pn Proof. In hybrid H1,n,`, for each i ∈ [n], j ∈ [`], b ∈ {0, 1}, the j bit of yi,s is set to be msb ( Hi,j,s [sk, k]),   i k=1 i and the jth bit of y is msb Pn aT · v + ek,sk . In hybrid H , the jth bit of y is set to be i,si k=1 k,sk i,j,b i,j,b 2 i,b T  0 msb a · vi,j,b + ei,j,b for all (i, j, b) ∈ [n] × [`] × {0, 1} (where ei,j,b is chosen from χ ). Clearly, the distri- butions are identical for {yi,si }i, even given pp. To show that the two hybrids are statistically indistinguishable, it suffices to argue that the statistical distance between the following distributions is negligible in λ:

  a , v ← d, ek,β ← χ   i,b i,j,b Zp i,j,b  Dist = {H } , {z } : T k,β 1 i,j,b i,j,b i,j i,j Hi,j,b[β, k] = ak,β · vi,j,b + ei,j,b  P   zi,j = msb ( k Hi,j,si [sk, k])   a , v ← d, ek,β ← χ, e ← χ0   i,b i,j,b Zp i,j,b i,j    T k,β  Hi,j,b[β, k] = a · vi,j,b + e Dist2 = {Hi,j,b}i,j,b , {zi,j}i,j : k,β i,j,b   P T    zi,j = msb ( k ak,sk ) · vi,j,si + ei,j 

√ √ k,β 0 k,β Since ei,j,b ← χ and ei,j ← χ , with all but negligible probability, |ei,j,b| ≤ d · σ, and |ei,j| ≤ d · σ · n. √With overwhelming probability√ (over the choice of {ai,b} and {vi,j,b}), all the |ak,β · vi,j,b| values are at least d·σ ·n and most p/2− d·σ ·n. This is because p is exponential in λ while σ is poly(λ). Hence, conditioned on these two events, !  !T  X X msb aT · v + ek,sk = msb a · v + e k,sk i,j,si i,j,si  k,sk i,j,si i,j k k

36 Lemma A.7. For any adversary A, there exists a negligible function negl(·) such that for all λ ∈ N, A A |adv2 − adv3 | ≤ negl(λ). Proof. The proof of this lemma follows from the Leftover Hash Lemma. Since we set n = d · log p + 2λ, the following distributions have statistical distance at most 2−λ: ( ) d n X Dist1 = {ab,i}b∈{0,1},i∈[n] , a : ab,i ← Zp, s ← {0, 1} , a = asi,i i

n d do Dist2 = {ab,i}b∈{0,1},i∈[n] , a : ab,i ← Zp, a ← Zp

∗ Lemma A.8. Assuming LWEp,d,χ0 , for any j ∈ [`], for any PPT adversary A, there exists a negligible A A function negl(·) such that for all λ ∈ N, |adv4,j∗ − adv4,j∗−1| ≤ negl(λ).

A A Proof. Suppose there exists a PPT adversary A such that |adv4,j∗ − adv4,j∗−1| = . We will build a PPT algorithm B that breaks LWEp,d,χ0 with advantage . The reduction algorithm queries for n evaluations followed by a challenge, and receives {ai,b, hi,b}i,b as the LWE evaluations, and (a, h) as the challenge. It sets H0,j∗ [β, k] = hk,β for all (k, β) ∈ [n]×{0, 1}. It chooses ∗ ∗ v0,j,0 for all j 6= j and sets H0,j for all j 6= j as in H4,j∗ /H4,j∗−1. It also chooses {vi,j,b}i>0, and sets {Hi,j,b}i>0. The reduction algorithm computes {yi,b}i>0 as in H4,j∗ /H4,j∗−1 using a and {vi,j,b} vectors. ∗ For y0, it sets the j bit as the LWE challenge h, and the other bits are computed as in H4,j∗ /H4,j∗−1. Finally, the adversary sends its guess, which is forwarded to the LWE challenger. The reduction algorithm B has advantage .

∗ ∗ Lemma A.9. Assuming LWEp,d,χ0 , for any i ∈ [n], j ∈ [`], any PPT adversary A, there exists a negligible A A function negl(·) such that for all λ ∈ N, |adv5,i∗,j∗ − adv5,i∗,j∗−1| ≤ negl(λ). Proof. This proof is similar to the proof of Lemma A.8.

37