| Algorithm 6 DistanceCompute. |
| Input: |
| : the ciphertext of a querier’s location X; |
| : the ciphertext of a publisher’s location Y; |
| Output: |
| : the ciphertext of the distance between X and Y; |
| 1: Obtain and from the ; |
| 2: Compute ; |
| 3: Compute ; |
| return ; |
| Algorithm 6 DistanceCompute. |
| Input: |
| : the ciphertext of a querier’s location X; |
| : the ciphertext of a publisher’s location Y; |
| Output: |
| : the ciphertext of the distance between X and Y; |
| 1: Obtain and from the ; |
| 2: Compute ; |
| 3: Compute ; |
| return ; |