Skip to content

Commit

Permalink
OK, I have no idea why I need this while loop. Ugh, this is a problem…
Browse files Browse the repository at this point in the history
… for later
  • Loading branch information
AndrewQuijano committed Jan 15, 2024
1 parent 18506a7 commit 4837d9d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 12 deletions.
16 changes: 16 additions & 0 deletions classes.txt
Original file line number Diff line number Diff line change
@@ -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)
Binary file added dgk
Binary file not shown.
Binary file added dgk.pub
Binary file not shown.
Binary file modified libs/crypto.jar
Binary file not shown.
Binary file added paillier
Binary file not shown.
Binary file added paillier.pub
Binary file not shown.
28 changes: 16 additions & 12 deletions src/main/java/weka/finito/client.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4837d9d

Please sign in to comment.