Skip to content

Commit

Permalink
Accidentially broke CI, fixed now. Think for client, I need to have i…
Browse files Browse the repository at this point in the history
…t run the full gradle command via kubeexec
  • Loading branch information
AndrewQuijano committed Jun 20, 2023
1 parent c8cadeb commit b8497ba
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/main/java/weka/finito/client.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package weka.finito;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.*;
import java.math.BigInteger;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -117,7 +113,7 @@ public static void main(String[] args) {
System.out.println("Missing Testing Data set as an argument parameter");
System.exit(1);
}

test.read_keys();
test.run();
System.exit(0);
}
Expand Down Expand Up @@ -164,10 +160,10 @@ public void generate_keys() {
dgk_private_key = (DGKPrivateKey) dgk.getPrivate();
paillier_private_key = (PaillierPrivateKey) paillier.getPrivate();

dgk_public_key.writeKey("dgk.pub");
paillier_public_key.writeKey("paillier.pub");
dgk_private_key.writeKey("dgk");
paillier_private_key.writeKey("paillier");
//dgk_public_key.writeKey("dgk.pub");
//paillier_public_key.writeKey("paillier.pub");
//dgk_private_key.writeKey("dgk");
//paillier_private_key.writeKey("paillier");
}

public static String hash(String text) throws NoSuchAlgorithmException {
Expand All @@ -176,6 +172,13 @@ public static String hash(String text) throws NoSuchAlgorithmException {
return Base64.getEncoder().encodeToString(hash);
}

private void read_keys() {
dgk_public_key = DGKPublicKey.readKey("dgk.pub");
paillier_public_key = PaillierPublicKey.readKey("paillier.pub");
dgk_private_key = DGKPrivateKey.readKey("dgk");
paillier_private_key = PaillierPrivateKey.readKey("paillier");
}

// Used for set-up
private void communicate_with_server_site(PaillierPublicKey paillier, DGKPublicKey dgk)
throws IOException, ClassNotFoundException {
Expand Down Expand Up @@ -322,13 +325,6 @@ public void run() {
if (talk_to_server_site) {
generate_keys();
}
else {
// Read Keys on the pod...
dgk_public_key = DGKPublicKey.readKey("dgk.pub");
paillier_public_key = PaillierPublicKey.readKey("paillier.pub");
dgk_private_key = DGKPrivateKey.readKey("dgk");
paillier_private_key = PaillierPrivateKey.readKey("paillier");
}

feature = read_features(features_file, paillier_public_key, dgk_public_key, precision);

Expand Down

0 comments on commit b8497ba

Please sign in to comment.