Skip to content

Commit

Permalink
Did not realized I was incorrectly computing comparison time...Crap.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Jan 14, 2024
1 parent b662b8b commit 18506a7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/main/java/weka/finito/utils/shared.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static boolean compare(NodeInfo ld, int comparisonType,
HashMap<String, BigIntegers> encrypted_features, alice Niu)
throws ClassNotFoundException, HomomorphicException, IOException {

long start_time = System.nanoTime();
boolean answer;

BigIntegers encrypted_values = encrypted_features.get(ld.variable_name);
BigInteger encrypted_client_value = null;
Expand All @@ -147,18 +147,19 @@ else if ((comparisonType == 3) || (comparisonType == 5)) {
Niu.setDGKMode(true);
}
assert encrypted_client_value != null;
long stop_time = System.nanoTime();

double run_time = (double) (stop_time - start_time);
run_time = run_time / 1000000;
System.out.printf("Comparison took %f ms\n", run_time);
long start_time = System.nanoTime();
if (((comparisonType == 1) && (ld.threshold == 0))
|| (comparisonType == 4) || (comparisonType == 5)) {
return Niu.Protocol2(encrypted_thresh, encrypted_client_value);
answer = Niu.Protocol2(encrypted_thresh, encrypted_client_value);
}
else {
return Niu.Protocol2(encrypted_client_value, encrypted_thresh);
answer = Niu.Protocol2(encrypted_client_value, encrypted_thresh);
}
long stop_time = System.nanoTime();
double run_time = (double) (stop_time - start_time);
run_time = run_time / 1000000;
System.out.printf("Comparison took %f ms\n", run_time);
return answer;
}

public static void closeConnection(ObjectOutputStream oos,
Expand Down

0 comments on commit 18506a7

Please sign in to comment.