In this section, we prove the correctness and secrecy of Theorem 1. First, in Lemma 2, we show that for suciently large k > 0 and q > 3 2kn2 log n, LocationSharing computes a random permutation of the input queries with high probability.
Definition 1. [Perfect Random Permutation] Con- sider a set of n 1 elements A = fa1; a2; :::ang. A perfect random permutation of A is a permutation chosen uniformly at random from the set of all possible n! permutations of A.
Lemma 1. Consider a sequence of input pairs (r1; x1);:::; (rn; xn), and a sorting protocol that sorts the pairs according to their rst elements. computes a perfect random permutation of the pairs if their rst elements are chosen uniformly at random and are distinct.
Proof. Let X = (r1; x1); :::; (rn; xn) be the input sequence and Y = (s1; y1); :::; (sn; yn) be the output sequence of . Note s1; :::; snis the sorted sequence of fr1; :::; rng. An arbitrary output sequence of pairs Y 0 = (s0 1; y01 ); :::; (s0 n; y0n ) is said to be equal to Y if yi = y0 i, for all i 2 [n]. We want to prove that the probability of Y 0 being equal to Y is 1 n! . In general, for any i 2 [n], yi = y0 i if and only if s0 i is the i-th smallest element in fr1; :::; rng conditioned on knowing the i