Browse Source

rm outdated testing code. changed op names in CLI

Boyoung- 8 years ago
parent
commit
d1c5efbf92
59 changed files with 140 additions and 2042 deletions
  1. 24 145
      src/gc/GCRoute.java
  2. 55 0
      src/gc/GCUpdateRoot.java
  3. 0 202
      src/protocols/DeepestAndEmpty.java
  4. 2 2
      src/protocols/Eviction.java
  5. 0 132
      src/protocols/GarbledCircuit.java
  6. 0 133
      src/protocols/GarbledCircuitTest.java
  7. 0 264
      src/protocols/MakeCycle.java
  8. 4 4
      src/protocols/PreData.java
  9. 4 4
      src/protocols/PreEviction.java
  10. 4 4
      src/protocols/PreUpdateRoot.java
  11. 0 224
      src/protocols/PrepareDeepest.java
  12. 0 269
      src/protocols/PrepareTarget.java
  13. 1 1
      src/protocols/UpdateRoot.java
  14. 13 25
      src/ui/CLI.java
  15. 1 1
      test/protocols/TestAccess_C.java
  16. 1 1
      test/protocols/TestAccess_D.java
  17. 1 1
      test/protocols/TestAccess_E.java
  18. 0 50
      test/protocols/TestDeepestAndEmpty_C.java
  19. 0 50
      test/protocols/TestDeepestAndEmpty_D.java
  20. 0 50
      test/protocols/TestDeepestAndEmpty_E.java
  21. 1 1
      test/protocols/TestEviction_C.java
  22. 1 1
      test/protocols/TestEviction_D.java
  23. 1 1
      test/protocols/TestEviction_E.java
  24. 0 50
      test/protocols/TestMakeCycle_C.java
  25. 0 50
      test/protocols/TestMakeCycle_D.java
  26. 0 50
      test/protocols/TestMakeCycle_E.java
  27. 1 1
      test/protocols/TestPermuteIndex_C.java
  28. 1 1
      test/protocols/TestPermuteIndex_D.java
  29. 1 1
      test/protocols/TestPermuteIndex_E.java
  30. 1 1
      test/protocols/TestPermuteTarget_C.java
  31. 1 1
      test/protocols/TestPermuteTarget_D.java
  32. 1 1
      test/protocols/TestPermuteTarget_E.java
  33. 1 1
      test/protocols/TestPostProcessT_C.java
  34. 1 1
      test/protocols/TestPostProcessT_D.java
  35. 1 1
      test/protocols/TestPostProcessT_E.java
  36. 0 50
      test/protocols/TestPrepareDeepest_C.java
  37. 0 50
      test/protocols/TestPrepareDeepest_D.java
  38. 0 50
      test/protocols/TestPrepareDeepest_E.java
  39. 0 50
      test/protocols/TestPrepareTarget_C.java
  40. 0 50
      test/protocols/TestPrepareTarget_D.java
  41. 0 50
      test/protocols/TestPrepareTarget_E.java
  42. 1 1
      test/protocols/TestReshuffle_C.java
  43. 1 1
      test/protocols/TestReshuffle_D.java
  44. 1 1
      test/protocols/TestReshuffle_E.java
  45. 1 1
      test/protocols/TestRetrieve_C.java
  46. 1 1
      test/protocols/TestRetrieve_D.java
  47. 1 1
      test/protocols/TestRetrieve_E.java
  48. 1 1
      test/protocols/TestSSCOT_C.java
  49. 1 1
      test/protocols/TestSSCOT_D.java
  50. 1 1
      test/protocols/TestSSCOT_E.java
  51. 1 1
      test/protocols/TestSSIOT_C.java
  52. 1 1
      test/protocols/TestSSIOT_D.java
  53. 1 1
      test/protocols/TestSSIOT_E.java
  54. 1 1
      test/protocols/TestSSXOT_C.java
  55. 1 1
      test/protocols/TestSSXOT_D.java
  56. 1 1
      test/protocols/TestSSXOT_E.java
  57. 1 1
      test/protocols/TestUpdateRoot_C.java
  58. 1 1
      test/protocols/TestUpdateRoot_D.java
  59. 1 1
      test/protocols/TestUpdateRoot_E.java

+ 24 - 145
src/gc/GCLib.java → src/gc/GCRoute.java

@@ -5,14 +5,16 @@ import java.util.Arrays;
 import com.oblivm.backend.circuits.arithmetic.IntegerLib;
 import com.oblivm.backend.flexsc.CompEnv;
 
-public class GCLib<T> extends IntegerLib<T> {
+public class GCRoute<T> extends IntegerLib<T> {
 
 	private int d;
 	private int w;
 	private int logD;
 	private int logW;
 
-	public GCLib(CompEnv<T> e, int d, int w) {
+	// d: tree depth
+	// w: non-root bucket width
+	public GCRoute(CompEnv<T> e, int d, int w) {
 		super(e);
 		this.d = d;
 		this.w = w;
@@ -21,40 +23,31 @@ public class GCLib<T> extends IntegerLib<T> {
 																// empty tuple
 	}
 
-	private void zerosFollowedByOnes(T[] input) {
-		for (int i = input.length - 2; i >= 0; i--) {
-			input[i] = or(input[i], input[i + 1]);
+	public T[][][] routing(T[] Li, T[][] E_feBits, T[][] C_feBits, T[][][] E_tupleLabels, T[][][] C_tupleLabels,
+			T[][] delta) {
+		T[][] feBits = env.newTArray(d, 0);
+		T[][][] tupleLabels = env.newTArray(d, w, 0);
+		for (int i = 0; i < d; i++) {
+			feBits[i] = xor(E_feBits[i], C_feBits[i]);
+			for (int j = 0; j < w; j++) {
+				tupleLabels[i][j] = xor(E_tupleLabels[i][j], C_tupleLabels[i][j]);
+			}
 		}
-	}
-
-	public T[][] rootFindDeepestAndEmpty(T[] j1, T[] pathLabel, T[] E_feBits, T[] C_feBits, T[][] E_tupleLabels,
-			T[][] C_tupleLabels) {
-		int sLogW = (int) Math.ceil(Math.log(w) / Math.log(2));
-		T[] feBits = xor(E_feBits, C_feBits);
-		T[][] tupleLabels = env.newTArray(w, 0);
-		for (int j = 0; j < w; j++)
-			tupleLabels[j] = xor(E_tupleLabels[j], C_tupleLabels[j]);
 
-		T[] l = padSignal(ones(d - 1), d); // has sign bit
-		T[] j2 = zeros(sLogW); // no sign bit
-
-		for (int j = 0; j < w; j++) {
-			T[] tupleIndex = toSignals(j, sLogW);
-			T[] lz = xor(pathLabel, tupleLabels[j]);
-			zerosFollowedByOnes(lz);
-			lz = padSignal(lz, d); // add sign bit
+		T[][][] pd = prepareDeepest(Li, feBits, tupleLabels);
+		T[][][] ptai = prepareTargetAndIndex(pd[0], pd[1], pd[2], pd[3], delta);
+		T[][] target = makeCycle(ptai[0], ptai[2][0], ptai[2][1], ptai[2][2], ptai[2][3]);
 
-			T firstIf = and(feBits[j], less(lz, l));
-			l = mux(l, lz, firstIf);
-			j1 = mux(j1, tupleIndex, firstIf);
+		T[][][] output = env.newTArray(2, 0, 0);
+		output[0] = target;
+		output[1] = ptai[1];
+		return output;
+	}
 
-			j2 = mux(tupleIndex, j2, feBits[j]);
+	private void zerosFollowedByOnes(T[] input) {
+		for (int i = input.length - 2; i >= 0; i--) {
+			input[i] = or(input[i], input[i + 1]);
 		}
-
-		T[][] output = env.newTArray(2, 0);
-		output[0] = j1;
-		output[1] = j2;
-		return output;
 	}
 
 	public T[][] findDeepestAndEmpty(int i, T[] pathLabel, T[] feBits, T[][] tupleLabels) {
@@ -213,118 +206,4 @@ public class GCLib<T> extends IntegerLib<T> {
 
 		return target;
 	}
-
-	public T[][][] routing(T[] Li, T[][] E_feBits, T[][] C_feBits, T[][][] E_tupleLabels, T[][][] C_tupleLabels,
-			T[][] delta) {
-		T[][] feBits = env.newTArray(d, 0);
-		T[][][] tupleLabels = env.newTArray(d, w, 0);
-		for (int i = 0; i < d; i++) {
-			feBits[i] = xor(E_feBits[i], C_feBits[i]);
-			for (int j = 0; j < w; j++) {
-				tupleLabels[i][j] = xor(E_tupleLabels[i][j], C_tupleLabels[i][j]);
-			}
-		}
-
-		T[][][] pd = prepareDeepest(Li, feBits, tupleLabels);
-		T[][][] ptai = prepareTargetAndIndex(pd[0], pd[1], pd[2], pd[3], delta);
-		T[][] target = makeCycle(ptai[0], ptai[2][0], ptai[2][1], ptai[2][2], ptai[2][3]);
-
-		T[][][] output = env.newTArray(2, 0, 0);
-		output[0] = target;
-		output[1] = ptai[1];
-		return output;
-	}
-
-	//////////////////////////////////////////////////////////////////
-	//////////////////////////////////////////////////////////////////
-	//////////////////////////////////////////////////////////////////
-	///////////////////// belows are for testing /////////////////////
-	//////////////////////////////////////////////////////////////////
-	//////////////////////////////////////////////////////////////////
-	//////////////////////////////////////////////////////////////////
-
-	public T[][] findDeepestAndEmpty(int i, T[] pathLabel, T[] E_feBits, T[] C_feBits, T[][] E_tupleLabels,
-			T[][] C_tupleLabels) {
-		T[] feBits = xor(E_feBits, C_feBits);
-		T[][] tupleLabels = env.newTArray(w, 0);
-		for (int j = 0; j < w; j++)
-			tupleLabels[j] = xor(E_tupleLabels[j], C_tupleLabels[j]);
-
-		T[] l = padSignal(ones(d - 1 - i), d); // has sign bit
-		T[] j1 = zeros(logW); // no sign bit
-		T[] j2 = zeros(logW);
-		T[] et = zeros(1);
-
-		for (int j = 0; j < w; j++) {
-			T[] tupleIndex = toSignals(j, logW);
-			T[] lz = xor(pathLabel, tupleLabels[j]);
-			zerosFollowedByOnes(lz);
-			lz = padSignal(lz, d); // add sign bit
-
-			T firstIf = and(feBits[j], less(lz, l));
-			l = mux(l, lz, firstIf);
-			j1 = mux(j1, tupleIndex, firstIf);
-
-			et = mux(ones(1), et, feBits[j]);
-			j2 = mux(tupleIndex, j2, feBits[j]);
-		}
-
-		T[] l_p = numberOfOnes(not(Arrays.copyOfRange(l, 0, d - 1))); // has
-																		// sign
-																		// bit
-
-		T[][] output = env.newTArray(4, 0);
-		output[0] = l_p;
-		output[1] = padSignal(j1, logW + 1); // add sign bit
-		output[2] = padSignal(j2, logW + 1);
-		output[3] = et;
-		return output;
-	}
-
-	public T[][][] prepareDeepest(T[] Li, T[][] E_feBits, T[][] C_feBits, T[][][] E_tupleLabels,
-			T[][][] C_tupleLabels) {
-		T[] perpD = ones(logD + 1);
-		T[][][] output = env.newTArray(4, d, 0);
-
-		T[][] deepest = env.newTArray(d, 0);
-		for (int j = 0; j < d; j++)
-			deepest[j] = perpD;
-		T[] src = perpD;
-		T[] goal = perpD; // \perp = -1 in 2's complement form
-
-		for (int i = 0; i < d; i++) {
-			T[] index = toSignals(i, logD + 1);
-			deepest[i] = mux(deepest[i], src, geq(goal, index));
-
-			T[][] dae = findDeepestAndEmpty(i, Li, E_feBits[i], C_feBits[i], E_tupleLabels[i], C_tupleLabels[i]);
-			T[] l = dae[0];
-			output[1][i] = dae[1];
-			output[2][i] = dae[2];
-			output[3][i] = dae[3];
-
-			T lGreaterGoal = greater(l, goal);
-			goal = mux(goal, l, lGreaterGoal);
-			src = mux(src, index, lGreaterGoal);
-		}
-
-		output[0] = deepest;
-		return output;
-	}
-
-	public T[][][] combineDeepestAndTarget(T[] Li, T[][] E_feBits, T[][] C_feBits, T[][][] E_tupleLabels,
-			T[][][] C_tupleLabels, T[][] delta) {
-		T[][][] out = prepareDeepest(Li, E_feBits, C_feBits, E_tupleLabels, C_tupleLabels);
-		return prepareTargetAndIndex(out[0], out[1], out[2], out[3], delta);
-	}
-
-	public T[][][] combineDeepestTargetCycle(T[] Li, T[][] E_feBits, T[][] C_feBits, T[][][] E_tupleLabels,
-			T[][][] C_tupleLabels, T[][] delta) {
-		T[][][] out = combineDeepestAndTarget(Li, E_feBits, C_feBits, E_tupleLabels, C_tupleLabels, delta);
-		makeCycle(out[0], out[2][0], out[2][1], out[2][2], out[2][3]);
-
-		T[][][] output = env.newTArray(2, 0, 0);
-		output[0] = out[0];
-		output[1] = out[1];
-		return output;
-	}
 }

+ 55 - 0
src/gc/GCUpdateRoot.java

@@ -0,0 +1,55 @@
+package gc;
+
+import com.oblivm.backend.circuits.arithmetic.IntegerLib;
+import com.oblivm.backend.flexsc.CompEnv;
+
+public class GCUpdateRoot<T> extends IntegerLib<T> {
+
+	private int d;
+	private int sw;
+	private int logSW;
+
+	// d: tree depth
+	// sw: root bucket width
+	public GCUpdateRoot(CompEnv<T> e, int d, int sw) {
+		super(e);
+		this.d = d;
+		this.sw = sw;
+		logSW = (int) Math.ceil(Math.log(sw) / Math.log(2));
+	}
+
+	private void zerosFollowedByOnes(T[] input) {
+		for (int i = input.length - 2; i >= 0; i--) {
+			input[i] = or(input[i], input[i + 1]);
+		}
+	}
+
+	public T[][] rootFindDeepestAndEmpty(T[] j1, T[] pathLabel, T[] E_feBits, T[] C_feBits, T[][] E_tupleLabels,
+			T[][] C_tupleLabels) {
+		T[] feBits = xor(E_feBits, C_feBits);
+		T[][] tupleLabels = env.newTArray(sw, 0);
+		for (int j = 0; j < sw; j++)
+			tupleLabels[j] = xor(E_tupleLabels[j], C_tupleLabels[j]);
+
+		T[] l = padSignal(ones(d - 1), d); // has sign bit
+		T[] j2 = zeros(logSW); // no sign bit
+
+		for (int j = 0; j < sw; j++) {
+			T[] tupleIndex = toSignals(j, logSW);
+			T[] lz = xor(pathLabel, tupleLabels[j]);
+			zerosFollowedByOnes(lz);
+			lz = padSignal(lz, d); // add sign bit
+
+			T firstIf = and(feBits[j], less(lz, l));
+			l = mux(l, lz, firstIf);
+			j1 = mux(j1, tupleIndex, firstIf);
+
+			j2 = mux(tupleIndex, j2, feBits[j]);
+		}
+
+		T[][] output = env.newTArray(2, 0);
+		output[0] = j1;
+		output[1] = j2;
+		return output;
+	}
+}

+ 0 - 202
src/protocols/DeepestAndEmpty.java

@@ -1,202 +0,0 @@
-package protocols;
-
-import java.math.BigInteger;
-
-import com.oblivm.backend.flexsc.CompEnv;
-import com.oblivm.backend.gc.GCGenComp;
-import com.oblivm.backend.gc.GCSignal;
-import com.oblivm.backend.gc.regular.GCEva;
-import com.oblivm.backend.gc.regular.GCGen;
-import com.oblivm.backend.network.Network;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.NoSuchPartyException;
-import gc.GCLib;
-import oram.Forest;
-import oram.Metadata;
-import util.Util;
-
-public class DeepestAndEmpty extends Protocol {
-
-	private int d = 10;
-	private int w = 8;
-
-	public DeepestAndEmpty(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	private GCSignal[] revSelectKeys(GCSignal[][] pairs, byte[] input) {
-		BigInteger in = new BigInteger(1, input);
-		GCSignal[] out = new GCSignal[pairs.length];
-		for (int i = 0; i < pairs.length; i++)
-			out[i] = pairs[i][in.testBit(i) ? 1 : 0];
-		return out;
-	}
-
-	private GCSignal[] selectKeys(GCSignal[][] pairs, byte[] input) {
-		BigInteger in = new BigInteger(1, input);
-		GCSignal[] out = new GCSignal[pairs.length];
-		for (int i = 0; i < pairs.length; i++)
-			out[i] = pairs[i][in.testBit(pairs.length - 1 - i) ? 1 : 0];
-		return out;
-	}
-
-	private GCSignal[][] genKeyPairs(int n) {
-		GCSignal[][] pairs = new GCSignal[n][];
-		for (int i = 0; i < n; i++)
-			pairs[i] = GCGenComp.genPair();
-		return pairs;
-	}
-
-	private GCSignal[] getZeroKeys(GCSignal[][] pairs) {
-		GCSignal[] keys = new GCSignal[pairs.length];
-		for (int i = 0; i < keys.length; i++)
-			keys[i] = pairs[i][0];
-		return keys;
-	}
-
-	private BigInteger decodeOutput(GCSignal[] out1, GCSignal[] out2) {
-		BigInteger output = BigInteger.ZERO;
-		for (int i = 0; i < out1.length; i++) {
-			if (out2[i].isPublic()) {
-				if (out2[i].v)
-					output = output.setBit(i);
-			} else if (out1[i].equals(out2[i])) {
-				;
-			} else if (out1[i].equals(GCGenComp.R.xor(out2[i]))) {
-				output = output.setBit(i);
-			} else {
-				System.err.println("ERROR on GC output!");
-				return null;
-			}
-		}
-		return output;
-	}
-
-	private String addZeros(String a, int n) {
-		String out = a;
-		for (int i = 0; i < n - a.length(); i++)
-			out = "0" + out;
-		return out;
-	}
-
-	public void runE() {
-		int i = Crypto.sr.nextInt(d);
-		byte[] Li = Util.nextBytes((d - 1 + 7) / 8, Crypto.sr);
-		byte[] feBits = Util.nextBytes((w + 7) / 8, Crypto.sr);
-		byte[][] tupleLabels = new byte[w][];
-		for (int j = 0; j < w; j++)
-			tupleLabels[j] = Util.nextBytes((d - 1 + 7) / 8, Crypto.sr);
-
-		GCSignal[][] LiKeyPairs = genKeyPairs(d - 1);
-		GCSignal[][] E_feKeyPairs = genKeyPairs(w);
-		GCSignal[][] C_feKeyPairs = genKeyPairs(w);
-		GCSignal[] LiZeroKeys = getZeroKeys(LiKeyPairs);
-		GCSignal[] E_feZeroKeys = getZeroKeys(E_feKeyPairs);
-		GCSignal[] C_feZeroKeys = getZeroKeys(C_feKeyPairs);
-		GCSignal[] LiKeyInput = revSelectKeys(LiKeyPairs, Li);
-		GCSignal[] E_feKeyInput = selectKeys(E_feKeyPairs, feBits);
-
-		GCSignal[][][] E_labelKeyPairs = new GCSignal[w][][];
-		GCSignal[][][] C_labelKeyPairs = new GCSignal[w][][];
-		GCSignal[][] E_labelZeroKeys = new GCSignal[w][];
-		GCSignal[][] C_labelZeroKeys = new GCSignal[w][];
-		GCSignal[][] E_labelKeyInput = new GCSignal[w][];
-		for (int j = 0; j < w; j++) {
-			E_labelKeyPairs[j] = genKeyPairs(d - 1);
-			C_labelKeyPairs[j] = genKeyPairs(d - 1);
-			E_labelZeroKeys[j] = getZeroKeys(E_labelKeyPairs[j]);
-			C_labelZeroKeys[j] = getZeroKeys(C_labelKeyPairs[j]);
-			E_labelKeyInput[j] = revSelectKeys(E_labelKeyPairs[j], tupleLabels[j]);
-		}
-
-		con1.write(i);
-		con1.write(LiKeyInput);
-		con1.write(E_feKeyInput);
-		con1.write(C_feZeroKeys);
-		con1.write(E_labelKeyInput);
-		con1.write(C_labelZeroKeys);
-
-		Network channel = new Network(null, con1);
-		CompEnv<GCSignal> gen = new GCGen(channel);
-		GCSignal[][] E_out = new GCLib<GCSignal>(gen, d, w).findDeepestAndEmpty(i, LiZeroKeys, E_feZeroKeys,
-				C_feZeroKeys, E_labelZeroKeys, C_labelZeroKeys);
-
-		GCSignal[][] D_out = con1.readObject();
-
-		int l = decodeOutput(E_out[0], D_out[0]).intValue();
-		int j1 = decodeOutput(E_out[1], D_out[1]).intValue();
-		int j2 = decodeOutput(E_out[2], D_out[2]).intValue();
-		int et = decodeOutput(E_out[3], D_out[3]).intValue();
-
-		System.out.println("i=" + i);
-
-		System.out.print("full tuples: ");
-		BigInteger fe = new BigInteger(1, feBits);
-		for (int j = 0; j < w; j++)
-			if (fe.testBit(w - 1 - j))
-				System.out.print(j + " ");
-		System.out.println();
-		System.out.print("empty tuples: ");
-		for (int j = 0; j < w; j++)
-			if (!fe.testBit(w - 1 - j))
-				System.out.print(j + " ");
-		System.out.println();
-
-		System.out.println("tuple labels xor path label:");
-		BigInteger pathLabel = new BigInteger(1, Li);
-		for (int j = 0; j < w; j++) {
-			BigInteger xor = Util.getSubBits(new BigInteger(1, tupleLabels[j]).xor(pathLabel), d - 1, 0);
-			System.out.println(j + ": " + addZeros(xor.toString(2), d - 1));
-		}
-
-		System.out.println();
-		System.out.println("deepest level: " + l);
-		System.out.println("deepest tuple index: " + j1);
-		System.out.println("empty tuple index: " + j2);
-		System.out.println("empty tuple exists: " + et);
-	}
-
-	public void runD() {
-		int i = con1.readObject();
-		GCSignal[] LiKeyInput = con1.readObject();
-		GCSignal[] E_feKeyInput = con1.readObject();
-		GCSignal[] C_feZeroKeys = con1.readObject();
-		GCSignal[][] E_labelKeyInput = con1.readObject();
-		GCSignal[][] C_labelZeroKeys = con1.readObject();
-
-		Network channel = new Network(con1, null);
-		CompEnv<GCSignal> gen = new GCEva(channel);
-		GCLib<GCSignal> dae = new GCLib<GCSignal>(gen, d, w);
-		dae.findDeepestAndEmpty(i, LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput, C_labelZeroKeys);
-
-		gen.setEvaluate();
-		GCSignal[][] D_out = dae.findDeepestAndEmpty(i, LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput,
-				C_labelZeroKeys);
-
-		con1.write(D_out);
-	}
-
-	public void runC() {
-
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-
-		if (party == Party.Eddie) {
-			runE();
-
-		} else if (party == Party.Debbie) {
-			runD();
-
-		} else if (party == Party.Charlie) {
-			runC();
-
-		} else {
-			throw new NoSuchPartyException(party + "");
-		}
-	}
-}

+ 2 - 2
src/protocols/Eviction.java

@@ -122,8 +122,8 @@ public class Eviction extends Protocol {
 		GCSignal[][] C_feInputKeys = con2.readObject();
 		GCSignal[][][] C_labelInputKeys = con2.readObject();
 
-		GCSignal[][][] outKeys = predata.evict_gc.routing(LiInputKeys, E_feInputKeys, C_feInputKeys, E_labelInputKeys,
-				C_labelInputKeys, deltaInputKeys);
+		GCSignal[][][] outKeys = predata.evict_gcroute.routing(LiInputKeys, E_feInputKeys, C_feInputKeys,
+				E_labelInputKeys, C_labelInputKeys, deltaInputKeys);
 
 		int[] ti_p = new int[deltaInputKeys.length];
 		for (int i = 0; i < ti_p.length; i++) {

+ 0 - 132
src/protocols/GarbledCircuit.java

@@ -1,132 +0,0 @@
-package protocols;
-
-import com.oblivm.backend.circuits.arithmetic.IntegerLib;
-import com.oblivm.backend.flexsc.CompEnv;
-import com.oblivm.backend.gc.GCGenComp;
-import com.oblivm.backend.gc.GCSignal;
-import com.oblivm.backend.gc.regular.GCEva;
-import com.oblivm.backend.gc.regular.GCGen;
-import com.oblivm.backend.network.Network;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.NoSuchPartyException;
-import oram.Forest;
-import oram.Metadata;
-
-public class GarbledCircuit extends Protocol {
-
-	private int totalLength = 1000;
-
-	public GarbledCircuit(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	private int countOnes(boolean[] in) {
-		int cnt = 0;
-		for (int i = 0; i < in.length; i++)
-			if (in[i])
-				cnt++;
-		return cnt;
-	}
-
-	private int booleansToInt(boolean[] arr) {
-		int n = 0;
-		for (int i = arr.length - 1; i >= 0; i--)
-			n = (n << 1) | (arr[i] ? 1 : 0);
-		return n;
-	}
-
-	public void runE() {
-		Network w = new Network(null, con1);
-		CompEnv<GCSignal> gen = new GCGen(w);
-
-		boolean[] input1 = new boolean[totalLength];
-		boolean[] input2 = new boolean[totalLength];
-		boolean[] input = new boolean[totalLength];
-		for (int i = 0; i < input1.length; ++i) {
-			input1[i] = CompEnv.rnd.nextBoolean();
-			input2[i] = CompEnv.rnd.nextBoolean();
-			input[i] = input1[i] ^ input2[i];
-		}
-
-		GCSignal[][] inputKeyPairs1 = new GCSignal[input1.length][];
-		GCSignal[] localInputKeys1 = new GCSignal[input1.length];
-		GCSignal[][] inputKeyPairs2 = new GCSignal[input1.length][];
-		GCSignal[] localInputKeys2 = new GCSignal[input1.length];
-		GCSignal[] inputE = new GCSignal[input1.length];
-		GCSignal[] inputD = new GCSignal[input1.length];
-		for (int i = 0; i < input1.length; i++) {
-			inputKeyPairs1[i] = GCGenComp.genPair();
-			localInputKeys1[i] = inputKeyPairs1[i][0];
-			inputKeyPairs2[i] = GCGenComp.genPair();
-			localInputKeys2[i] = inputKeyPairs2[i][0];
-
-			inputE[i] = input1[i] ? inputKeyPairs1[i][1] : inputKeyPairs1[i][0];
-			inputD[i] = input2[i] ? inputKeyPairs2[i][1] : inputKeyPairs2[i][0];
-		}
-
-		GCSignal[] outputE = new IntegerLib<GCSignal>(gen).hammingDistance(localInputKeys1, localInputKeys2);
-
-		con1.write(inputE);
-		con1.write(inputD);
-
-		GCSignal[] outputD = con1.readObject();
-
-		boolean[] output = new boolean[totalLength];
-		for (int i = 0; i < outputE.length; i++) {
-			if (outputE[i].isPublic())
-				output[i] = outputE[i].v;
-			else if (outputE[i].equals(outputD[i]))
-				output[i] = false;
-			else if (outputD[i].equals(GCGenComp.R.xor(outputE[i])))
-				output[i] = true;
-			else
-				System.err.println("ERROR on GC output!");
-		}
-
-		int inCnt = countOnes(input);
-		int outCnt = booleansToInt(output);
-		System.out.println((inCnt == outCnt) + " " + inCnt + " " + outCnt);
-	}
-
-	public void runD() {
-		Network w = new Network(con1, null);
-		CompEnv<GCSignal> gen = new GCEva(w);
-
-		GCSignal[] randomInput = new GCSignal[totalLength];
-		for (int i = 0; i < randomInput.length; i++)
-			randomInput[i] = GCSignal.freshLabel(Crypto.sr);
-		IntegerLib<GCSignal> il = new IntegerLib<GCSignal>(gen);
-		il.hammingDistance(randomInput, randomInput);
-
-		GCSignal[] inputE = con1.readObject();
-		GCSignal[] inputD = con1.readObject();
-
-		gen.setEvaluate();
-		GCSignal[] outputD = il.hammingDistance(inputE, inputD);
-
-		con1.write(outputD);
-	}
-
-	public void runC() {
-
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		if (party == Party.Eddie) {
-			runE();
-
-		} else if (party == Party.Debbie) {
-			runD();
-
-		} else if (party == Party.Charlie) {
-			runC();
-
-		} else {
-			throw new NoSuchPartyException(party + "");
-		}
-	}
-}

+ 0 - 133
src/protocols/GarbledCircuitTest.java

@@ -1,133 +0,0 @@
-package protocols;
-
-import com.oblivm.backend.circuits.arithmetic.IntegerLib;
-import com.oblivm.backend.flexsc.CompEnv;
-import com.oblivm.backend.gc.GCGenComp;
-import com.oblivm.backend.gc.GCSignal;
-import com.oblivm.backend.gc.regular.GCEva;
-import com.oblivm.backend.gc.regular.GCGen;
-import com.oblivm.backend.network.Network;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.NoSuchPartyException;
-import oram.Forest;
-import oram.Metadata;
-
-public class GarbledCircuitTest extends Protocol {
-
-	private int totalLength = 2;
-
-	public GarbledCircuitTest(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	private int countOnes(boolean[] in) {
-		int cnt = 0;
-		for (int i = 0; i < in.length; i++)
-			if (in[i])
-				cnt++;
-		return cnt;
-	}
-
-	private int booleansToInt(boolean[] arr) {
-		int n = 0;
-		for (int i = arr.length - 1; i >= 0; i--)
-			n = (n << 1) | (arr[i] ? 1 : 0);
-		return n;
-	}
-
-	public void runE() {
-		Network w = new Network(null, con1);
-		CompEnv<GCSignal> gen = new GCGen(w);
-
-		boolean[] input1 = new boolean[totalLength];
-		boolean[] input2 = new boolean[totalLength];
-		boolean[] input = new boolean[totalLength];
-		for (int i = 0; i < input1.length; ++i) {
-			input1[i] = false;
-			input2[i] = true;
-			input[i] = input1[i] ^ input2[i];
-		}
-
-		GCSignal[][] inputKeyPairs1 = new GCSignal[input1.length][];
-		GCSignal[] localInputKeys1 = new GCSignal[input1.length];
-		GCSignal[][] inputKeyPairs2 = new GCSignal[input1.length][];
-		GCSignal[] localInputKeys2 = new GCSignal[input1.length];
-		GCSignal[] inputE = new GCSignal[input1.length];
-		GCSignal[] inputD = new GCSignal[input1.length];
-		for (int i = 0; i < input1.length; i++) {
-			inputKeyPairs1[i] = GCGenComp.genPair();
-			localInputKeys1[i] = inputKeyPairs1[i][0];
-			inputKeyPairs2[i] = GCGenComp.genPair();
-			localInputKeys2[i] = inputKeyPairs2[i][0];
-
-			inputE[i] = input1[i] ? inputKeyPairs1[i][1] : inputKeyPairs1[i][0];
-			inputD[i] = input2[i] ? inputKeyPairs2[i][1] : inputKeyPairs2[i][0];
-		}
-
-		GCSignal[] outputE = new GCSignal[] { new IntegerLib<GCSignal>(gen).less(localInputKeys1, localInputKeys2) };
-
-		con1.write(inputE);
-		con1.write(inputD);
-
-		GCSignal[] outputD = con1.readObject();
-
-		boolean[] output = new boolean[totalLength];
-		for (int i = 0; i < outputE.length; i++) {
-			if (outputE[i].isPublic())
-				output[i] = outputE[i].v;
-			else if (outputE[i].equals(outputD[i]))
-				output[i] = false;
-			else if (outputD[i].equals(GCGenComp.R.xor(outputE[i])))
-				output[i] = true;
-			else
-				System.err.println("ERROR on GC output!");
-		}
-
-		// int inCnt = countOnes(input);
-		// int outCnt = booleansToInt(output);
-		// System.out.println((inCnt == outCnt) + " " + inCnt + " " + outCnt);
-		System.out.println(output[0]);
-	}
-
-	public void runD() {
-		Network w = new Network(con1, null);
-		CompEnv<GCSignal> gen = new GCEva(w);
-
-		GCSignal[] randomInput = new GCSignal[totalLength];
-		for (int i = 0; i < randomInput.length; i++)
-			randomInput[i] = GCSignal.freshLabel(Crypto.sr);
-		IntegerLib<GCSignal> il = new IntegerLib<GCSignal>(gen);
-		il.less(randomInput, randomInput);
-
-		GCSignal[] inputE = con1.readObject();
-		GCSignal[] inputD = con1.readObject();
-
-		gen.setEvaluate();
-		GCSignal[] outputD = new GCSignal[] { il.less(inputE, inputD) };
-
-		con1.write(outputD);
-	}
-
-	public void runC() {
-
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		if (party == Party.Eddie) {
-			runE();
-
-		} else if (party == Party.Debbie) {
-			runD();
-
-		} else if (party == Party.Charlie) {
-			runC();
-
-		} else {
-			throw new NoSuchPartyException(party + "");
-		}
-	}
-}

+ 0 - 264
src/protocols/MakeCycle.java

@@ -1,264 +0,0 @@
-package protocols;
-
-import java.math.BigInteger;
-
-import com.oblivm.backend.flexsc.CompEnv;
-import com.oblivm.backend.gc.GCGenComp;
-import com.oblivm.backend.gc.GCSignal;
-import com.oblivm.backend.gc.regular.GCEva;
-import com.oblivm.backend.gc.regular.GCGen;
-import com.oblivm.backend.network.Network;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.NoSuchPartyException;
-import gc.GCLib;
-import oram.Forest;
-import oram.Metadata;
-import util.Util;
-
-public class MakeCycle extends Protocol {
-
-	private int d = 10;
-	private int w = 8;
-	private int logD = (int) Math.ceil(Math.log(d) / Math.log(2));
-
-	public MakeCycle(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	private GCSignal[] revSelectKeys(GCSignal[][] pairs, byte[] input) {
-		BigInteger in = new BigInteger(1, input);
-		GCSignal[] out = new GCSignal[pairs.length];
-		for (int i = 0; i < pairs.length; i++)
-			out[i] = pairs[i][in.testBit(i) ? 1 : 0];
-		return out;
-	}
-
-	private GCSignal[] selectKeys(GCSignal[][] pairs, byte[] input) {
-		BigInteger in = new BigInteger(1, input);
-		GCSignal[] out = new GCSignal[pairs.length];
-		for (int i = 0; i < pairs.length; i++)
-			out[i] = pairs[i][in.testBit(pairs.length - 1 - i) ? 1 : 0];
-		return out;
-	}
-
-	private GCSignal[][] genKeyPairs(int n) {
-		GCSignal[][] pairs = new GCSignal[n][];
-		for (int i = 0; i < n; i++)
-			pairs[i] = GCGenComp.genPair();
-		return pairs;
-	}
-
-	private GCSignal[] getZeroKeys(GCSignal[][] pairs) {
-		GCSignal[] keys = new GCSignal[pairs.length];
-		for (int i = 0; i < keys.length; i++)
-			keys[i] = pairs[i][0];
-		return keys;
-	}
-
-	private BigInteger decodeOutput(GCSignal[] out1, GCSignal[] out2) {
-		BigInteger output = BigInteger.ZERO;
-		for (int i = 0; i < out1.length; i++) {
-			if (out2[i].isPublic()) {
-				if (out2[i].v)
-					output = output.setBit(i);
-			} else if (out1[i].equals(out2[i])) {
-				;
-			} else if (out1[i].equals(GCGenComp.R.xor(out2[i]))) {
-				output = output.setBit(i);
-			} else {
-				System.err.println("ERROR on GC output!");
-				return null;
-			}
-		}
-		return output;
-	}
-
-	private String addZeros(String a, int n) {
-		String out = a;
-		for (int i = 0; i < n - a.length(); i++)
-			out = "0" + out;
-		return out;
-	}
-
-	public void runE() {
-		int logW = (int) Math.ceil(Math.log(w + 1) / Math.log(2));
-		byte[] Li = Util.nextBytes((d - 1 + 7) / 8, Crypto.sr);
-
-		byte[][] feBits = new byte[d][];
-		byte[][][] tupleLabels = new byte[d][w][];
-
-		GCSignal[][] LiKeyPairs = genKeyPairs(d - 1);
-		GCSignal[] LiZeroKeys = getZeroKeys(LiKeyPairs);
-		GCSignal[] LiKeyInput = revSelectKeys(LiKeyPairs, Li);
-
-		GCSignal[][][] deltaKeyPairs = new GCSignal[d][][];
-		GCSignal[][] deltaZeroKeys = new GCSignal[d][];
-
-		GCSignal[][][] E_feKeyPairs = new GCSignal[d][][];
-		GCSignal[][][] C_feKeyPairs = new GCSignal[d][][];
-		GCSignal[][] E_feZeroKeys = new GCSignal[d][];
-		GCSignal[][] C_feZeroKeys = new GCSignal[d][];
-		GCSignal[][] E_feKeyInput = new GCSignal[d][];
-
-		GCSignal[][][][] E_labelKeyPairs = new GCSignal[d][w][][];
-		GCSignal[][][][] C_labelKeyPairs = new GCSignal[d][w][][];
-		GCSignal[][][] E_labelZeroKeys = new GCSignal[d][w][];
-		GCSignal[][][] C_labelZeroKeys = new GCSignal[d][w][];
-		GCSignal[][][] E_labelKeyInput = new GCSignal[d][w][];
-
-		for (int i = 0; i < d; i++) {
-			deltaKeyPairs[i] = genKeyPairs(logW);
-			deltaZeroKeys[i] = getZeroKeys(deltaKeyPairs[i]);
-
-			feBits[i] = Util.nextBytes((w + 7) / 8, Crypto.sr);
-			// feBits[i] = new byte[(w + 7) / 8];
-			for (int j = 0; j < w; j++)
-				tupleLabels[i][j] = Util.nextBytes((d - 1 + 7) / 8, Crypto.sr);
-
-			E_feKeyPairs[i] = genKeyPairs(w);
-			C_feKeyPairs[i] = genKeyPairs(w);
-			E_feZeroKeys[i] = getZeroKeys(E_feKeyPairs[i]);
-			C_feZeroKeys[i] = getZeroKeys(C_feKeyPairs[i]);
-			E_feKeyInput[i] = selectKeys(E_feKeyPairs[i], feBits[i]);
-
-			for (int j = 0; j < w; j++) {
-				E_labelKeyPairs[i][j] = genKeyPairs(d - 1);
-				C_labelKeyPairs[i][j] = genKeyPairs(d - 1);
-				E_labelZeroKeys[i][j] = getZeroKeys(E_labelKeyPairs[i][j]);
-				C_labelZeroKeys[i][j] = getZeroKeys(C_labelKeyPairs[i][j]);
-				E_labelKeyInput[i][j] = revSelectKeys(E_labelKeyPairs[i][j], tupleLabels[i][j]);
-			}
-		}
-
-		con1.write(LiKeyInput);
-		con1.write(E_feKeyInput);
-		con1.write(C_feZeroKeys);
-		con1.write(E_labelKeyInput);
-		con1.write(C_labelZeroKeys);
-		con1.write(deltaZeroKeys);
-
-		Network channel = new Network(null, con1);
-
-		CompEnv<GCSignal> gen1 = new GCGen(channel);
-		GCSignal[][][] E_out1 = new GCLib<GCSignal>(gen1, d, w).combineDeepestAndTarget(LiZeroKeys, E_feZeroKeys,
-				C_feZeroKeys, E_labelZeroKeys, C_labelZeroKeys, deltaZeroKeys);
-
-		GCSignal[][][] D_out1 = con1.readObject();
-
-		CompEnv<GCSignal> gen = new GCGen(channel);
-		GCSignal[][][] E_out = new GCLib<GCSignal>(gen, d, w).combineDeepestTargetCycle(LiZeroKeys, E_feZeroKeys,
-				C_feZeroKeys, E_labelZeroKeys, C_labelZeroKeys, deltaZeroKeys);
-
-		GCSignal[][][] D_out = con1.readObject();
-
-		int[] target1 = new int[d];
-		int[] f1 = new int[d];
-		int[] target2 = new int[d];
-		int[] f2 = new int[d];
-
-		int nTop = decodeOutput(E_out1[2][0], D_out1[2][0]).intValue();
-		int nBot = decodeOutput(E_out1[2][1], D_out1[2][1]).intValue();
-		int eTop = decodeOutput(E_out1[2][2], D_out1[2][2]).intValue();
-		int eBot = decodeOutput(E_out1[2][3], D_out1[2][3]).intValue();
-
-		for (int i = 0; i < d; i++) {
-			target2[i] = decodeOutput(E_out[0][i], D_out[0][i]).intValue();
-			f2[i] = decodeOutput(E_out[1][i], D_out[1][i]).intValue();
-
-			target1[i] = decodeOutput(E_out1[0][i], D_out1[0][i]).intValue();
-			f1[i] = decodeOutput(E_out1[1][i], D_out1[1][i]).intValue();
-
-			System.out.println("i=" + i);
-
-			System.out.print("full tuples: ");
-			BigInteger fe = new BigInteger(1, feBits[i]);
-			for (int j = 0; j < w; j++)
-				if (fe.testBit(w - 1 - j))
-					System.out.print(j + " ");
-			System.out.println();
-			System.out.print("empty tuples: ");
-			for (int j = 0; j < w; j++)
-				if (!fe.testBit(w - 1 - j))
-					System.out.print(j + " ");
-			System.out.println();
-
-			System.out.println("tuple labels xor path label:");
-			BigInteger pathLabel = new BigInteger(1, Li);
-			for (int j = 0; j < w; j++) {
-				BigInteger xor = Util.getSubBits(new BigInteger(1, tupleLabels[i][j]).xor(pathLabel), d - 1, 0);
-				System.out.println(j + ": " + addZeros(xor.toString(2), d - 1));
-			}
-
-			int perp = (int) (Math.pow(2, logD + 1)) - 1;
-
-			System.out.println();
-			System.out.println("target1[i]: " + ((target1[i] == perp) ? "\\perp" : "" + target1[i]));
-			System.out.println("f1[i]: " + f1[i]);
-			System.out.println("target2[i]: " + ((target2[i] == perp) ? "\\perp" : "" + target2[i]));
-			System.out.println("f2[i]: " + f2[i]);
-
-			System.out.println();
-		}
-		System.out.println("nTop: " + nTop);
-		System.out.println("nBot: " + nBot);
-		System.out.println("eTop: " + eTop);
-		System.out.println("eBot: " + eBot);
-	}
-
-	public void runD() {
-		GCSignal[] LiKeyInput = con1.readObject();
-		GCSignal[][] E_feKeyInput = con1.readObject();
-		GCSignal[][] C_feZeroKeys = con1.readObject();
-		GCSignal[][][] E_labelKeyInput = con1.readObject();
-		GCSignal[][][] C_labelZeroKeys = con1.readObject();
-		GCSignal[][] deltaZeroKeys = con1.readObject();
-
-		Network channel = new Network(con1, null);
-
-		CompEnv<GCSignal> gen1 = new GCEva(channel);
-		GCLib<GCSignal> dae1 = new GCLib<GCSignal>(gen1, d, w);
-		dae1.combineDeepestAndTarget(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput, C_labelZeroKeys,
-				deltaZeroKeys);
-
-		gen1.setEvaluate();
-		GCSignal[][][] D_out1 = dae1.combineDeepestAndTarget(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput,
-				C_labelZeroKeys, deltaZeroKeys);
-
-		con1.write(D_out1);
-
-		CompEnv<GCSignal> gen = new GCEva(channel);
-		GCLib<GCSignal> dae = new GCLib<GCSignal>(gen, d, w);
-		dae.combineDeepestTargetCycle(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput, C_labelZeroKeys,
-				deltaZeroKeys);
-
-		gen.setEvaluate();
-		GCSignal[][][] D_out = dae.combineDeepestTargetCycle(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput,
-				C_labelZeroKeys, deltaZeroKeys);
-
-		con1.write(D_out);
-	}
-
-	public void runC() {
-
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-
-		if (party == Party.Eddie) {
-			runE();
-
-		} else if (party == Party.Debbie) {
-			runD();
-
-		} else if (party == Party.Charlie) {
-			runC();
-
-		} else {
-			throw new NoSuchPartyException(party + "");
-		}
-	}
-}

+ 4 - 4
src/protocols/PreData.java

@@ -5,7 +5,8 @@ import java.math.BigInteger;
 import com.oblivm.backend.gc.GCSignal;
 
 import crypto.PRF;
-import gc.GCLib;
+import gc.GCRoute;
+import gc.GCUpdateRoot;
 import oram.Tuple;
 
 public class PreData {
@@ -50,7 +51,7 @@ public class PreData {
 	public GCSignal[][][] ur_E_labelKeyPairs;
 	public GCSignal[][][] ur_C_labelKeyPairs;
 	public BigInteger[][] ur_outKeyHashes;
-	public GCLib<GCSignal> ur_gc;
+	public GCUpdateRoot<GCSignal> ur_gcur;
 
 	public GCSignal[][] evict_LiKeyPairs;
 	public GCSignal[][][] evict_E_feKeyPairs;
@@ -60,13 +61,12 @@ public class PreData {
 	public GCSignal[][][] evict_deltaKeyPairs;
 	public BigInteger[][] evict_tiOutKeyHashes;
 	public GCSignal[][][] evict_targetOutKeyPairs;
-	public GCLib<GCSignal> evict_gc;
+	public GCRoute<GCSignal> evict_gcroute;
 	public int[] evict_pi;
 	public BigInteger[] evict_delta;
 	public BigInteger[] evict_rho;
 	public int[][] evict_delta_p;
 	public int[][] evict_rho_p;
-	// public BigInteger[][] tmpKeyHashes;
 
 	// PermuteTargetI
 	public BigInteger[][] pt_maskT;

+ 4 - 4
src/protocols/PreEviction.java

@@ -10,7 +10,7 @@ import com.oblivm.backend.network.Network;
 
 import communication.Communication;
 import crypto.Crypto;
-import gc.GCLib;
+import gc.GCRoute;
 import gc.GCUtil;
 import measure.Timer;
 import oram.Forest;
@@ -64,7 +64,7 @@ public class PreEviction extends Protocol {
 
 		Network channel = new Network(null, con1);
 		CompEnv<GCSignal> gen = new GCGen(channel);
-		GCSignal[][][] outZeroKeys = new GCLib<GCSignal>(gen, d, w).routing(LiZeroKeys, E_feZeroKeys, C_feZeroKeys,
+		GCSignal[][][] outZeroKeys = new GCRoute<GCSignal>(gen, d, w).routing(LiZeroKeys, E_feZeroKeys, C_feZeroKeys,
 				E_labelZeroKeys, C_labelZeroKeys, deltaZeroKeys);
 
 		predata.evict_tiOutKeyHashes = new BigInteger[d][];
@@ -144,8 +144,8 @@ public class PreEviction extends Protocol {
 
 		Network channel = new Network(con1, null);
 		CompEnv<GCSignal> eva = new GCEva(channel);
-		predata.evict_gc = new GCLib<GCSignal>(eva, d, w);
-		predata.evict_gc.routing(LiZeroKeys, E_feZeroKeys, C_feZeroKeys, E_labelZeroKeys, C_labelZeroKeys,
+		predata.evict_gcroute = new GCRoute<GCSignal>(eva, d, w);
+		predata.evict_gcroute.routing(LiZeroKeys, E_feZeroKeys, C_feZeroKeys, E_labelZeroKeys, C_labelZeroKeys,
 				deltaZeroKeys);
 		eva.setEvaluate();
 

+ 4 - 4
src/protocols/PreUpdateRoot.java

@@ -9,7 +9,7 @@ import com.oblivm.backend.gc.regular.GCGen;
 import com.oblivm.backend.network.Network;
 
 import communication.Communication;
-import gc.GCLib;
+import gc.GCUpdateRoot;
 import gc.GCUtil;
 import measure.Timer;
 import oram.Forest;
@@ -43,7 +43,7 @@ public class PreUpdateRoot extends Protocol {
 
 		Network channel = new Network(null, con1);
 		CompEnv<GCSignal> gen = new GCGen(channel);
-		GCSignal[][] outZeroKeys = new GCLib<GCSignal>(gen, lBits + 1, sw).rootFindDeepestAndEmpty(j1ZeroKeys,
+		GCSignal[][] outZeroKeys = new GCUpdateRoot<GCSignal>(gen, lBits + 1, sw).rootFindDeepestAndEmpty(j1ZeroKeys,
 				LiZeroKeys, E_feZeroKeys, C_feZeroKeys, E_labelZeroKeys, C_labelZeroKeys);
 
 		predata.ur_outKeyHashes = new BigInteger[outZeroKeys.length][];
@@ -73,8 +73,8 @@ public class PreUpdateRoot extends Protocol {
 
 		Network channel = new Network(con1, null);
 		CompEnv<GCSignal> eva = new GCEva(channel);
-		predata.ur_gc = new GCLib<GCSignal>(eva, lBits + 1, sw);
-		predata.ur_gc.rootFindDeepestAndEmpty(j1ZeroKeys, LiZeroKeys, E_feZeroKeys, C_feZeroKeys, E_labelZeroKeys,
+		predata.ur_gcur = new GCUpdateRoot<GCSignal>(eva, lBits + 1, sw);
+		predata.ur_gcur.rootFindDeepestAndEmpty(j1ZeroKeys, LiZeroKeys, E_feZeroKeys, C_feZeroKeys, E_labelZeroKeys,
 				C_labelZeroKeys);
 		eva.setEvaluate();
 

+ 0 - 224
src/protocols/PrepareDeepest.java

@@ -1,224 +0,0 @@
-package protocols;
-
-import java.math.BigInteger;
-
-import com.oblivm.backend.flexsc.CompEnv;
-import com.oblivm.backend.gc.GCGenComp;
-import com.oblivm.backend.gc.GCSignal;
-import com.oblivm.backend.gc.regular.GCEva;
-import com.oblivm.backend.gc.regular.GCGen;
-import com.oblivm.backend.network.Network;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.NoSuchPartyException;
-import gc.GCLib;
-import oram.Forest;
-import oram.Metadata;
-import util.Util;
-
-public class PrepareDeepest extends Protocol {
-
-	private int d = 10;
-	private int w = 8;
-	private int logD = (int) Math.ceil(Math.log(d) / Math.log(2));
-
-	public PrepareDeepest(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	private GCSignal[] revSelectKeys(GCSignal[][] pairs, byte[] input) {
-		BigInteger in = new BigInteger(1, input);
-		GCSignal[] out = new GCSignal[pairs.length];
-		for (int i = 0; i < pairs.length; i++)
-			out[i] = pairs[i][in.testBit(i) ? 1 : 0];
-		return out;
-	}
-
-	private GCSignal[] selectKeys(GCSignal[][] pairs, byte[] input) {
-		BigInteger in = new BigInteger(1, input);
-		GCSignal[] out = new GCSignal[pairs.length];
-		for (int i = 0; i < pairs.length; i++)
-			out[i] = pairs[i][in.testBit(pairs.length - 1 - i) ? 1 : 0];
-		return out;
-	}
-
-	private GCSignal[][] genKeyPairs(int n) {
-		GCSignal[][] pairs = new GCSignal[n][];
-		for (int i = 0; i < n; i++)
-			pairs[i] = GCGenComp.genPair();
-		return pairs;
-	}
-
-	private GCSignal[] getZeroKeys(GCSignal[][] pairs) {
-		GCSignal[] keys = new GCSignal[pairs.length];
-		for (int i = 0; i < keys.length; i++)
-			keys[i] = pairs[i][0];
-		return keys;
-	}
-
-	private BigInteger decodeOutput(GCSignal[] out1, GCSignal[] out2) {
-		BigInteger output = BigInteger.ZERO;
-		for (int i = 0; i < out1.length; i++) {
-			if (out2[i].isPublic()) {
-				if (out2[i].v)
-					output = output.setBit(i);
-			} else if (out1[i].equals(out2[i])) {
-				;
-			} else if (out1[i].equals(GCGenComp.R.xor(out2[i]))) {
-				output = output.setBit(i);
-			} else {
-				System.err.println("ERROR on GC output!");
-				return null;
-			}
-		}
-		return output;
-	}
-
-	private String addZeros(String a, int n) {
-		String out = a;
-		for (int i = 0; i < n - a.length(); i++)
-			out = "0" + out;
-		return out;
-	}
-
-	public void runE() {
-		byte[] Li = Util.nextBytes((d - 1 + 7) / 8, Crypto.sr);
-
-		byte[][] feBits = new byte[d][];
-		byte[][][] tupleLabels = new byte[d][w][];
-
-		GCSignal[][] LiKeyPairs = genKeyPairs(d - 1);
-		GCSignal[] LiZeroKeys = getZeroKeys(LiKeyPairs);
-		GCSignal[] LiKeyInput = revSelectKeys(LiKeyPairs, Li);
-
-		GCSignal[][][] E_feKeyPairs = new GCSignal[d][][];
-		GCSignal[][][] C_feKeyPairs = new GCSignal[d][][];
-		GCSignal[][] E_feZeroKeys = new GCSignal[d][];
-		GCSignal[][] C_feZeroKeys = new GCSignal[d][];
-		GCSignal[][] E_feKeyInput = new GCSignal[d][];
-
-		GCSignal[][][][] E_labelKeyPairs = new GCSignal[d][w][][];
-		GCSignal[][][][] C_labelKeyPairs = new GCSignal[d][w][][];
-		GCSignal[][][] E_labelZeroKeys = new GCSignal[d][w][];
-		GCSignal[][][] C_labelZeroKeys = new GCSignal[d][w][];
-		GCSignal[][][] E_labelKeyInput = new GCSignal[d][w][];
-
-		for (int i = 0; i < d; i++) {
-			feBits[i] = Util.nextBytes((w + 7) / 8, Crypto.sr);
-			for (int j = 0; j < w; j++)
-				tupleLabels[i][j] = Util.nextBytes((d - 1 + 7) / 8, Crypto.sr);
-
-			E_feKeyPairs[i] = genKeyPairs(w);
-			C_feKeyPairs[i] = genKeyPairs(w);
-			E_feZeroKeys[i] = getZeroKeys(E_feKeyPairs[i]);
-			C_feZeroKeys[i] = getZeroKeys(C_feKeyPairs[i]);
-			E_feKeyInput[i] = selectKeys(E_feKeyPairs[i], feBits[i]);
-
-			for (int j = 0; j < w; j++) {
-				E_labelKeyPairs[i][j] = genKeyPairs(d - 1);
-				C_labelKeyPairs[i][j] = genKeyPairs(d - 1);
-				E_labelZeroKeys[i][j] = getZeroKeys(E_labelKeyPairs[i][j]);
-				C_labelZeroKeys[i][j] = getZeroKeys(C_labelKeyPairs[i][j]);
-				E_labelKeyInput[i][j] = revSelectKeys(E_labelKeyPairs[i][j], tupleLabels[i][j]);
-			}
-		}
-
-		con1.write(LiKeyInput);
-		con1.write(E_feKeyInput);
-		con1.write(C_feZeroKeys);
-		con1.write(E_labelKeyInput);
-		con1.write(C_labelZeroKeys);
-
-		Network channel = new Network(null, con1);
-		CompEnv<GCSignal> gen = new GCGen(channel);
-		GCSignal[][][] E_out = new GCLib<GCSignal>(gen, d, w).prepareDeepest(LiZeroKeys, E_feZeroKeys, C_feZeroKeys,
-				E_labelZeroKeys, C_labelZeroKeys);
-
-		GCSignal[][][] D_out = con1.readObject();
-
-		int[] deepest = new int[d];
-		int[] j1 = new int[d];
-		int[] j2 = new int[d];
-		int[] et = new int[d];
-
-		for (int i = 0; i < d; i++) {
-			deepest[i] = decodeOutput(E_out[0][i], D_out[0][i]).intValue();
-			j1[i] = decodeOutput(E_out[1][i], D_out[1][i]).intValue();
-			j2[i] = decodeOutput(E_out[2][i], D_out[2][i]).intValue();
-			et[i] = decodeOutput(E_out[3][i], D_out[3][i]).intValue();
-
-			System.out.println("i=" + i);
-
-			System.out.print("full tuples: ");
-			BigInteger fe = new BigInteger(1, feBits[i]);
-			for (int j = 0; j < w; j++)
-				if (fe.testBit(w - 1 - j))
-					System.out.print(j + " ");
-			System.out.println();
-			System.out.print("empty tuples: ");
-			for (int j = 0; j < w; j++)
-				if (!fe.testBit(w - 1 - j))
-					System.out.print(j + " ");
-			System.out.println();
-
-			System.out.println("tuple labels xor path label:");
-			BigInteger pathLabel = new BigInteger(1, Li);
-			for (int j = 0; j < w; j++) {
-				BigInteger xor = Util.getSubBits(new BigInteger(1, tupleLabels[i][j]).xor(pathLabel), d - 1, 0);
-				System.out.println(j + ": " + addZeros(xor.toString(2), d - 1));
-			}
-
-			int perp = (int) (Math.pow(2, logD + 1)) - 1;
-
-			System.out.println();
-			System.out.println("deepest[i]: " + ((deepest[i] == perp) ? "\\perp" : "" + deepest[i]));
-			System.out.println("j1[i]: " + j1[i]);
-			System.out.println("j2[i]: " + j2[i]);
-			System.out.println("et[i]: " + et[i]);
-
-			System.out.println();
-		}
-	}
-
-	public void runD() {
-		GCSignal[] LiKeyInput = con1.readObject();
-		GCSignal[][] E_feKeyInput = con1.readObject();
-		GCSignal[][] C_feZeroKeys = con1.readObject();
-		GCSignal[][][] E_labelKeyInput = con1.readObject();
-		GCSignal[][][] C_labelZeroKeys = con1.readObject();
-
-		Network channel = new Network(con1, null);
-		CompEnv<GCSignal> gen = new GCEva(channel);
-		GCLib<GCSignal> dae = new GCLib<GCSignal>(gen, d, w);
-		dae.prepareDeepest(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput, C_labelZeroKeys);
-
-		gen.setEvaluate();
-		GCSignal[][][] D_out = dae.prepareDeepest(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput,
-				C_labelZeroKeys);
-
-		con1.write(D_out);
-	}
-
-	public void runC() {
-
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-
-		if (party == Party.Eddie) {
-			runE();
-
-		} else if (party == Party.Debbie) {
-			runD();
-
-		} else if (party == Party.Charlie) {
-			runC();
-
-		} else {
-			throw new NoSuchPartyException(party + "");
-		}
-	}
-}

+ 0 - 269
src/protocols/PrepareTarget.java

@@ -1,269 +0,0 @@
-package protocols;
-
-import java.math.BigInteger;
-
-import com.oblivm.backend.flexsc.CompEnv;
-import com.oblivm.backend.gc.GCGenComp;
-import com.oblivm.backend.gc.GCSignal;
-import com.oblivm.backend.gc.regular.GCEva;
-import com.oblivm.backend.gc.regular.GCGen;
-import com.oblivm.backend.network.Network;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.NoSuchPartyException;
-import gc.GCLib;
-import oram.Forest;
-import oram.Metadata;
-import util.Util;
-
-public class PrepareTarget extends Protocol {
-
-	private int d = 10;
-	private int w = 8;
-	private int logD = (int) Math.ceil(Math.log(d) / Math.log(2));
-
-	public PrepareTarget(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	private GCSignal[] revSelectKeys(GCSignal[][] pairs, byte[] input) {
-		BigInteger in = new BigInteger(1, input);
-		GCSignal[] out = new GCSignal[pairs.length];
-		for (int i = 0; i < pairs.length; i++)
-			out[i] = pairs[i][in.testBit(i) ? 1 : 0];
-		return out;
-	}
-
-	private GCSignal[] selectKeys(GCSignal[][] pairs, byte[] input) {
-		BigInteger in = new BigInteger(1, input);
-		GCSignal[] out = new GCSignal[pairs.length];
-		for (int i = 0; i < pairs.length; i++)
-			out[i] = pairs[i][in.testBit(pairs.length - 1 - i) ? 1 : 0];
-		return out;
-	}
-
-	private GCSignal[][] genKeyPairs(int n) {
-		GCSignal[][] pairs = new GCSignal[n][];
-		for (int i = 0; i < n; i++)
-			pairs[i] = GCGenComp.genPair();
-		return pairs;
-	}
-
-	private GCSignal[] getZeroKeys(GCSignal[][] pairs) {
-		GCSignal[] keys = new GCSignal[pairs.length];
-		for (int i = 0; i < keys.length; i++)
-			keys[i] = pairs[i][0];
-		return keys;
-	}
-
-	private BigInteger decodeOutput(GCSignal[] out1, GCSignal[] out2) {
-		BigInteger output = BigInteger.ZERO;
-		for (int i = 0; i < out1.length; i++) {
-			if (out2[i].isPublic()) {
-				if (out2[i].v)
-					output = output.setBit(i);
-			} else if (out1[i].equals(out2[i])) {
-				;
-			} else if (out1[i].equals(GCGenComp.R.xor(out2[i]))) {
-				output = output.setBit(i);
-			} else {
-				System.err.println("ERROR on GC output!");
-				return null;
-			}
-		}
-		return output;
-	}
-
-	private String addZeros(String a, int n) {
-		String out = a;
-		for (int i = 0; i < n - a.length(); i++)
-			out = "0" + out;
-		return out;
-	}
-
-	public void runE() {
-		int logW = (int) Math.ceil(Math.log(w + 1) / Math.log(2));
-		byte[] Li = Util.nextBytes((d - 1 + 7) / 8, Crypto.sr);
-
-		byte[][] feBits = new byte[d][];
-		byte[][][] tupleLabels = new byte[d][w][];
-
-		GCSignal[][] LiKeyPairs = genKeyPairs(d - 1);
-		GCSignal[] LiZeroKeys = getZeroKeys(LiKeyPairs);
-		GCSignal[] LiKeyInput = revSelectKeys(LiKeyPairs, Li);
-
-		GCSignal[][][] deltaKeyPairs = new GCSignal[d][][];
-		GCSignal[][] deltaZeroKeys = new GCSignal[d][];
-
-		GCSignal[][][] E_feKeyPairs = new GCSignal[d][][];
-		GCSignal[][][] C_feKeyPairs = new GCSignal[d][][];
-		GCSignal[][] E_feZeroKeys = new GCSignal[d][];
-		GCSignal[][] C_feZeroKeys = new GCSignal[d][];
-		GCSignal[][] E_feKeyInput = new GCSignal[d][];
-
-		GCSignal[][][][] E_labelKeyPairs = new GCSignal[d][w][][];
-		GCSignal[][][][] C_labelKeyPairs = new GCSignal[d][w][][];
-		GCSignal[][][] E_labelZeroKeys = new GCSignal[d][w][];
-		GCSignal[][][] C_labelZeroKeys = new GCSignal[d][w][];
-		GCSignal[][][] E_labelKeyInput = new GCSignal[d][w][];
-
-		for (int i = 0; i < d; i++) {
-			deltaKeyPairs[i] = genKeyPairs(logW);
-			deltaZeroKeys[i] = getZeroKeys(deltaKeyPairs[i]);
-
-			feBits[i] = Util.nextBytes((w + 7) / 8, Crypto.sr);
-			for (int j = 0; j < w; j++)
-				tupleLabels[i][j] = Util.nextBytes((d - 1 + 7) / 8, Crypto.sr);
-
-			E_feKeyPairs[i] = genKeyPairs(w);
-			C_feKeyPairs[i] = genKeyPairs(w);
-			E_feZeroKeys[i] = getZeroKeys(E_feKeyPairs[i]);
-			C_feZeroKeys[i] = getZeroKeys(C_feKeyPairs[i]);
-			E_feKeyInput[i] = selectKeys(E_feKeyPairs[i], feBits[i]);
-
-			for (int j = 0; j < w; j++) {
-				E_labelKeyPairs[i][j] = genKeyPairs(d - 1);
-				C_labelKeyPairs[i][j] = genKeyPairs(d - 1);
-				E_labelZeroKeys[i][j] = getZeroKeys(E_labelKeyPairs[i][j]);
-				C_labelZeroKeys[i][j] = getZeroKeys(C_labelKeyPairs[i][j]);
-				E_labelKeyInput[i][j] = revSelectKeys(E_labelKeyPairs[i][j], tupleLabels[i][j]);
-			}
-		}
-
-		con1.write(LiKeyInput);
-		con1.write(E_feKeyInput);
-		con1.write(C_feZeroKeys);
-		con1.write(E_labelKeyInput);
-		con1.write(C_labelZeroKeys);
-		con1.write(deltaZeroKeys);
-
-		Network channel = new Network(null, con1);
-
-		CompEnv<GCSignal> gen = new GCGen(channel);
-		GCSignal[][][] E_out = new GCLib<GCSignal>(gen, d, w).prepareDeepest(LiZeroKeys, E_feZeroKeys, C_feZeroKeys,
-				E_labelZeroKeys, C_labelZeroKeys);
-
-		GCSignal[][][] D_out = con1.readObject();
-
-		CompEnv<GCSignal> gen1 = new GCGen(channel);
-		GCSignal[][][] E_out1 = new GCLib<GCSignal>(gen1, d, w).combineDeepestAndTarget(LiZeroKeys, E_feZeroKeys,
-				C_feZeroKeys, E_labelZeroKeys, C_labelZeroKeys, deltaZeroKeys);
-
-		GCSignal[][][] D_out1 = con1.readObject();
-
-		int[] deepest = new int[d];
-		int[] j1 = new int[d];
-		int[] j2 = new int[d];
-		int[] et = new int[d];
-
-		int[] target = new int[d];
-		int[] f = new int[d];
-
-		int nTop = decodeOutput(E_out1[2][0], D_out1[2][0]).intValue();
-		int nBot = decodeOutput(E_out1[2][1], D_out1[2][1]).intValue();
-		int eTop = decodeOutput(E_out1[2][2], D_out1[2][2]).intValue();
-		int eBot = decodeOutput(E_out1[2][3], D_out1[2][3]).intValue();
-
-		for (int i = 0; i < d; i++) {
-			deepest[i] = decodeOutput(E_out[0][i], D_out[0][i]).intValue();
-			j1[i] = decodeOutput(E_out[1][i], D_out[1][i]).intValue();
-			j2[i] = decodeOutput(E_out[2][i], D_out[2][i]).intValue();
-			et[i] = decodeOutput(E_out[3][i], D_out[3][i]).intValue();
-
-			target[i] = decodeOutput(E_out1[0][i], D_out1[0][i]).intValue();
-			f[i] = decodeOutput(E_out1[1][i], D_out1[1][i]).intValue();
-
-			System.out.println("i=" + i);
-
-			System.out.print("full tuples: ");
-			BigInteger fe = new BigInteger(1, feBits[i]);
-			for (int j = 0; j < w; j++)
-				if (fe.testBit(w - 1 - j))
-					System.out.print(j + " ");
-			System.out.println();
-			System.out.print("empty tuples: ");
-			for (int j = 0; j < w; j++)
-				if (!fe.testBit(w - 1 - j))
-					System.out.print(j + " ");
-			System.out.println();
-
-			System.out.println("tuple labels xor path label:");
-			BigInteger pathLabel = new BigInteger(1, Li);
-			for (int j = 0; j < w; j++) {
-				BigInteger xor = Util.getSubBits(new BigInteger(1, tupleLabels[i][j]).xor(pathLabel), d - 1, 0);
-				System.out.println(j + ": " + addZeros(xor.toString(2), d - 1));
-			}
-
-			int perp = (int) (Math.pow(2, logD + 1)) - 1;
-
-			System.out.println();
-			System.out.println("deepest[i]: " + ((deepest[i] == perp) ? "\\perp" : "" + deepest[i]));
-			System.out.println("j1[i]: " + j1[i]);
-			System.out.println("j2[i]: " + j2[i]);
-			System.out.println("et[i]: " + et[i]);
-			System.out.println("target[i]: " + ((target[i] == perp) ? "\\perp" : "" + target[i]));
-			System.out.println("f[i]: " + f[i]);
-
-			System.out.println();
-		}
-		System.out.println("nTop: " + nTop);
-		System.out.println("nBot: " + nBot);
-		System.out.println("eTop: " + eTop);
-		System.out.println("eBot: " + eBot);
-	}
-
-	public void runD() {
-		GCSignal[] LiKeyInput = con1.readObject();
-		GCSignal[][] E_feKeyInput = con1.readObject();
-		GCSignal[][] C_feZeroKeys = con1.readObject();
-		GCSignal[][][] E_labelKeyInput = con1.readObject();
-		GCSignal[][][] C_labelZeroKeys = con1.readObject();
-		GCSignal[][] deltaZeroKeys = con1.readObject();
-
-		Network channel = new Network(con1, null);
-
-		CompEnv<GCSignal> gen = new GCEva(channel);
-		GCLib<GCSignal> dae = new GCLib<GCSignal>(gen, d, w);
-		dae.prepareDeepest(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput, C_labelZeroKeys);
-
-		gen.setEvaluate();
-		GCSignal[][][] D_out = dae.prepareDeepest(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput,
-				C_labelZeroKeys);
-
-		con1.write(D_out);
-
-		CompEnv<GCSignal> gen1 = new GCEva(channel);
-		GCLib<GCSignal> dae1 = new GCLib<GCSignal>(gen1, d, w);
-		dae1.combineDeepestAndTarget(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput, C_labelZeroKeys,
-				deltaZeroKeys);
-
-		gen1.setEvaluate();
-		GCSignal[][][] D_out1 = dae1.combineDeepestAndTarget(LiKeyInput, E_feKeyInput, C_feZeroKeys, E_labelKeyInput,
-				C_labelZeroKeys, deltaZeroKeys);
-
-		con1.write(D_out1);
-	}
-
-	public void runC() {
-
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-
-		if (party == Party.Eddie) {
-			runE();
-
-		} else if (party == Party.Debbie) {
-			runD();
-
-		} else if (party == Party.Charlie) {
-			runC();
-
-		} else {
-			throw new NoSuchPartyException(party + "");
-		}
-	}
-}

+ 1 - 1
src/protocols/UpdateRoot.java

@@ -58,7 +58,7 @@ public class UpdateRoot extends Protocol {
 		GCSignal[][] C_labelInputKeys = con2.readObject();
 
 		// step 2
-		GCSignal[][] outKeys = predata.ur_gc.rootFindDeepestAndEmpty(j1InputKeys, LiInputKeys, E_feInputKeys,
+		GCSignal[][] outKeys = predata.ur_gcur.rootFindDeepestAndEmpty(j1InputKeys, LiInputKeys, E_feInputKeys,
 				C_feInputKeys, E_labelInputKeys, C_labelInputKeys);
 		int j1 = GCUtil.evaOutKeys(outKeys[0], predata.ur_outKeyHashes[0]).intValue();
 		int j2 = GCUtil.evaOutKeys(outKeys[1], predata.ur_outKeyHashes[1]).intValue();

+ 13 - 25
src/ui/CLI.java

@@ -63,39 +63,27 @@ public class CLI {
 		Class<? extends Protocol> operation = null;
 		String protocol = cmd.getOptionValue("protocol", "retrieve").toLowerCase();
 
-		if (protocol.equals("sscot")) {
+		if (protocol.equals("acc")) {
+			operation = Access.class;
+		} else if (protocol.equals("cot")) {
 			operation = SSCOT.class;
-		} else if (protocol.equals("ssiot")) {
+		} else if (protocol.equals("iot")) {
 			operation = SSIOT.class;
-		} else if (protocol.equals("reshuffle")) {
+		} else if (protocol.equals("rsf")) {
 			operation = Reshuffle.class;
 		} else if (protocol.equals("ppt")) {
 			operation = PostProcessT.class;
-		} else if (protocol.equals("ssxot")) {
-			operation = SSXOT.class;
-		} else if (protocol.equals("access")) {
-			operation = Access.class;
-		} else if (protocol.equals("gc")) {
-			operation = GarbledCircuit.class;
-		} else if (protocol.equals("gctest")) {
-			operation = GarbledCircuitTest.class;
-		} else if (protocol.equals("dae")) {
-			operation = DeepestAndEmpty.class;
-		} else if (protocol.equals("pd")) {
-			operation = PrepareDeepest.class;
+		} else if (protocol.equals("ur")) {
+			operation = UpdateRoot.class;
+		} else if (protocol.equals("evi")) {
+			operation = Eviction.class;
 		} else if (protocol.equals("pt")) {
-			operation = PrepareTarget.class;
-		} else if (protocol.equals("permt")) {
 			operation = PermuteTarget.class;
-		} else if (protocol.equals("permi")) {
+		} else if (protocol.equals("pi")) {
 			operation = PermuteIndex.class;
-		} else if (protocol.equals("mc")) {
-			operation = MakeCycle.class;
-		} else if (protocol.equals("update")) {
-			operation = UpdateRoot.class;
-		} else if (protocol.equals("evict")) {
-			operation = Eviction.class;
-		} else if (protocol.equals("retrieve")) {
+		} else if (protocol.equals("xot")) {
+			operation = SSXOT.class;
+		} else if (protocol.equals("rtv")) {
 			operation = Retrieve.class;
 		} else {
 			System.out.println("Protocol " + protocol + " not supported");

+ 1 - 1
test/protocols/TestAccess_C.java

@@ -14,7 +14,7 @@ public class TestAccess_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol access charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol acc charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestAccess_D.java

@@ -14,7 +14,7 @@ public class TestAccess_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol access debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol acc debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestAccess_E.java

@@ -14,7 +14,7 @@ public class TestAccess_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol access eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol acc eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 0 - 50
test/protocols/TestDeepestAndEmpty_C.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestDeepestAndEmpty_C {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol dae charlie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 50
test/protocols/TestDeepestAndEmpty_D.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestDeepestAndEmpty_D {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol dae debbie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 50
test/protocols/TestDeepestAndEmpty_E.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestDeepestAndEmpty_E {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol dae eddie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 1 - 1
test/protocols/TestEviction_C.java

@@ -14,7 +14,7 @@ public class TestEviction_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol evict charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol evi charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestEviction_D.java

@@ -14,7 +14,7 @@ public class TestEviction_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol evict debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol evi debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestEviction_E.java

@@ -14,7 +14,7 @@ public class TestEviction_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol evict eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol evi eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 0 - 50
test/protocols/TestMakeCycle_C.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestMakeCycle_C {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol mc charlie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 50
test/protocols/TestMakeCycle_D.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestMakeCycle_D {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol mc debbie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 50
test/protocols/TestMakeCycle_E.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestMakeCycle_E {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol mc eddie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 1 - 1
test/protocols/TestPermuteIndex_C.java

@@ -14,7 +14,7 @@ public class TestPermuteIndex_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol permi charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pi charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestPermuteIndex_D.java

@@ -14,7 +14,7 @@ public class TestPermuteIndex_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol permi debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pi debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestPermuteIndex_E.java

@@ -14,7 +14,7 @@ public class TestPermuteIndex_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol permi eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pi eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestPermuteTarget_C.java

@@ -14,7 +14,7 @@ public class TestPermuteTarget_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol permt charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pt charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestPermuteTarget_D.java

@@ -14,7 +14,7 @@ public class TestPermuteTarget_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol permt debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pt debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestPermuteTarget_E.java

@@ -14,7 +14,7 @@ public class TestPermuteTarget_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol permt eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pt eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestPPT_C.java → test/protocols/TestPostProcessT_C.java

@@ -5,7 +5,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.Arrays;
 
-public class TestPPT_C {
+public class TestPostProcessT_C {
 
 	public static void main(String[] args) {
 		Runtime runTime = Runtime.getRuntime();

+ 1 - 1
test/protocols/TestPPT_D.java → test/protocols/TestPostProcessT_D.java

@@ -5,7 +5,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.Arrays;
 
-public class TestPPT_D {
+public class TestPostProcessT_D {
 
 	public static void main(String[] args) {
 		Runtime runTime = Runtime.getRuntime();

+ 1 - 1
test/protocols/TestPPT_E.java → test/protocols/TestPostProcessT_E.java

@@ -5,7 +5,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.Arrays;
 
-public class TestPPT_E {
+public class TestPostProcessT_E {
 
 	public static void main(String[] args) {
 		Runtime runTime = Runtime.getRuntime();

+ 0 - 50
test/protocols/TestPrepareDeepest_C.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPrepareDeepest_C {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pd charlie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 50
test/protocols/TestPrepareDeepest_D.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPrepareDeepest_D {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pd debbie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 50
test/protocols/TestPrepareDeepest_E.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPrepareDeepest_E {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pd eddie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 50
test/protocols/TestPrepareTarget_C.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPrepareTarget_C {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pt charlie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 50
test/protocols/TestPrepareTarget_D.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPrepareTarget_D {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pt debbie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 0 - 50
test/protocols/TestPrepareTarget_E.java

@@ -1,50 +0,0 @@
-package protocols;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPrepareTarget_E {
-
-	public static void main(String[] args) {
-		Runtime runTime = Runtime.getRuntime();
-		Process process = null;
-		String dir = System.getProperty("user.dir");
-		String binDir = dir + "\\bin";
-		String libs = dir + "\\lib\\*";
-		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol pt eddie");
-
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		InputStream inputStream = process.getInputStream();
-		InputStreamReader isr = new InputStreamReader(inputStream);
-		InputStream errorStream = process.getErrorStream();
-		InputStreamReader esr = new InputStreamReader(errorStream);
-
-		System.out.println("STANDARD OUTPUT:");
-		int n1;
-		char[] c1 = new char[1024];
-		try {
-			while ((n1 = isr.read(c1)) > 0) {
-				System.out.print(new String(Arrays.copyOfRange(c1, 0, n1)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-
-		System.out.println("STANDARD ERROR:");
-		int n2;
-		char[] c2 = new char[1024];
-		try {
-			while ((n2 = esr.read(c2)) > 0) {
-				System.err.print(new String(Arrays.copyOfRange(c2, 0, n2)));
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-}

+ 1 - 1
test/protocols/TestReshuffle_C.java

@@ -14,7 +14,7 @@ public class TestReshuffle_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol reshuffle charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol rsf charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestReshuffle_D.java

@@ -14,7 +14,7 @@ public class TestReshuffle_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol reshuffle debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol rsf debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestReshuffle_E.java

@@ -14,7 +14,7 @@ public class TestReshuffle_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol reshuffle eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol rsf eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestRetrieve_C.java

@@ -14,7 +14,7 @@ public class TestRetrieve_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol retrieve charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol rtv charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestRetrieve_D.java

@@ -14,7 +14,7 @@ public class TestRetrieve_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol retrieve debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol rtv debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestRetrieve_E.java

@@ -14,7 +14,7 @@ public class TestRetrieve_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol retrieve eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol rtv eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestSSCOT_C.java

@@ -14,7 +14,7 @@ public class TestSSCOT_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol sscot charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol cot charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestSSCOT_D.java

@@ -14,7 +14,7 @@ public class TestSSCOT_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol sscot debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol cot debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestSSCOT_E.java

@@ -14,7 +14,7 @@ public class TestSSCOT_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol sscot eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol cot eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestSSIOT_C.java

@@ -14,7 +14,7 @@ public class TestSSIOT_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol ssiot charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol iot charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestSSIOT_D.java

@@ -14,7 +14,7 @@ public class TestSSIOT_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol ssiot debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol iot debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestSSIOT_E.java

@@ -14,7 +14,7 @@ public class TestSSIOT_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol ssiot eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol iot eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestSSXOT_C.java

@@ -14,7 +14,7 @@ public class TestSSXOT_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol ssxot charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol xot charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestSSXOT_D.java

@@ -14,7 +14,7 @@ public class TestSSXOT_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol ssxot debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol xot debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestSSXOT_E.java

@@ -14,7 +14,7 @@ public class TestSSXOT_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol ssxot eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol xot eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestUpdateRoot_C.java

@@ -14,7 +14,7 @@ public class TestUpdateRoot_C {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol update charlie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol ur charlie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestUpdateRoot_D.java

@@ -14,7 +14,7 @@ public class TestUpdateRoot_D {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol update debbie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol ur debbie");
 
 		} catch (IOException e) {
 			e.printStackTrace();

+ 1 - 1
test/protocols/TestUpdateRoot_E.java

@@ -14,7 +14,7 @@ public class TestUpdateRoot_E {
 		String binDir = dir + "\\bin";
 		String libs = dir + "\\lib\\*";
 		try {
-			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol update eddie");
+			process = runTime.exec("java -classpath " + binDir + ";" + libs + " ui.CLI -protocol ur eddie");
 
 		} catch (IOException e) {
 			e.printStackTrace();