diff --git a/classes.txt b/classes.txt new file mode 100644 index 0000000..33b0a3d --- /dev/null +++ b/classes.txt @@ -0,0 +1,16 @@ +negative (3366.31/2.0) +negative (6.24) +negative (56.17) +negative (30.75) +compensated_hypothyroid (4.46/0.79) +primary_hypothyroid (2.62/0.79) +negative (6.74) +primary_hypothyroid (82.7) +negative (3.0) +primary_hypothyroid (2.0) +negative (9.16/0.16) +negative (2.06/0.06) +primary_hypothyroid (3.24) +compensated_hypothyroid (191.5/3.06) +negative (2.0/1.0) +primary_hypothyroid (3.04/0.04) diff --git a/dgk b/dgk new file mode 100644 index 0000000..65b53e3 Binary files /dev/null and b/dgk differ diff --git a/dgk.pub b/dgk.pub new file mode 100644 index 0000000..525386a Binary files /dev/null and b/dgk.pub differ diff --git a/libs/crypto.jar b/libs/crypto.jar index a3ba9ab..c4f92d1 100644 Binary files a/libs/crypto.jar and b/libs/crypto.jar differ diff --git a/paillier b/paillier new file mode 100644 index 0000000..8862afa Binary files /dev/null and b/paillier differ diff --git a/paillier.pub b/paillier.pub new file mode 100644 index 0000000..9223f29 Binary files /dev/null and b/paillier.pub differ diff --git a/src/main/java/weka/finito/client.java b/src/main/java/weka/finito/client.java index 540bff3..f099a55 100644 --- a/src/main/java/weka/finito/client.java +++ b/src/main/java/weka/finito/client.java @@ -348,24 +348,28 @@ private void communicate_with_level_site(Socket level_site) client.writeInt(next_index); // Get the comparison - int comparison_type = client.readInt(); - if (comparison_type == -1) { - System.out.println("LEVEL-SITE DOESN'T HAVE DATA!!!"); - this.classification_complete = true; - return; - } - else if (comparison_type == 0) { - client.setDGKMode(false); - } - else if (comparison_type == 1) { - client.setDGKMode(true); + // I am not sure why I need this loop, but you will only need 1 comparison. + int comparison_type; + while (true) { + comparison_type = client.readInt(); + if (comparison_type == -1) { + this.classification_complete = true; + break; + } + else if (comparison_type == 0) { + client.setDGKMode(false); + } + else if (comparison_type == 1) { + client.setDGKMode(true); + } + client.Protocol2(); } - client.Protocol2(); // Get boolean from level-site: // true - get leaf value // false - get encrypted AES index for next round classification_complete = client.readBoolean(); + System.out.println("BOOLEAN READ"); if (classification_complete) { o = client.readObject(); if (o instanceof String) { diff --git a/src/main/java/weka/finito/level_site_evaluation_thread.java b/src/main/java/weka/finito/level_site_evaluation_thread.java index 36e012d..dfc5f98 100644 --- a/src/main/java/weka/finito/level_site_evaluation_thread.java +++ b/src/main/java/weka/finito/level_site_evaluation_thread.java @@ -51,6 +51,7 @@ public final void run() { // Null, keep going down the tree, // Not null, you got the correct leaf node of your DT! NodeInfo reply = traverse_level(level_site_data, encrypted_features, niu); + niu.writeInt(-1); if (reply != null) { // Tell the client the value