Guy Barshap
email: barshag@post.bgu.ac.il

Tamir Tassa
email: tamirta@openu.ac.il

Privacy-Preserving Planarity Testing of Distributed Graphs

Keywords: secure multiparty computation, privacy-preserving distributed computations, distributed graphs, graph planarity

We study the problem of privacy-preserving planarity testing of distributed graphs. The setting involves several parties that hold private graphs on the same set of vertices, and an external mediator that helps with performing the computations. Their goal is to test whether the union of their private graphs is planar, but in doing so each party wishes to deny from his peers any information on his own private edge set beyond what is implied by the final output of the computation. We present a privacy-preserving protocol for that purpose which is based on the Hanani-Tutte Theorem. That theorem enables translating the planarity question into the question of whether a specific system of linear equations over the field F2 is solvable. Our protocol uses a diverse cryptographic toolkit which includes techniques such as homomorphic encryption, oblivious Gaussian elimination, and private set intersection. This is the first time that a solution to this problem is presented.

Introduction

A planar graph G = (V, E) is a graph that can be properly embedded in the two-dimensional plane R 2 in the following sense: there exists a bijection ϕ from the vertex set V to R 2 and a representation of each edge e = (u, v) ∈ E as a continuous simple curve in R 2 with ϕ(u) and ϕ(v) as its end points, such that no two curves intersect apart possibly at their end points.

Planar graphs constitute an attractive family of graphs, both in theory and in practice. In many applications where graph structures arise, it is needed to test the planarity of those graphs. A classical example is in the area of integrated circuit (IC) design. An IC consists of electronic modules and the wiring interconnections between them. It can be represented by a graph in which the vertices are the modules and the edges are the wires. An IC can be printed on the surface of a chip iff the graph is planar, because wires must not cross each other. Another setting in which planarity is a natural notion is in road maps. A set of cities and interconnecting roads can be thought of as a graph; the graph vertices are the cities while the edges are connecting roads. Such a map can be constructed with non-crossing roads (in order to avoid constructing bridges or obstructing the traffic flow by stop lights) iff the corresponding graph is planar. Apart from the above motivating examples, there are cases in which the planarity of a graph can be exploited in order to simplify and expedite the solution of some computational problems. Examples include sub-graph isomorphism [START_REF] Eppstein | Subgraph isomorphism in planar graphs and related problems[END_REF], maximal clique [START_REF] Papadimitriou | The clique problem for planar graphs[END_REF], and maximum cut [START_REF] Hadlock | Finding a maximum cut of a planar graph in polynomial time[END_REF].

In this study we consider a distributed version of the planarity testing problem. In that problem there are several parties, P 1 , . . . , P d , each one holding a private graph on the same set of vertices; namely, P i has a graph G i = (V, E i ) where V is publicly known and shared by all, while E i is private, 1 ≤ i ≤ d. They wish to determine whether the union graph G = (V, E), where E = d i=1 E i , is planar or not. As the edge sets E i , 1 ≤ i ≤ d, are private, the planarity testing should be carried out in a privacy-preserving manner. Namely, after the conclusion of the computational procedure P i must not learn anything on E j , j = i, beyond what is implied by G i and the planarity of G. For example, two (or more) companies may wish to check the possibility of printing the ICs which implement their products on the same chip. They prefer not to disclose to each other their own IC design, before they are verified that they could collaborate in that manner. The algorithmic solutions which we propose herein for privacy-preserving planarity testing could be used in that application scenario.

The strict notion of perfect privacy-preservation is sometimes relaxed by allowing some leakage of information, if such a relaxation enables a more efficient computation and if the leakage of information is characterized (in order to decide, in any given application setting, whether the gain in efficiency justifies the reduction in privacy-preservation). There are many examples of studies that relax perfect privacy in order to allow practical solutions, from various domains such as distributed association rule mining [START_REF] Kantarcioglu | Privacy-preserving distributed mining of association rules on horizontally partitioned data[END_REF][START_REF] Tassa | Secure mining of association rules in horizontally distributed databases[END_REF], anonymization of distributed datasets [START_REF] Jiang | A secure distributed framework for achieving k-anonymity[END_REF][START_REF] Tassa | Secure distributed computation of anonymized views of shared databases[END_REF][START_REF] Tassa | Anonymization of centralized and distributed social networks by sequential clustering[END_REF], collaborative filtering [START_REF] Jeckmans | Privacy-preserving collaborative filtering based on horizontally partitioned dataset[END_REF][START_REF] Shmueli | Secure multi-party protocols for item-based collaborative filtering[END_REF], distributed graph mining [START_REF] Asharov | Secure centrality computation over multiple networks[END_REF], and distributed constraint optimization problems [START_REF] Grinshpoun | A privacy-preserving algorithm for distributed constraint optimization[END_REF][START_REF] Léauté | Protecting privacy through distributed computation in multi-agent decision making[END_REF][START_REF] Tassa | Privacy preserving implementation of the max-sum algorithm and its variants[END_REF].

Well known characterizations for planar graphs were proposed by both Wagner [START_REF] Wagner | Über eine eigenschaft der ebenen komplexe[END_REF] and Kuratowski [START_REF] Kuratowski | Sur le problème des courbes gauches en topologie[END_REF]. For example, the Wagner's characterization states that a graph is planar iff it does not have K 5 (the complete graph over 5 vertices) or K 3,3 (the complete bipartite graph over 3 vertices in each part) as a minor (see Figure 1). Namely, K 5 or K 3,3 cannot be obtained from G by a sequence of these operations: contracting edges, deleting edges, and deleting isolated vertices. However, directly applying either Wagner's characterization, or the closely-related Kuratowski's characterization, in order to test the planarity of a given graph, yields exponential-time algorithms [START_REF] Patrignani | Handbook on graph drawing and visualization[END_REF].

Optimal linear time planarity testing algorithms were proposed in [START_REF] Hopcroft | Efficient planarity testing[END_REF][START_REF] Boyer | On the cutting edge: Simplified o(n) planarity by edge addition[END_REF]. These algorithms are iterative and use a DFS-subroutine [START_REF] Patrignani | Handbook on graph drawing and visualization[END_REF]. Alas, those features of these algorithms turn out to be significant obstacles when trying to devise corresponding privacy-preserving variants of these algorithms. Thus, none of the above-mentioned approaches seem to be adequate in order to base on them an efficient privacy-preserving planarity testing protocol.

In this study we propose a privacy-preserving protocol for planarity testing of distributed graphs, which is based on the Hanani-Tutte Theorem [START_REF] Schaefer | Toward a theory of planarity: Hanani-tutte and planarity variants[END_REF]. Our protocol is based on the mediated model that was presented in [START_REF] Alwen | Collusion-free protocols in the mediated model[END_REF]. In that model, there exists an external mediator T to which the parties may export some computations, but the mediator should not learn information on the private inputs of the parties or the final output. We assume that all interacting parties (P 1 , . . . , P d and T ) are semi-honest. Namely, they follow the protocol correctly, and do not form coalitions, but they try to extract from their view in the protocol information on the private inputs of other parties. (All privacy-related studies that we mentioned earlier also make similar assumptions.)

Due to page limitation and for the sake of clarity, we focus here on the case d = 2. The extension to any d is deferred to the full journal version of this study.

The outline of this work is as follows. In Section 2 we provide the relevant background on planarity testing, while in Section 3 we describe the main cryptographic toolkit that we use in our solution. We overview our solution and the two main stages of which it consists in Section 4. The subsequent Sections 5 and 6 include the detailed description and analysis of each of the two stages in our solution. Finally, we conclude in Section 7.

Planarity testing using the Hanani-Tutte Theorem

In this section we state the Hanani-Tutte Theorem and then use it in order to translate the planarity question of a graph to the solvability of a system of linear equations over F 2 . To that end, we introduce the following definitions and notations:

-If e ∈ E we let a(e) and b(e) denote the two vertices that e connects.

-

A drawing D of a graph G = (V, E) is an embedding of G in R 2 .
Namely, it is a mapping ϕ : V → R 2 together with a representation of each edge e ∈ E as a continuous simple curve that connects ϕ(a(e)) and ϕ(b(e)).

-Two edges e, f ∈ E are called independent if {a(e), b(e)}∩{a(f

), b(f )} = ∅.
-The set of all pairs of independent edges in E is denoted E ind 2 . -For a given drawing D of G and {e, f } ∈ E ind 2 , parity D (e, f ) is the parity of the number of crossings between the curves representing e and f in D.

Theorem [Hanani-Tutte].

A graph G is planar iff it has a drawing D in which parity D (e, f ) = 0 for all {e, f } ∈ E ind 2 . Let D be a drawing of G, e ∈ E, and v ∈ V \ {a(e), b(e)}. An (e, v)-move consists of taking a small section of the curve that represents e in D and deforming it in a narrow tunnel to make it pass over v, while not passing over any other vertex. The effect of an (e, v)-move in a drawing D is that parity D (e, f ) changes for all edges f that are adjacent to v, but it remains unchanged for all other edges f (see Figure 2). A remarkable corollary of this theorem is a planarity testing algorithm. It starts with an arbitrary drawing D of the input graph G, preferably a drawing in which parity D (e, f ) can be computed efficiently for every pair of independent edges in G. Then, the algorithm tries to find another drawing D , by making a series of (e, v) moves, in which parity D (e, f ) = 0 for all {e, f } ∈ E ind 2 . If it succeeds, then the graph is planar, otherwise it is not (see [START_REF] Schaefer | Toward a theory of planarity: Hanani-tutte and planarity variants[END_REF]Lemma 3.3]).

The existence of D can be determined by considering the following system of linear equations. Define for each e ∈ E and v ∈ V \ {a(e), b(e)} a Boolean variable x e,v ; that variable equals 1 iff the transition from D to D includes an (e, v)-move. It follows that for any pair of independent edges {e, f } ∈ E ind 2 ,

parity D (e, f ) = parity D (e, f ) + x e,a(f ) + x e,b(f ) + x f,a(e) + x f,b(e) in F 2 .
Hence, given the drawing D, there exists a drawing D in which parity D (e, f ) = 0 for all {e, f } ∈ E ind 2 iff there exists a solution to the following system of linear equations over F 2 :

parity D (e, f ) + x e,a(f ) + x e,b(f ) + x f,a(e) + x f,b(e) = 0 {e, f } ∈ E ind 2 . (1)
That is the Hanani-Tutte (HT hereinafter) system for the graph G = (V, E) (with respect to the drawing D). It consists of |E ind 2 | equations (one for each pair of independent edges) in |E| • (|V | -2) unknowns (x e,v for all e ∈ E and v ∈ V \ {a(e), b(e)}). The graph G is planar iff that system is solvable.

Cryptographic Toolkit

In this section we provide a birdseye view of the cryptographic primitives and procedures that we shall be using later on.

Homomorphic encryption

An encryption function F is called (additively) homomorphic if the domain of plaintexts is a commutative additive group, the domain of ciphertexts is a commutative multiplicative group, and for every two plaintexts, m 1 and m 2 ,

F(m 1 + m 2 ) = F(m 1 ) • F(m 2 ).
When the encryption function is randomized (in the sense that F(m) depends on m as well as on a random string) then F is called probabilistic. Homomorphic encryption functions allow performing arithmetic computations in the ciphertext domain. The property of being probabilistic is essential for getting semantic security.

There are many well known ciphers that are probabilistic and additively homomorphic. A basic example of such a cipher over F 2 , which we use in our protocol, is the Goldwasser-Micali cipher [START_REF] Goldwasser | Probabilistic encryption and how to play mental poker keeping secret all partial information[END_REF].

Deciding the solvability of an encrypted linear system

Nissim and Weinreb [START_REF] Nissim | Communication efficient secure linear algebra[END_REF] presented a method for obliviously deciding whether an encrypted system of linear equations is solvable or not. They considered a setting that involves two parties -T and P . T holds an encrypted matrix F(M ), where M is a matrix of dimensions k a ×k b , and an encrypted vector F(b), where b is a column vector of dimension k a . Both M and b are over the field F = F 2 , while F is an additively homomorphic encryption over that field, for which P holds the private decryption key. Their protocol is Monte Carlo in the sense that its output may be wrong. Specifically, at the conclusion of the protocol T gets F(β) for some bit β. If the system M x = b is not solvable then β will always be zero. Otherwise, if the system is solvable, then β = 1 with probability at least c for some positive constant c. Hence, by performing several independent runs of the protocol, it is possible to decide the solvability of the system with an error probability sufficiently small.

Overview of the proposed planarity testing protocol

Our planarity testing protocol has two stages. The first one consists of a preliminary check of the size of the unified edge set E. It is outlined in Section 4.1, and detailed in Section 5. The second stage includes the main protocol, in which the HT system of equations for the unified graph is constructed obliviously, and then its solvability is tested in a privacy-preserving manner. We provide a birdseye view of that stage in Section 4.2, and dive into its details in Section 6.

Testing the number of edges in the unified graph.

Let V = {v 1 , . . . , v n } denote the vertex set in the unified graph G = (V, E). A well-known result (see e.g. [START_REF] Patrignani | Handbook on graph drawing and visualization[END_REF]) states that G is planar only if

|E| = |E 1 ∪ E 2 | ≤ 3n -6 . (2)
Hence, in the first stage, the three parties, P 1 , P 2 and T , engage in a secure protocol for checking whether inequality (2) holds or not. If it does not, they know that the unified graph G is not planar. If it does hold, they proceed to the second stage in the verification (Section 4.2). Running this stage is optional. On one hand, it leaks to the interacting parties information on |E| beyond the required output about the planarity of G (specifically, whether inequality (2) holds or not). On the other hand, it may enable the parties to detect non-planarity without running the costly computation of the second stage. Hence, if in the relevant application scenario the information regarding whether inequality (2) holds or not is deemed benign, it is recommended to run this stage.

A privacy-preserving implementation of the Hanani-Tutte planarity test.

The three parties P 1 , P 2 and T construct the HT system of linear equations, Eq. ( 1), for the unified graph G. Towards that end, they begin by constructing the system of linear equations for the complete graph on V , denoted K V (i.e., K V is the graph on V that has all n 2 edges):

x e,a(f ) + x e,b(f ) + x f,a(e) + x f,b(e) = parity D (e, f ) {e, f } ∈ K ind 2 ;
(3) here, K ind 2 is the set of all pairs of independent edges in K V . The number of equations in that system is

N K V := |K ind 2 | = 1 2 • n 2 • n -2 2 . (4)
This step can be constructed publicly with no privacy risks, since the vertex set V is known to all, and K V is the complete graph on V . The main effort is in letting the mediator T extract from the large system in Eq. ( 3) the subset of equations in Eq. (1). To protect the unified graph data from T , he will get only an encrypted version of the subset of linear equations corresponding to G. The last part of the protocol is dedicated to determining whether that system has a solution or not. The main difficulty here lies in the fact that no party actually sees the relevant system of equations: only T holds that system, but he holds an encryption of that system, where the corresponding decryption key is known only to P 1 .

To allow this approach, we must start with some drawing of K V , which, in turn, induces also a drawing of G. We consider the following embedding of V in

R 2 . If V = {v 1 , . . . , v n }, then v j is mapped into the point v j → ϕ(v j ) := (cos(2πj/n), sin(2πj/n)) , 1 ≤ j ≤ n . (5)
Namely, the vertices v 1 , . . . , v n are mapped to equi-distant points on the unit circle, in a counter-clockwise order according to their index. The edge e i,j = (v i , v j ) is then represented by the straight line segment between ϕ(v i ) and ϕ(v j ). Figure 3 illustrates that basic drawing for a graph over n = 6 vertices. Let us denote the above drawing of K V (and the corresponding drawing of G, which is a sub-graph of K V ) by D. Consider now an arbitrary pair of independent edges e i,j and e k, ; we may assume, without loss of generality, that i < j, k < , and i < k. Then it is easy to see that parity D (e i,j , e k, ) = 1 iff i < k < j < .

The corresponding HT system (3) can be constructed publicly, by each of P 1 , P 2 and T , for this drawing D of the complete graph K V . As stated earlier, the main problem will be to identify, among those N K V equations, the |E ind 2 | equations that relate to pairs of edges e and f that are both in E. Then, the graph G = (V, E) is planar iff that sub-system of |E ind 2 | equations has a solution. In Section 6 we provide the details of that computation.

5 First stage: Testing the size of the unified edge set

Let V 2 := {(v i , v j ) : 1 ≤ i < j ≤ n} denote the set of all possible n 2 edges in G. Since E = E 1 ∪ E 2 , we infer that E c = E c 1 ∩ E c 2 , where for any subset A ⊆ V 2 , A c := V 2 \ A denotes its complement within V 2 . Hence, by Eq. (2), the unified graph G = (V, E) is planar only if |E c | = |E c 1 ∩ E c 2 | ≥ n 2 -(3n -6) . (6)
In order to verify the latter inequality it is possible to invoke any of the multitude of protocols for private set intersection. The first such protocol was Protocol 1 Testing the size of the unified edge set

(i) = x2(i) α 1 , 1 ≤ i ≤ n
2 . 6: P2 sends to T the vector y 1 , where y

1 (i) = x1(i) α 2 , 1 ≤ i ≤ n
2 . 7: T compares the two received vectors and finds out the number z of matching entries in them. 8: If z < n 2 -(3n -6), T notifies P1 and P2 that the union graph is not planar.

proposed in [START_REF] Meadows | A more efficient cryptographic matchmaking protocol for use in the absence of a continuously available third party[END_REF], and is based on the Diffie-Hellman protocol [START_REF] Diffie | New directions in cryptography[END_REF]. Protocol 1, which we present below, is based on the private set intersection protocol of [START_REF] Meadows | A more efficient cryptographic matchmaking protocol for use in the absence of a continuously available third party[END_REF].

As a result of Steps 1-6, which are self-explanatory, T receives two vectors, y 1 and y 2 , each of which is of length n 2 . The vector y h , h = 1, 2, includes the hash of all edges in E c h , raised to the exponent α 1 α 2 , while the remaining

= |E c |. Indeed, if (v i , v j ) ∈ E c
1 ∩ E c 2 then both vectors y 1 and y 2 will include an entry that equals H(i, j) α1α2 ; hence, those two entries will be identified by T in Step 7 as matching entries and, consequently, T will increment the counter z by 1. However, we note that T may wrongly increment the counter z due to random false matchings. False matchings can occur if there are collusions in H, namely, if there exist two pairs (i, j) and (i , j ) such that H(i, j) = H(i , j ), or if P 1 and P 2 selected in Steps 3 and 4 random entries ξ 1 and ξ 2 , respectively, so that ξ α1 2 = ξ α2 1 . By selecting a secure hash function with a sufficiently large range, the probability of such false matchings is negligible.

The security of Protocol 1 follows from the hardness of the Discrete Log problem. The protocol entails O(n 2 ) hash function evaluations and exponentiations (for P 1 and P 2 ) and O(n 2 log n) comparisons for T . The protocol has only two rounds of communication in which O(n 2 log p) bits are transmitted.

Protocol 1 reveals to T the size of E. If P 1 and P 2 wish to prevent T from learning that information, they may modify Protocol 1 towards hiding that information. They can choose an integer K > 0 and then select at random an integer k ∈ [0, K]. Next, they will select 2K -k random and distinct elements from Z * p :

a i , 1 ≤ i ≤ k, and b h,i , 1 ≤ i ≤ K -k, h = 1, 2.
Then, P 1 will add to y 2 additional K entries, at random locations, with the values a 1 , . . . , a k , b 1,i , . . . , b 1,K-k , while P 2 will add to y 1 additional K entries, at random locations, with the values a 1 , . . . , a k , b 2,i , . . . , b 2,K-k . Given those modifications, T will recover in Step 7 a value z that equals |E c | + k (with high probability).

Hence, the inequality that needs to be verified now is whether z < n 2 -(3n -6) + k. In the latter inequality, T knows the left hand side (z) while P 1 knows the right hand side, and the two parties need to verify the inequality without disclosing to each other information on the compared values beyond the information of whether the inequality holds or not. This is an instance of the celebrated Yao's millionaires' problem [START_REF] Yao | Protocols for secure computations[END_REF]. By invoking any of the many available protocols for solving that problem (e.g. [START_REF] Lin | An efficient solution to the millionaires' problem based on homomorphic encryption[END_REF]), the two parties may find out securely whether |E c | < n 2 -(3n -6). Such a modification of Protocol 1 prevents T from getting |E|. Higher values of K will imply higher levels of obfuscation, but at the same time also higher communication and computational costs. As implied by [START_REF] Grinshpoun | P-syncbb: A privacy preserving branch and bound DCOP algorithm[END_REF]Lemma 4], if K > n 2 then the probability of T not learning anything on |E| from z is exactly 1 -n 2 /(K + 1); in all other cases (namely, in probability n 2 /(K + 1), T will learn either a lower or an upper bound on |E|.

Second stage: Private planarity testing

Protocol 2 decides the planarity of the union graph G in a privacy-preserving manner. It begins with P 1 generating a key pair in a probabilistic additively homomorphic cipher, F, over F 2 .

Next, the three parties execute a sub-protocol, called ConstructHTSystem (Step 2). The purpose of that sub-protocol is to construct the HT system for the union graph G, Eq. ( 1), in an oblivious manner. At the end of that sub-protocol T will hold an (entry-wise) F-encryption of the coefficient matrix of that system. (We note that T will actually get an "inflated" version of that system, in the following sense: instead of an encryption of the HT system for G, Eq. ( 1), he will hold an encryption of the larger HT system for the complete graph K V , Eq. ( 3), where all equations that relate to pairs of edges that are not in E ind 2 are zeroed.) Then (Step 3), P 1 and T execute a sub-protocol, called DecideSolvability, which decides the solvability of the encrypted system that was constructed in the previous step. T holds the encryption of the coefficient matrix and the right hand side vector for that system, while P 1 holds the relevant decryption key. The sub-protocol DecideSolvability decides the solvability of the system in a privacy-preserving manner, that is -without decrypting the system. The Boolean flag that DecideSolvability returns indicates the solvability of the system. If it is true then the system is solvable and, consequently, the union graph G is planar. Otherwise, if it is false, then, with high probability (which may be tuned as desired), the system is not solvable and, hence, the union graph G is not planar.

In the next sub-sections (Sections 6.1 and 6.2) we discuss the implementation of the two main steps in Protocol 2.

Protocol 2 Privacy preserving HT planarity testing 1: P1 generates a key pair in a probabilistic additively homomorphic cipher, F, over F2. P1 notifies P2 and T of the public encryption key in F. 2: P1, P2 and T execute ConstructHTSystem. At its conclusion, T holds an Fencryption of the HT system for the union graph, (r e,f : {e, f } ∈ K ind 2 ). 3: P1 and T execute DecideSolvability(r e,f : {e, f } ∈ K ind 2 ). 4: if DecideSolvability returns true then 5:

Output "The union graph is planar". 6: else 7:

Output "The union graph is non-planar". 8: end if

Constructing an F -encryption of the HT system

Here we discuss the sub-protocol ConstructHTSystem, which is implemented in Protocol 3. Before starting to do so, we take a look at the HT systems for G and for the complete graph K V . The HT system for the complete graph K V , with respect to the drawing D described in Section 4.2, is given in Eq. ( 3). All parties can construct that system, since K V is a public graph. The HT system for G, Eq. ( 1), which determines the planarity of G = (V, E), is a sub-system (subset of equations) of ( 3). That sub-system includes only the equations relating to pairs {e,

f } ∈ E ind 2 ⊂ K ind 2
(namely, pairs of independent edges {e, f } where both e and f are in E).

Let V 2 := {e i,j = (v i , v j ) : 1 ≤ i < j ≤ n} denote the edge set in the full graph K V (consisting of all possible pairs of vertices from V ). The set K ind 2 consists of all pairs of independent edges in K V . Its size is N K V (Eq. ( 4)), and it consists of all pairs of edges {e = (v i , v j ), f = (v k , v )} where all four indices i, j, k, are distinct (as the two edges are independent), and i < j, k < , and i < k. Our protocol, ConstructHTSystem, assumes that the set K ind 2 is ordered. We assume hereinafter that it is ordered lexicographically by the 4-tuple (i, j, k, ).

For each edge e ∈ V 2 and h ∈ {1, 2}, let α h e be the Boolean variable denoting whether e ∈ E h or not. Then, e ∈ E iff α 1 e ∨ α 2 e = 1. Consequently, the equation that corresponds to the pair of independent edges {e, f } ∈ K ind 2 appears in the HT system for G, Eq. ( 1), iff

χ e,f := (α 1 e ∨ α 2 e ) ∧ (α 1 f ∨ α 2 f ) = 1 . (7)
In the first part of ConstructHTSystem (Steps 1-2), T gets the F-encryption of χ e,f for all {e, f } ∈ K ind 2 , where χ e,f is the Boolean flag indicating whether {e, f } ∈ E ind 2 (Eq. ( 7)), and F is the cipher that P 1 selected in Step 1 of Protocol 2. Towards that end, we observe that

χ e,f := (α 1 e ∨ α 2 e ) ∧ (α 1 f ∨ α 2 f ) = (α 1 e + α 2 e -α 1 e • α 2 e ) • (α 1 f + α 2 f -α 1 f • α 2 f ) . (8)
Hence, by opening the brackets on the right hand side of Eq. ( 8) and then applying F on both sides of that equation, we get, using the homomorphism of F and simple algebra, that F(χ e,f ) = A • B -1 , where

A = α α 2 f • β α 2 e • γ 1+α 2 e •α 2 f • F(α 2 e • α 2 f ) , B = (α • β) α 2 e •α 2 f • γ α 2 e +α 2 f , (9)
and

α := F(α 1 e ) , β := F(α 1 f ) , γ := F(α 1 e • α 1 f ) . ( 10
)
In view of the above derivations, P 1 sends to P 2 the three values α, β, and γ, for each of the N K V pairs {e, f } ∈ K ind 2 , where the triplets (α, β, γ) are ordered by the lexicographical order over K ind 2 (Step 1). P 2 can then use Eq. ( 9) in order to compute A and B, for each such pair. Note that all powers of α, β and γ in Eq. ( 9) are determined by Boolean variables owned by P 2 , while F(α 2 e • α 2 f ) can be computed by P 2 since he has the public encryption key of F. P 2 then sends to T a vector of length N K V , in which each entry includes the value

F(χ e,f ) = A•B -1 for the relevant pair {e, f } ∈ K ind 2 (Step 2).
Protocol 3 ConstructHTSystem: Constructing an encryption of the HT system

1: P1 sends to P2 the vector ((α, β, γ) : {e, f } ∈ K ind
2 ) (see Eq. ( 10)). 2: P2 sends to T the vector u := (F(χ e,f ) :

{e, f } ∈ K ind 2 ). 3: for all {e, f } ∈ K ind 2
, where e = ei,j, f = e k, , i < j, k < and i < k do 4:

T allocates a vector r e,f of dimension N + 1 where

N := n 2 • (n -2). 5: T creates a bijection Φ : [N ] → {(g, v) : g ∈ V2, v ∈ V \ {a(g), b(g)}}. 6: for i ∈ [N ] do 7:
(g, v) ← Φ(i). end if 13: end for 14:

if i < k < j < then 15:

r e,f (N + 1) ← F (χ e,f ) 16: else 17: r e,f (N + 1) ← F (0) 18:

end if 19: end for

The goal of the main loop in Steps 3-19 is to let T construct an entry-wise F-encryption of the HT system for G, Eq. (1). That system has |E ind 2 | equations over |E| • (n -2) unknowns. It is a sub-system of the full system for K V , Eq. ( 3), which has N K V equations over N := n 2 • (n -2) unknowns. The encrypted system that T constructs in the loop in Steps 3-19 will be of the same dimensions as the larger system for the full graph, but all rows in it that are not relevant for G will be zeroed. T will remain oblivious to the rows in the full system that he zeroes in this process. We proceed to explain how this is done.

Consider the augmented matrix that describes the HT system for K V , Eq. ( 3). It has N K V rows, one for each pair {e, f } ∈ K ind 2 . Each row, r e,f , is a Boolean vector of length N + 1, where N = n 2 • (n -2), since it includes the coefficient of each unknown variable (and there are N such variables, one for each coupling of an edge and a non-adjacent vertex) plus the right hand side (parity D (e, f )). In the linear equation corresponding to the pair {e, f }, the coefficients of all variables are zero, except for four of those variables (see Eq. ( 3)). Hence, in the inner loop in Steps 6-13, T goes over the first N entries of r e,f ; in each of the four entries that should equal 1, T places the value F(χ e,f ) (those are values that T got from P 2 in Step 2), while in all the remaining ones he places the value F(0) (those are encryptions that T can compute on his own since he has the public encryption key of F). In the last position in r e,f , corresponding to the right hand side of the equation for the pair {e, f }, T places the value F(χ e,f ) in case the two edges intersect in the basic drawing D, while otherwise he places the value F(0) (Steps 14-18). As a result, if χ e,f = 0, T constructs an encryption of the all-zero equation; but if χ e,f = 1, T constructs an encryption of the equation for the pair {e, f }, as in Eq. ( 3). In summary, T gets a system of N K V encrypted equations: |E ind 2 | of those equations are an F-encryption of the system (1), while the remaining ones are F-encryptions of the trivial equation (the equation in which all coefficients and right hand side are zero).

Determining the solvability of an encrypted linear system

The sub-protocol DecideSolvability (Protocol 4) decides the solvability of a system of N K V linear equations over N = n 2 • (n -2) unknowns. Let M denote the N K V × N matrix of coefficients of that system, and b denote the right hand side vector (an N K V -dimensional column vector). The two parties that run the sub-protocol are P 1 and T . P 1 holds the decryption key in F (see Step 1 in Protocol 2) -a probabilistic additively homomorphic cipher over F 2 ; T , on the other hand, holds F(M ) and F(b). DecideSolvability determines whether the system M x = b has a solution or not. It does so in a privacy-preserving manner, i.e., without revealing to neither of the two parties information on the underlying matrix M and right hand side b.

To do so, the two parties execute the protocol due to Nissim and Weinreb [START_REF] Nissim | Communication efficient secure linear algebra[END_REF] that we outlined in Section 3.2, which enables them to obliviously decide whether an encrypted system of linear equations is solvable or not. We refer to this protocol below by the name SolvabilityLinearSystem. The output of Protocol SolvabilityLinearSystem is F(β), where β is a bit that indicates the existence of a vector x for which M x = b.

We recall that the basic protocol due to Nissim and Weinreb is a true-biased Monte Carlo protocol. Namely, a true answer (i.e., the system is solvable) is always correct, while a false answer may be wrong. We assume herein that the procedure SolvabilityLinearSystem which is invoked in Step 1 of Protocol 4 executes the basic protocol due to Nissim and Weinreb a sufficient number of times so that the probability of a false answer to be incorrect is reduced to below some given desired threshold. The output F(β) goes to T . 2: T sends to P1 the value F(β). 3: P1 decrypts and recovers β. 4: if β = 1 then 5:

Sub-protocol 4 DecideSolvability

return true 6: else 7:

return false 8: end if

Privacy analysis

The potential leakages of information to any party is due to messages that he receives from other parties. We proceed to discuss the security of each of the steps in Protocol 2 that involves exchange of messages.

In Step 1 of Protocol 3 (which is invoked by Protocol 2), P 2 receives from P 1 information relating to E 1 . Specifically, for each pair of independent edges in K V , P 2 receives the values α := F(α 1 e ), β := F(α 1 f ), and γ := F(α 1 e • α 1 f ). However, as that information is encrypted by F, P 2 cannot extract information on E 1 , assuming that the chosen cipher F is semantically secure (as is the case with the Goldwasser-Micali cipher [START_REF] Goldwasser | Probabilistic encryption and how to play mental poker keeping secret all partial information[END_REF] which we propose to utilize here). Similarly for Step 2 of Protocol 3 in which T receives information on E; as it is encrypted by F, it is protected from T .

Finally, the security of Protocol 4 follows from the security of Solvability-LinearSystem that was established in [START_REF] Nissim | Communication efficient secure linear algebra[END_REF].

Computational and communication costs

We begin by assessing the computational and communication costs of the first two steps in Protocol 3. The computational cost of Protocol 3 for P 1 is 2 n 2 encryptions (for computing α and β for all edges in K V ), and, in addition, N K V (Eq. ( 4)) encryptions, for computing γ for all pairs of edges in K ind 2 (Step 1). The computational cost of Protocol 3 for P 2 is dominated by the need to perform N K V encryptions (F(α 2 e • α 2 f )) in order to compute A for for all pairs of edges in K ind 2 . The remaining operations for computing A and B (see Eq. ( 9)) in Step 2 are only multiplications (note that all exponents in Eq. ( 9) are 0, 1, or 2). The communication cost of Steps 1-2 in Protocol 3 is O(N K V ) bits.

The computational costs for T due to Protocol 3 are negligible, as it has to perform no new encryptions, other than computing F(0) once. We note that the value F(0) appears in many entries in the encrypted HT linear system of equations. However, the procedure SolvabilityLinearSystem, which is executed in the next stage, is designed so that there is no need for T to generate here independent encryptions F(0) for each such entry.

The main computational bottleneck is Protocol 4. Indeed, as the underlying matrix has k

a = N K V = O(n 4 ) rows and k b = n 2 • (n -2) = O(n 3
) columns, the computational cost of running an oblivious Gaussian elimination on it is of order

O(k a • k 2 b ) = O(n 10
). Such a computational cost severely limits the applicability of our protocol to very small graphs.

The main problem with Protocol 2 is that it runs the oblivious Gaussian elimination over an encrypted matrix that has N K V rows. We recall that the actual system, Eq. ( 1

(n -2) ≤ (3n -6) • (n -2) = O(n 2 ).
Hence, another goal is to reduce the number of columns (unknowns) from O(n 3 ) to O(n 2 ). If we achieve both goals then the cost of the oblivious Gaussian elimination would reduce to O(n 6 ). While this time complexity still limits the scalability of the protocol, it allows its execution on graphs with several hundreds of vertices. Such time complexity renders our protocol viable for application settings such as the two motivating examples that were considered in the introduction (IC design and road networks).

Reducing the size of the HT system

In the master thesis [START_REF] Barshap | Privacy-preserving planarity testing of distributed graphs[END_REF] on which this study is based, we present a variant of Protocol 2 that achieves the above mentioned goals of reducing the number of rows and number of columns in the HT system. Due to space limitations, we only outline the main ideas of that variant herein, and leave the detailed description and analysis to the full version of this study.

The main difference from Protocol 2 is that P 1 generates the encryption of the HT system for the full graph K V , Eq. ( 3), and sends it to T . Then, T extracts from that large system the sub-system for G, Eq. (1). Specifically, P 1 performs a similar computation to the one that T does in Steps 3-19 of Protocol 3, where the only difference is that in Steps 9 and 15 P 1 inserts the value F(1) (and not F(χ e,f ) as done in Protocol 3) in the relevant entries. Before sending the encrypted matrix to T , P 1 applies on its rows and columns random permutations, which are selected jointly by P 1 and P 2 and are kept secret from T .

Recall that the matrix has k a = N K V = O(n 4 ) rows and k b +1 = n 2 •(n-2)+ 1 = O(n 3 ) columns. By examining the structure of the matrix, see Eq. (3), each of the k a rows has either four or five 1-entries, while the remaining entries are 0. Hence, in the encrypted matrix that P 1 sends to T , there will be O(n 4 ) entries that equal F(1) and O(n 7 ) entries that equal F(0). P 1 cannot re-use encryptions, since it is necessary to prevent T from distinguishing between 0 and 1 entries. It is possible to generate those O(n 7 ) encrypted entries by performing only O(n 3.5 ) encryptions and relying on the homomorphic property of F (which implies that F(0) • F(0) = F(0) and F(0) • F(1) = F(1)).

In order to enable T to detect which rows in the encrypted matrix need to be discarded (since they relate to pairs of edges in K ind 2 \ E ind 2 ), T generates a key pair in a probabilistic additively homomorphic cipher, E, over F 2 . Then, P 1 and P 2 perform the computation in Steps 1-2 of Protocol 3 with E instead of F. Hence, P 2 sends to T the vector u := (E(χ e,f ) : {e, f } ∈ K ind 2 ), where the entries are permuted in accord to the selected order of rows in the encrypted matrix that P 1 had sent earlier to T . Subsequently, T computes v := E -1 (u) and then he removes from the matrix all rows that correspond to 0-entries in v. A similar procedure can be used to enable T to remove columns that are irrelevant for the HT system for G. After performing those two reductions, T gets an encryption of the system in Eq. [START_REF] Eppstein | Subgraph isomorphism in planar graphs and related problems[END_REF]. That is the system on which the procedure DecideSolvability is applied.

Such a variant of Protocol 2 has a computational cost of O(n 6 ). It has larger communication costs than Protocol 2, as P 1 needs to transfer to T O(n 7 ) bits. In addition, it enables T to infer |E| (as the final number of columns equals |E| • (n -2)). If the latter value is deemed sensitive, P 1 and P 2 can obfuscate it by sending to T information that will result in keeping unnecessary columns, i.e., columns relating to variables x e,v where e / ∈ E. Such course of action will increase the computational cost, but will prevent T from inferring |E|.

Conclusions

We introduced the problem of privacy-preserving planarity testing of distributed graphs. We presented a protocol that solves this problem. Our protocol, based on the Hanani-Tutte Theorem, protects the private edge sets of each of the parties, under the assumption that the parties are semi-honest and do not collude.

In the full version of this study [START_REF] Barshap | Privacy-preserving planarity testing of distributed graphs[END_REF] we present an extension of our protocol to any number of parties; we present in detail and analyze the more efficient variant of Protocol 2, which we outlined in Section 6.5; and we show how our protocol can be used in order to reduce the complexity of various privacy-preserving graph computations, such as testing 3-colorability or testing outer-planarity.

This study raises the following problems for future research: (a) Improving scalability, either by devising more efficient ways to test the solvability of the HT system, or by designing a privacy-preserving version of another planarity testing algorithm.

(b) Devising privacy-preserving protocols for solving graph problems, which are known to have an efficient solution in cases where the underlying graph is planar, e.g. the sub-graph isomorphism problem, or the maximal clique problem.

(c) Enhancing the resiliency of the protocol to coalitions, and to stronger adversarial models (i.e., malicious parties).

Fig. 1 .

 1 Fig. 1. The minors that cannot appear in a planar graph -K5 and K3,3.

Fig. 2 .

 2 Fig.2. An (e, v)-move. As a result, parityD(e, f ) changes only for the four edges adjacent to v (from 0 to 1). For all other edges f , parityD(e, f ) remains unchanged (0).

Fig. 3 .

 3 Fig. 3. Left: illustration of the embedding of n = 6 vertices, together with two connecting edges. Right: the corresponding drawing of KV and of G = (V, E) with E = {e1,4, e1,5, e2,4, e2,6, e3,6, e5,6} (the six edges in E are marked by thicker lines).

n 2 -

 2 |E c h | entries are random elements in Z * p . The number z of matching entries in those two vectors (Step 7) satisfies z ≥ |E c |, while with very high probability z

8 :

 8 if (g = e and v ∈ {a(f ), b(f )}) or (g = f and v ∈ {a(e), b(e)}) then 9: r e,f (i) ← F (χ e,f ) 10: else 11: r e,f (i) ← F (0) 12:

1 :

 1 T and P1 run Protocol SolvabilityLinearSystem with inputs F(M ) and F(b).

1 :

 1 P1 and P2 select a large multiplicative group Z * p (p is prime) and a hash function H whose range can be embedded in Z * p . 2: P h selects a secret and random exponent 1 < α h < p -1, h = 1, 2. 3: P1 sends to P2 a vector x1 of length n 2 where, for each edge (vi, vj) ∈ E c 1 , i < j, x1 includes an entry of the form H(i, j) α 1 , while the remaining n 2 -|E c 1 | entries are randomly selected from Z * p . The order of x1's entries is random. 4: P2 sends to P1 a vector x2 of length n 2 where, for each edge (vi, vj) ∈ E c 2 , i < j, x2 includes an entry of the form H(i, j) α 2 , while the remaining n 2 -|E c 2 | entries are randomly selected from Z * p . The order of x2's entries is random. 5: P1 sends to T the vector y 2 , where y 2

  ), has only |E ind 2 | equations. Since |E| ≤ 3n -6, as verified in the first stage, then |E ind 2 | = O(n 2 ). Hence, one goal is to reduce the number of rows in the encrypted HT system from N K V = O(n 4 ) to the exact number of relevant equations |E ind 2 | = O(n 2 ). Moreover, the number of columns in Eq. (1) is |E| •