## 4 ROLQ-TEE Scheme
### Detailed Construction
It outputs the query key \(sk_{\mu}\), a storage key \(sk_{\mathcal{DO}}\), a data user list \(UL=\{rid_{\mu}\}\), \(1\leq\mu\leq n\), an empty revocation list \(RL=\{\mathcal{O}\}\), and an timestamp list \(TL=\{\mathcal{O}\}\). 1. First, the TEE decrypts \(\mathcal{C}_{msk}\) to \(msk\) and randomly generates a unique identifier \(rid_{\mu}\) for each registered data user \(\mathcal{DU}_{\mu}\). Meanwhile, the TEE also generates a unique identifier \(rid_{\mathcal{DO}}\) for the \(\mathcal{DO}\). 2. Second, the TEE creates a timestamp \(T_{t}\) and sets a counter \(t=1\), where \(TL=\{T_{1}\}\). After that, the TEE computes the corresponding query key \(sk_{\mu}=\{sk_{\mu,t,0},sk_{\mu,t,1}\}\), where \(sk_{\mu,t,0}=H_{1}(rid_{\mu})^{a_{\mu}}\cdot H_{2}(T_{t})^{r_{\mu}}\), \(sk_{\mu,t,1}=g^{r_{\mu}}\), and \(r_{\mu,t}\in Z_{q}^{*}\). 3. Next, the TEE computes the storage key \(sk_{\mathcal{DO}}=H_{1}(rid_{\mathcal{DO}})^{\alpha}\) for the \(\mathcal{DO}\) and uses it for data encryption. 4. Finally, the TEE distributes \(\{sk_{\mathcal{DO}},rid_{\mathcal{DO}}\}\) to the \(\mathcal{DO}\) through a secure channel, and distributes \(\{sk_{\mu},rid_{\mu},T_{t}\}\) to the corresponding \(\mathcal{DU}_{\mu}\) through the secure sockets layer (SSL) protocol. * \(Build(K_{s},C,sk_{\mathcal{DO}}){\rightarrow}(MT,c_{i})\). The \(Build\) algorithm is run by the TEE. It takes as input the session key \(K_{s}\), the ciphertext \(\mathcal{C}=\{\mathcal{C}_{i}\}\), and the secret key \(sk_{\mathcal{DO}}\). It outputs the map table \(MT\) and encrypted location data. The detailed process is as follows: 1. First, the TEE decrypts the ciphertext \(\mathcal{C}_{i}\) to plaintext \(M_{i}=x_{i}||l_{i}\) and splits the \(M_{i}\) to obtain the customer identity \(x_{i}\) and corresponding location information \(l_{i}\), \(1\leq i\leq n_{\mathcal{DO}}\). 2. Second, the TEE computes \(F(sk_{\mu},x_{i})\), and calls the \(Enc\) algorithm to generate the encrypted location data ciphertext \(c_{i}\); that is, \(c_{i}=Enc(l_{i},sk_{\mathcal{DO}},iv_{i}^{\prime},add_{i}^{\prime})\). 3. Finally, the TEE constructs a map table \(MT[F(sk_{\mu},x_{i})]=c_{i}\) and stores the ciphertext \(c_{i}\) to the store area of the \(\mathcal{CSP}\). * \(GenToken(\mathcal{F}_{\mu},sk_{\mu},U_{\mu}){\rightarrow}(\mathcal{CF}_{\mu}, \mathcal{CL}_{\mu})\). The \(GenToken\) algorithm is run by the \(\mathcal{DU}_{\mu}\). It takes as input a list of candidate facility locations \(\mathcal{F}_{\mu}=\{f_{1},\ldots,f_{s}\}\), the query key \(sk_{\mu}\), and the private customer set of the data user \(U_{\mu}\). It outputs an encrypted candidate set \(\mathcal{CF}_{\mu}\) and an encrypted customer list set \(\mathcal{CL}_{\mu}\). The detailed steps are as in Algorithm 1: 1. The \(\mathcal{DU}_{\mu}\) chooses a random value \(r_{\mu}\in Z_{q}^{*}\) and computes the encrypted candidate set \(\mathcal{CF}_{\mu}=\{\mathcal{CF}_{\mu,0},\mathcal{CF}_{\mu,1},\mathcal{CF}_{ \mu,2}\}\), where \(\mathcal{CF}_{\mu,0}=g^{r_{\mu}}\), \(\mathcal{CF}_{\mu,1}=M_{\mathcal{F}_{\mu}}\cdot e(H_{1}(rid_{\mu})^{r_{\mu}}, h_{\mu})\), \(\mathcal{CF}_{\mu,2}=H_{2}(T_{t})^{r_{\mu}}\), and \(M_{\mathcal{F}_{\mu}}=f_{1}||f_{2}||\ldots||f_{s}\). 2. Next, the \(\mathcal{DU}_{\mu}\) computes the encrypted customer list \(\mathcal{CL}_{\mu}=\{\mathcal{CL}_{\mu,0},\mathcal{CL}_{\mu,1},\mathcal{CL}_{ \mu,2}\}\), where \(\mathcal{CL}_{\mu,0}=g^{r_{\mu}}\), \(\mathcal{CL}_{\mu,1}=L\cdot e(H_{1}(rid_{\mu})^{r_{\mu}},h_{\mu})\), \(\mathcal{CL}_{\mu,2}=H_{2}(T_{t})^{r_{\mu}}\), \(r_{\mu}^{\prime}\in Z_{q}^{*}\), and \(L=F(sk_{\mu},y_{\mu,1})||\ldots||F(sk_{\mu},y_{\mu,n_{\mu}})\). 3. Finally, the \(\mathcal{DU}_{\mu}\) sends the encrypted query token \(\mathcal{Q}_{\mu}=\{\mathcal{CF}_{\mu},\mathcal{CL}_{\mu}\}\) to the \(\mathcal{CSP}\). * \(OptLocQue(c_{i},\mathcal{Q}_{\mu},sk_{\mu},sk_{\mathcal{DO}},MT,mpk){\rightarrow} \mathcal{C}_{res}\). The \(OptLocQue\) algorithm is run by the TEE.