# Efficient and HRA Secure Universal Conditional Proxy Re-Encryption for Cloud-Based Data Sharing
## 3 Definition of Universal Conditional Proxy Re-Encryption
### Unidirectional and Multihop UCPRE  
**Definition 3** (UCPRE for Any Homomorphic Encryption: Syntax). : _A universal conditional proxy re-encryption scheme consists of two PPT [gorithms ReKeyGen and ReEnc shown as follows:_  
* _ReKeyGen_ \(\left(1^{\lambda},\Pi_{f},\Pi_{t},\mathbf{sk}_{f},\mathbf{pk}_{f},\mathbf{pk}_{t},\mathbf{ ct}_{f}^{m}\right)\rightarrow(\mathbf{rk}_{f\to t})\)_: It inputs the security parameter_ \(1^{\lambda}\)_, a pair of homomorphic encryption schemes_ \((\Pi_{f},\Pi_{t})\)_, a secret key_ \(\mathbf{sk}_{f}\) _and a public key_ \(\mathbf{pk}_{f}\) _of_ \(\Pi_{f}\)_, a public key_ \(\mathbf{pk}_{t}\) _of_ \(\Pi_{t}\)_, and and a ciphertext_ \(\mathbf{ct}_{f}^{m}\) _under_ \(\mathbf{pk}_{f}\) _of_ \(\Pi_{f}\) _and outputs a re-encryption key_ \(\mathbf{rk}_{f\to t}\)_._
* \(\text{ReEnc}(\Pi_{f},\Pi_{t},\mathbf{pk}_{t},\mathbf{rk}_{t})\rightarrow(\text{rtc})\)_: It inputs a pair of homomorphic encryption schemes_ \((\Pi_{f},\Pi_{t})\)_, a public key_ \(\mathbf{pk}_{t}\) _of_ \(\Pi_{t}\)_, a re-encryption key_ \(\mathbf{rk}_{f\to t}\)_, and outputs a re-encryptedciphertext **ret** (note that the re-encrypted ciphertext ret be equal to the ciphertext \(\textbf{ct}_{t}\) under \(\textbf{pk}_{t}\) of \(\Pi_{t}\). **Definition 4** (UCPRE for Any Homomorphic Encryption: Correctness). : _A UCPRE scheme for any homomorphic encryption is correct if for all pairs of homomorphic encryption schemes \((\Pi_{f},\Pi_{t}),(\textbf{pk}_{f},\textbf{sk}_{f})\leftarrow\Pi_{f}\). \(\text{KeyGen}\big{(}1^{\lambda}\big{)},(\textbf{pk}_{t},\textbf{sk}_{t}) \leftarrow\Pi_{t}\). \(\text{KeyGen}_{t}\big{(}1^{\lambda}\big{)},m\in\mathcal{M}_{f}\cap\mathcal{ M}_{t}\), \(\textbf{ct}_{f}^{m}\leftarrow\Pi_{f}\cdot\text{Enc}\big{(}\text{pk}_{f},m\big{)}\), it holds that_  
\[\Pr\Big{[}\Pi_{t}.\text{Dec}\Big{(}\text{sk}_{t},\text{ReEnc}\Big{(}\Pi_{f}, \Pi_{t},\textbf{pk}_{t},\textbf{rk}_{f\to t}\Big{)}\Big{)}=m\Big{]}=1,\]  
_where \(\textbf{rk}_{f\to t}\leftarrow\text{ReKeyGen}\Big{(}1^{\lambda},\Pi_{f},\Pi_{ t},\textbf{sk}_{f},\textbf{pk}_{f},\textbf{pk}_{t},\textbf{ct}_{f}^{m}\Big{)}\)._  
_Security._ In our UCPRE, we present the indistinguishable secure under honest re-encryption attacks (IND-HRA). This IND-HRA secure for UPRE is based on security against honest re-encryption attacks (HRA) of PRE proposed by [PERSON] [34]. [PERSON] observes that IND-CPA secure for PRE is not sufficient in actual applications. Therefore, we define IND-HRA secure for our UCPRE. **Definition 5** (UCPRE for Homomorphic Encryption: IND-HRA Secure). : _We define an indistinguishable experiment including three phases. The adversary \(\mathcal{A}\) is interactive with the challenger \(\mathcal{C}\) in the following indistinguishable experiment._  
* _Setup Phase_ **1**_: In this phase, the challenger_ \(\mathcal{C}\) _generates all security parameters._
* \(\mathcal{C}\) _initializes a counter_ **numkeys**_:=0, an honest indices set_ **Hon**_:=0, and a corrupted indices set_ **Cor**_:=0, a counter_ **numCt**_:=0, a key-value store_ **Ct**_:=_0, and a set_ **Deriv**_:=_0._
* _For an honest key generation query_ \(i\)_,_ \(\mathcal{C}\) _sets a new pair of keys_ \((\text{pk}_{i},\text{sk}_{i})\leftarrow\Pi_{i}\)_._ \(\text{KeyGen}(1^{\lambda})\) _and shares_ \((\Pi_{i},\text{pk}_{i})\) _to_ \(\mathcal{A}\)_. Moreover, the challenger needs to set_ **Hon**_:=_**Hon**__\(\cup\) _i and_ **numkeys**_:=_**numkeys**_+1._
* _For an corrupted key generation query_ \(i\)_,_ \(\mathcal{C}\) _sets a new pair of keys_ \((\text{pk}_{i},\text{sk}_{i})\leftarrow\Pi_{i}\)_._ \(\text{KeyGen}(1^{\lambda})\) _and shares_ \((\Pi_{i},\text{sk}_{i}\text{pk}_{i})\) _to_ \(\mathcal{A}\)_.