Ver código fonte

delete old protocols

Boyoung- 6 anos atrás
pai
commit
f8fb0d3bc3
49 arquivos alterados com 1 adições e 4731 exclusões
  1. 0 145
      src/pir/PIRIOT.java
  2. 0 226
      src/pir/PIRReshuffle.java
  3. 0 94
      src/pir/precomputation/PrePIRAccess.java
  4. 0 85
      src/pir/precomputation/PrePIRCOT.java
  5. 0 67
      src/pir/precomputation/PrePIRIOT.java
  6. 0 75
      src/pir/precomputation/PrePIRReshuffle.java
  7. 0 99
      src/pir/precomputation/PrePIRRetrieve.java
  8. 0 396
      src/protocols/Access.java
  9. 0 246
      src/protocols/PostProcessT.java
  10. 0 214
      src/protocols/Reshuffle.java
  11. 0 382
      src/protocols/Retrieve.java
  12. 0 173
      src/protocols/SSCOT.java
  13. 0 164
      src/protocols/SSIOT.java
  14. 0 92
      src/protocols/precomputation/PreAccess.java
  15. 0 231
      src/protocols/precomputation/PreEviction.java
  16. 0 69
      src/protocols/precomputation/PrePermuteIndex.java
  17. 0 114
      src/protocols/precomputation/PrePermuteTarget.java
  18. 0 89
      src/protocols/precomputation/PrePostProcessT.java
  19. 0 76
      src/protocols/precomputation/PreReshuffle.java
  20. 0 96
      src/protocols/precomputation/PreRetrieve.java
  21. 0 77
      src/protocols/precomputation/PreSSCOT.java
  22. 0 74
      src/protocols/precomputation/PreSSIOT.java
  23. 0 80
      src/protocols/precomputation/PreSSXOT.java
  24. 0 140
      src/protocols/precomputation/PreUpdateRoot.java
  25. 1 27
      src/ui/CLI.java
  26. 0 50
      test/pir/TestPIRIOT_C.java
  27. 0 50
      test/pir/TestPIRIOT_D.java
  28. 0 50
      test/pir/TestPIRIOT_E.java
  29. 0 50
      test/pir/TestPIRReshuffle_C.java
  30. 0 50
      test/pir/TestPIRReshuffle_D.java
  31. 0 50
      test/pir/TestPIRReshuffle_E.java
  32. 0 50
      test/protocols/TestAccess_C.java
  33. 0 50
      test/protocols/TestAccess_D.java
  34. 0 50
      test/protocols/TestAccess_E.java
  35. 0 50
      test/protocols/TestPostProcessT_C.java
  36. 0 50
      test/protocols/TestPostProcessT_D.java
  37. 0 50
      test/protocols/TestPostProcessT_E.java
  38. 0 50
      test/protocols/TestReshuffle_C.java
  39. 0 50
      test/protocols/TestReshuffle_D.java
  40. 0 50
      test/protocols/TestReshuffle_E.java
  41. 0 50
      test/protocols/TestRetrieve_C.java
  42. 0 50
      test/protocols/TestRetrieve_D.java
  43. 0 50
      test/protocols/TestRetrieve_E.java
  44. 0 50
      test/protocols/TestSSCOT_C.java
  45. 0 50
      test/protocols/TestSSCOT_D.java
  46. 0 50
      test/protocols/TestSSCOT_E.java
  47. 0 50
      test/protocols/TestSSIOT_C.java
  48. 0 50
      test/protocols/TestSSIOT_D.java
  49. 0 50
      test/protocols/TestSSIOT_E.java

+ 0 - 145
src/pir/PIRIOT.java

@@ -1,145 +0,0 @@
-package pir;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.NoSuchPartyException;
-import exceptions.SSIOTException;
-import oram.Forest;
-import oram.Metadata;
-import pir.precomputation.PrePIRIOT;
-import protocols.Protocol;
-import protocols.struct.OutSSIOT;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PIRIOT extends Protocol {
-
-	private int pid = P.IOT;
-
-	public PIRIOT(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, int n, byte[] Nip1_pr, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		byte[][] x = new byte[n][];
-		byte[][] v = new byte[n][];
-
-		for (int i = 0; i < n; i++) {
-			byte[] i_bytes = Util.intToBytes(i);
-			x[i] = predata.ssiot_r.clone();
-			for (int j = 0; j < Nip1_pr.length; j++)
-				x[i][x[i].length - 1 - j] ^= Nip1_pr[Nip1_pr.length - 1 - j] ^ i_bytes[i_bytes.length - 1 - j];
-
-			v[i] = predata.ssiot_F_kprime.compute(x[i]);
-		}
-
-		timer.start(pid, M.online_write);
-		con2.write(pid, v);
-		timer.stop(pid, M.online_write);
-
-		timer.stop(pid, M.online_comp);
-	}
-
-	public void runD(PreData predata, byte[] Nip1_pr, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 2
-		byte[] y = predata.ssiot_r;
-		for (int i = 0; i < Nip1_pr.length; i++)
-			y[y.length - 1 - i] ^= Nip1_pr[Nip1_pr.length - 1 - i];
-		byte[] w = predata.ssiot_F_kprime.compute(y);
-
-		timer.start(pid, M.online_write);
-		con2.write(pid, w);
-		timer.stop(pid, M.online_write);
-
-		timer.stop(pid, M.online_comp);
-	}
-
-	public OutSSIOT runC(Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		timer.start(pid, M.online_read);
-		byte[][] v = con1.readDoubleByteArray(pid);
-
-		// step 2
-		byte[] w = con2.read(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 3
-		int n = v.length;
-		OutSSIOT output = null;
-		int invariant = 0;
-
-		for (int i = 0; i < n; i++) {
-			if (Util.equal(v[i], w)) {
-				output = new OutSSIOT(i, null);
-				invariant++;
-			}
-		}
-
-		if (invariant != 1)
-			throw new SSIOTException("Invariant error: " + invariant);
-
-		timer.stop(pid, M.online_comp);
-		return output;
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		Timer timer = new Timer();
-
-		for (int j = 0; j < 100; j++) {
-			int twoTauPow = 64;
-			byte[] sE_Nip1_pr = new byte[1];
-			byte[] sD_Nip1_pr = new byte[1];
-			int index = Crypto.sr.nextInt(twoTauPow);
-			Crypto.sr.nextBytes(sE_Nip1_pr);
-			sD_Nip1_pr[0] = (byte) (Util.intToBytes(index)[3] ^ sE_Nip1_pr[0]);
-
-			PreData predata = new PreData();
-			PrePIRIOT pressiot = new PrePIRIOT(con1, con2);
-
-			if (party == Party.Eddie) {
-				con1.write(sD_Nip1_pr);
-				con2.write(index);
-				pressiot.runE(predata, twoTauPow, timer);
-				runE(predata, twoTauPow, sE_Nip1_pr, timer);
-
-			} else if (party == Party.Debbie) {
-				sD_Nip1_pr = con1.read();
-				pressiot.runD(predata, timer);
-				runD(predata, sD_Nip1_pr, timer);
-
-			} else if (party == Party.Charlie) {
-				index = con1.readInt();
-				pressiot.runC();
-				OutSSIOT output = runC(timer);
-				if (output.t == index)
-					System.out.println("PIRIOT test passed");
-				else
-					System.err.println("PIRIOT test failed");
-
-			} else {
-				throw new NoSuchPartyException(party + "");
-			}
-		}
-
-		// timer.print();
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 226
src/pir/PIRReshuffle.java

@@ -1,226 +0,0 @@
-package pir;
-
-import java.math.BigInteger;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.NoSuchPartyException;
-import oram.Forest;
-import oram.Global;
-import oram.Metadata;
-import oram.Tree;
-import pir.precomputation.PrePIRReshuffle;
-import protocols.Protocol;
-import protocols.precomputation.PreAccess;
-import protocols.struct.OutAccess;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PIRReshuffle extends Protocol {
-
-	private int pid = P.RSF;
-
-	public PIRReshuffle(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public byte[][] runE(PreData predata, byte[][] path, boolean firstTree, Timer timer) {
-		if (firstTree)
-			return path;
-
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		timer.start(pid, M.online_read);
-		byte[][] z = con2.readDoubleByteArray(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 2
-		byte[][] b = new byte[z.length][];
-		for (int i = 0; i < b.length; i++)
-			b[i] = Util.xor(Util.xor(path[i], z[i]), predata.pir_reshuffle_r[i]);
-		byte[][] b_prime = Util.permute(b, predata.reshuffle_pi);
-
-		timer.stop(pid, M.online_comp);
-		return b_prime;
-	}
-
-	public void runD() {
-	}
-
-	public byte[][] runC(PreData predata, byte[][] path, boolean firstTree, Timer timer) {
-		if (firstTree)
-			return path;
-
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		byte[][] z = new byte[path.length][];
-		for (int i = 0; i < z.length; i++)
-			z[i] = Util.xor(path[i], predata.pir_reshuffle_p[i]);
-
-		timer.start(pid, M.online_write);
-		con1.write(pid, z);
-		timer.stop(pid, M.online_write);
-
-		timer.stop(pid, M.online_comp);
-		return predata.pir_reshuffle_a_prime;
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		int records = 5;
-		int repeat = 5;
-
-		int tau = md.getTau();
-		int numTrees = md.getNumTrees();
-		long numInsert = md.getNumInsertRecords();
-		int addrBits = md.getAddrBits();
-
-		Timer timer = new Timer();
-
-		sanityCheck();
-
-		System.out.println();
-
-		for (int i = 0; i < records; i++) {
-			long N = Global.cheat ? 0 : Util.nextLong(numInsert, Crypto.sr);
-
-			for (int j = 0; j < repeat; j++) {
-				System.out.println("Test: " + i + " " + j);
-				System.out.println("N=" + BigInteger.valueOf(N).toString(2));
-
-				byte[] Li = new byte[0];
-
-				for (int ti = 0; ti < numTrees; ti++) {
-					long Ni_value = Util.getSubBits(N, addrBits, addrBits - md.getNBitsOfTree(ti));
-					long Nip1_pr_value = Util.getSubBits(N, addrBits - md.getNBitsOfTree(ti),
-							Math.max(addrBits - md.getNBitsOfTree(ti) - tau, 0));
-					byte[] Ni = Util.longToBytes(Ni_value, md.getNBytesOfTree(ti));
-					byte[] Nip1_pr = Util.longToBytes(Nip1_pr_value, (tau + 7) / 8);
-
-					PreData predata = new PreData();
-					PreAccess preaccess = new PreAccess(con1, con2);
-					PIRAccess access = new PIRAccess(con1, con2);
-					PrePIRReshuffle prereshuffle = new PrePIRReshuffle(con1, con2);
-
-					if (party == Party.Eddie) {
-						Tree OTi = forest.getTree(ti);
-						int numTuples = (OTi.getD() - 1) * OTi.getW() + OTi.getStashSize();
-						int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-								md.getABytesOfTree(ti) };
-						preaccess.runE(predata, md.getTwoTauPow(), numTuples, tupleParam, timer);
-
-						byte[] sE_Ni = Util.nextBytes(Ni.length, Crypto.sr);
-						byte[] sD_Ni = Util.xor(Ni, sE_Ni);
-						con1.write(sD_Ni);
-
-						byte[] sE_Nip1_pr = Util.nextBytes(Nip1_pr.length, Crypto.sr);
-						byte[] sD_Nip1_pr = Util.xor(Nip1_pr, sE_Nip1_pr);
-						con1.write(sD_Nip1_pr);
-
-						// TODO: fix commented line below
-						OutAccess outaccess = null;
-						// OutAccess outaccess = access.runE(predata, OTi, sE_Ni, sE_Nip1_pr, timer);
-
-						if (ti == numTrees - 1)
-							con2.write(N);
-
-						prereshuffle.runE(predata, timer);
-						byte[][] fbArray = new byte[outaccess.E_P.length][];
-						for (int i1 = 0; i1 < fbArray.length; i1++)
-							fbArray[i1] = outaccess.E_P[i1].getF().clone();
-						byte[][] E_P_prime = runE(predata, fbArray, ti == 0, timer);
-
-						byte[][] C_P = con2.readDoubleByteArray();
-						byte[][] C_P_prime = con2.readDoubleByteArray();
-						byte[][] oldPath = new byte[C_P.length][];
-						byte[][] newPath = new byte[C_P.length][];
-
-						for (int k = 0; k < C_P.length; k++) {
-							oldPath[k] = Util.xor(outaccess.E_P[k].getF(), C_P[k]);
-							newPath[k] = Util.xor(E_P_prime[k], C_P_prime[k]);
-						}
-						oldPath = Util.permute(oldPath, predata.reshuffle_pi);
-
-						boolean pass = true;
-						for (int k = 0; k < newPath.length; k++) {
-							if (!Util.equal(oldPath[k], newPath[k])) {
-								System.err.println("PIR Reshuffle test failed");
-								pass = false;
-								break;
-							}
-						}
-						if (pass)
-							System.out.println("PIR Reshuffle test passed");
-
-					} else if (party == Party.Debbie) {
-						Tree OTi = forest.getTree(ti);
-						preaccess.runD(predata, timer);
-
-						byte[] sD_Ni = con1.read();
-
-						byte[] sD_Nip1_pr = con1.read();
-
-						// TODO: fix commented line below
-						// access.runD(predata, OTi, sD_Ni, sD_Nip1_pr, timer);
-
-						int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-								md.getABytesOfTree(ti) };
-						prereshuffle.runD(predata, tupleParam, timer);
-						runD();
-
-					} else if (party == Party.Charlie) {
-						Tree OTi = forest.getTree(ti);
-						preaccess.runC(timer);
-
-						System.out.println("L" + ti + "=" + new BigInteger(1, Li).toString(2));
-
-						// TODO: fix commented line below
-						OutAccess outaccess = null;
-						// OutAccess outaccess = access.runC(md, OTi, ti, Li, timer);
-
-						prereshuffle.runC(predata, timer);
-						byte[][] fbArray = new byte[outaccess.C_P.length][];
-						for (int i1 = 0; i1 < fbArray.length; i1++)
-							fbArray[i1] = outaccess.C_P[i1].getF().clone();
-						byte[][] C_P_prime = runC(predata, fbArray, ti == 0, timer);
-
-						Li = outaccess.C_Lip1;
-
-						if (ti == numTrees - 1) {
-							N = con1.readLong();
-							// long data = new BigInteger(1,
-							// outaccess.C_Ti.getA()).longValue();
-							// if (N == data) {
-							// System.out.println("Access passed");
-							// System.out.println();
-							// } else {
-							// throw new AccessException("Access failed");
-							// }
-						}
-
-						con1.write(fbArray);
-						con1.write(C_P_prime);
-
-					} else {
-						throw new NoSuchPartyException(party + "");
-					}
-				}
-			}
-		}
-
-		// timer.print();
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 94
src/pir/precomputation/PrePIRAccess.java

@@ -1,94 +0,0 @@
-package pir.precomputation;
-
-import communication.Communication;
-//import crypto.Crypto;
-import oram.Forest;
-import oram.Metadata;
-//import oram.Tuple;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PrePIRAccess extends Protocol {
-
-	private int pid = P.ACC;
-
-	public PrePIRAccess(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, int twotaupow, int numTuples, int[] tupleParam, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		// SSCOT
-		PrePIRCOT presscot = new PrePIRCOT(con1, con2);
-		presscot.runE(predata, numTuples, timer);
-
-		// SSIOT
-		PrePIRIOT pressiot = new PrePIRIOT(con1, con2);
-		pressiot.runE(predata, twotaupow, timer);
-
-		// Access
-		// predata.access_sigma = Util.randomPermutation(numTuples, Crypto.sr);
-		predata.access_sigma = Util.identityPermutation(numTuples);
-		// predata.access_p = new Tuple[numTuples];
-		// for (int i = 0; i < numTuples; i++)
-		// predata.access_p[i] = new Tuple(tupleParam[0], tupleParam[1],
-		// tupleParam[2], tupleParam[3], Crypto.sr);
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.access_sigma);
-		// con1.write(predata.access_p);
-		timer.stop(pid, M.offline_write);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runD(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		// SSCOT
-		PrePIRCOT presscot = new PrePIRCOT(con1, con2);
-		presscot.runD(predata, 0, timer); // TODO: this is incorrect due to update
-
-		// SSIOT
-		PrePIRIOT pressiot = new PrePIRIOT(con1, con2);
-		pressiot.runD(predata, timer);
-
-		// Access
-		timer.start(pid, M.offline_read);
-		predata.access_sigma = con1.readIntArray();
-		// predata.access_p = con1.readTupleArray();
-		timer.stop(pid, M.offline_read);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runC(Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		// SSCOT
-		PrePIRCOT presscot = new PrePIRCOT(con1, con2);
-		presscot.runC(null, timer);// TODO: this is incorrect due to update
-
-		// SSIOT
-		PrePIRIOT pressiot = new PrePIRIOT(con1, con2);
-		pressiot.runC();
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 85
src/pir/precomputation/PrePIRCOT.java

@@ -1,85 +0,0 @@
-package pir.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import crypto.PRF;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-
-public class PrePIRCOT extends Protocol {
-
-	public PrePIRCOT(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	// TODO: change PRF output bits to max(32, N)
-
-	public void runE(PreData predata, int l) {
-		timer.start(M.offline_comp);
-
-		predata.sscot_k = PRF.generateKey(Crypto.sr);
-		predata.sscot_r = new byte[l][];
-		for (int i = 0; i < l; i++) {
-			predata.sscot_r[i] = new byte[Crypto.secParamBytes];
-			Crypto.sr.nextBytes(predata.sscot_r[i]);
-		}
-		predata.sscot_s_DE = Crypto.sr.nextInt(l);
-		predata.sscot_s_CE = Crypto.sr.nextInt(l);
-
-		timer.start(M.offline_write);
-		con1.write(offline_band, predata.sscot_k);
-		con1.write(offline_band, predata.sscot_r);
-		con1.write(offline_band, predata.sscot_s_DE);
-		con2.write(offline_band, predata.sscot_s_CE);
-		timer.stop(M.offline_write);
-
-		predata.sscot_F_k = new PRF(Crypto.secParam);
-		predata.sscot_F_k.init(predata.sscot_k);
-
-		timer.stop(M.offline_comp);
-	}
-
-	public void runD(PreData predata, int l) {
-		timer.start(M.offline_comp);
-
-		predata.sscot_s_CD = Crypto.sr.nextInt(l);
-
-		timer.start(M.offline_write);
-		con2.write(offline_band, predata.sscot_s_CD);
-		timer.stop(M.offline_write);
-
-		timer.start(M.offline_read);
-		predata.sscot_k = con1.readAndDec();
-		predata.sscot_r = con1.readDoubleByteArrayAndDec();
-		predata.sscot_s_DE = con1.readIntAndDec();
-		timer.stop(M.offline_read);
-
-		predata.sscot_F_k = new PRF(Crypto.secParam);
-		predata.sscot_F_k.init(predata.sscot_k);
-
-		timer.stop(M.offline_comp);
-	}
-
-	public void runC(PreData predata) {
-		timer.start(M.offline_comp);
-
-		timer.start(M.offline_read);
-		predata.sscot_s_CE = con1.readIntAndDec();
-		predata.sscot_s_CD = con2.readIntAndDec();
-		timer.stop(M.offline_read);
-
-		timer.stop(M.offline_comp);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-	}
-}

+ 0 - 67
src/pir/precomputation/PrePIRIOT.java

@@ -1,67 +0,0 @@
-package pir.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import crypto.PRF;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PrePIRIOT extends Protocol {
-
-	private int pid = P.IOT;
-
-	public PrePIRIOT(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, int n, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		predata.ssiot_kprime = PRF.generateKey(Crypto.sr);
-		predata.ssiot_r = Util.nextBytes(Crypto.secParamBytes, Crypto.sr);
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.ssiot_kprime);
-		con1.write(predata.ssiot_r);
-		timer.stop(pid, M.offline_write);
-
-		predata.ssiot_F_kprime = new PRF(Crypto.secParam);
-		predata.ssiot_F_kprime.init(predata.ssiot_kprime);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runD(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		timer.start(pid, M.offline_read);
-		predata.ssiot_kprime = con1.read();
-		predata.ssiot_r = con1.read();
-		timer.stop(pid, M.offline_read);
-
-		predata.ssiot_F_kprime = new PRF(Crypto.secParam);
-		predata.ssiot_F_kprime.init(predata.ssiot_kprime);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runC() {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 75
src/pir/precomputation/PrePIRReshuffle.java

@@ -1,75 +0,0 @@
-package pir.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PrePIRReshuffle extends Protocol {
-
-	private int pid = P.RSF;
-
-	public PrePIRReshuffle(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		predata.reshuffle_pi = Util.inversePermutation(predata.access_sigma);
-
-		timer.start(pid, M.offline_read);
-		predata.pir_reshuffle_r = con1.readDoubleByteArray();
-		timer.stop(pid, M.offline_read);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runD(PreData predata, int[] tupleParam, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		predata.reshuffle_pi = Util.inversePermutation(predata.access_sigma);
-		int numTuples = predata.reshuffle_pi.length;
-		predata.pir_reshuffle_p = new byte[numTuples][];
-		predata.pir_reshuffle_r = new byte[numTuples][];
-		byte[][] a = new byte[numTuples][];
-		for (int i = 0; i < numTuples; i++) {
-			predata.pir_reshuffle_p[i] = Util.nextBytes(1, Crypto.sr);
-			predata.pir_reshuffle_r[i] = Util.nextBytes(1, Crypto.sr);
-			a[i] = Util.xor(predata.pir_reshuffle_p[i], predata.pir_reshuffle_r[i]);
-		}
-		predata.pir_reshuffle_a_prime = Util.permute(a, predata.reshuffle_pi);
-
-		timer.start(pid, M.offline_write);
-		con2.write(predata.pir_reshuffle_p);
-		con2.write(predata.pir_reshuffle_a_prime);
-		con1.write(predata.pir_reshuffle_r);
-		timer.stop(pid, M.offline_write);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runC(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_read);
-		predata.pir_reshuffle_p = con2.readDoubleByteArray();
-		predata.pir_reshuffle_a_prime = con2.readDoubleByteArray();
-		timer.stop(pid, M.offline_read);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 99
src/pir/precomputation/PrePIRRetrieve.java

@@ -1,99 +0,0 @@
-package pir.precomputation;
-
-import communication.Communication;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.precomputation.PreEviction;
-import protocols.precomputation.PrePostProcessT;
-import protocols.precomputation.PreUpdateRoot;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.Timer;
-
-public class PrePIRRetrieve extends Protocol {
-	public PrePIRRetrieve(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	// TODO: not all protocols run on all trees (remove unnecessary precomp)
-
-	public void runE(PreData[] predata, Metadata md, int ti, Timer timer) {
-		// 1st eviction
-		PrePIRAccess preaccess = new PrePIRAccess(con1, con2);
-		PrePIRReshuffle prereshuffle = new PrePIRReshuffle(con1, con2);
-		PrePostProcessT prepostprocesst = new PrePostProcessT(con1, con2);
-		PreUpdateRoot preupdateroot = new PreUpdateRoot(con1, con2);
-		PreEviction preeviction = new PreEviction(con1, con2);
-
-		int numTuples = md.getStashSizeOfTree(ti) + md.getLBitsOfTree(ti) * md.getW();
-		int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-				md.getABytesOfTree(ti) };
-
-		preaccess.runE(predata[0], md.getTwoTauPow(), numTuples, tupleParam, timer);
-		prereshuffle.runE(predata[0], timer);
-		prepostprocesst.runE(predata[0], timer);
-		preupdateroot.runE(predata[0], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), timer);
-		preeviction.runE(predata[0], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), timer);
-
-		// 2nd eviction
-		preupdateroot.runE(predata[1], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), timer);
-		preeviction.runE(predata[1], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), timer);
-	}
-
-	public long[] runD(PreData[] predata, Metadata md, int ti, PreData prev, Timer timer) {
-		// 1st eviction
-		PrePIRAccess preaccess = new PrePIRAccess(con1, con2);
-		PrePIRReshuffle prereshuffle = new PrePIRReshuffle(con1, con2);
-		PrePostProcessT prepostprocesst = new PrePostProcessT(con1, con2);
-		PreUpdateRoot preupdateroot = new PreUpdateRoot(con1, con2);
-		PreEviction preeviction = new PreEviction(con1, con2);
-
-		int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-				md.getABytesOfTree(ti) };
-		long[] cnt = new long[2];
-
-		preaccess.runD(predata[0], timer);
-		prereshuffle.runD(predata[0], tupleParam, timer);
-		prepostprocesst.runD(predata[0], prev, md.getLBytesOfTree(ti), md.getAlBytesOfTree(ti), md.getTau(), timer);
-		cnt[0] += preupdateroot.runD(predata[0], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), tupleParam,
-				timer);
-		cnt[1] += preeviction.runD(predata[0], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), tupleParam, timer);
-
-		// 2nd eviction
-		cnt[0] += preupdateroot.runD(predata[1], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), tupleParam,
-				timer);
-		cnt[1] += preeviction.runD(predata[1], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), tupleParam, timer);
-
-		return cnt;
-	}
-
-	public void runC(PreData[] predata, Metadata md, int ti, PreData prev, Timer timer) {
-		// 1st eviction
-		PrePIRAccess preaccess = new PrePIRAccess(con1, con2);
-		PrePIRReshuffle prereshuffle = new PrePIRReshuffle(con1, con2);
-		PrePostProcessT prepostprocesst = new PrePostProcessT(con1, con2);
-		PreUpdateRoot preupdateroot = new PreUpdateRoot(con1, con2);
-		PreEviction preeviction = new PreEviction(con1, con2);
-
-		preaccess.runC(timer);
-		prereshuffle.runC(predata[0], timer);
-		prepostprocesst.runC(predata[0], prev, md.getLBytesOfTree(ti), md.getAlBytesOfTree(ti), timer);
-		preupdateroot.runC(predata[0], ti == 0, timer);
-		preeviction.runC(predata[0], ti == 0, timer);
-
-		// 2nd eviction
-		preupdateroot.runC(predata[1], ti == 0, timer);
-		preeviction.runC(predata[1], ti == 0, timer);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 396
src/protocols/Access.java

@@ -1,396 +0,0 @@
-package protocols;
-
-import java.math.BigInteger;
-import java.util.Arrays;
-
-import org.apache.commons.lang3.ArrayUtils;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.AccessException;
-import exceptions.NoSuchPartyException;
-import oram.Bucket;
-import oram.Forest;
-import oram.Global;
-import oram.Metadata;
-import oram.Tree;
-import oram.Tuple;
-import protocols.precomputation.PreAccess;
-import protocols.struct.OutAccess;
-import protocols.struct.OutSSCOT;
-import protocols.struct.OutSSIOT;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class Access extends Protocol {
-
-	private int pid = P.ACC;
-
-	public Access(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public OutAccess runE(PreData predata, Tree OTi, byte[] Ni, byte[] Nip1_pr, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 0: get Li from C
-		byte[] Li = new byte[0];
-		timer.start(pid, M.online_read);
-		if (OTi.getTreeIndex() > 0)
-			Li = con2.read(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 1
-		Bucket[] pathBuckets = OTi.getBucketsOnPath(Li);
-		Tuple[] pathTuples = Bucket.bucketsToTuples(pathBuckets);
-		for (int i = 0; i < pathTuples.length; i++)
-			pathTuples[i].setXor(predata.access_p[i]);
-		pathTuples = Util.permute(pathTuples, predata.access_sigma);
-
-		// step 3
-		byte[] y = null;
-		if (OTi.getTreeIndex() == 0)
-			y = pathTuples[0].getA();
-		else if (OTi.getTreeIndex() < OTi.getH() - 1)
-			y = Util.nextBytes(OTi.getABytes(), Crypto.sr);
-		else
-			y = new byte[OTi.getABytes()];
-
-		if (OTi.getTreeIndex() > 0) {
-			byte[][] a = new byte[pathTuples.length][];
-			byte[][] m = new byte[pathTuples.length][];
-			for (int i = 0; i < pathTuples.length; i++) {
-				m[i] = Util.xor(pathTuples[i].getA(), y);
-				a[i] = ArrayUtils.addAll(pathTuples[i].getF(), pathTuples[i].getN());
-				for (int j = 0; j < Ni.length; j++)
-					a[i][a[i].length - 1 - j] ^= Ni[Ni.length - 1 - j];
-			}
-
-			SSCOT sscot = new SSCOT(con1, con2);
-			sscot.runE(predata, m, a, timer);
-		}
-
-		// step 4
-		if (OTi.getTreeIndex() < OTi.getH() - 1) {
-			int ySegBytes = y.length / OTi.getTwoTauPow();
-			byte[][] y_array = new byte[OTi.getTwoTauPow()][];
-			for (int i = 0; i < OTi.getTwoTauPow(); i++)
-				y_array[i] = Arrays.copyOfRange(y, i * ySegBytes, (i + 1) * ySegBytes);
-
-			SSIOT ssiot = new SSIOT(con1, con2);
-			ssiot.runE(predata, y_array, Nip1_pr, timer);
-		}
-
-		// step 5
-		Tuple Ti = null;
-		if (OTi.getTreeIndex() == 0)
-			Ti = pathTuples[0];
-		else
-			Ti = new Tuple(new byte[1], Ni, Li, y);
-
-		OutAccess outaccess = new OutAccess(Li, null, null, null, null, Ti, pathTuples);
-
-		timer.stop(pid, M.online_comp);
-		return outaccess;
-	}
-
-	public byte[] runD(PreData predata, Tree OTi, byte[] Ni, byte[] Nip1_pr, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 0: get Li from C
-		byte[] Li = new byte[0];
-		timer.start(pid, M.online_read);
-		if (OTi.getTreeIndex() > 0)
-			Li = con2.read(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 1
-		Bucket[] pathBuckets = OTi.getBucketsOnPath(Li);
-		Tuple[] pathTuples = Bucket.bucketsToTuples(pathBuckets);
-		for (int i = 0; i < pathTuples.length; i++)
-			pathTuples[i].setXor(predata.access_p[i]);
-		pathTuples = Util.permute(pathTuples, predata.access_sigma);
-
-		// step 2
-		timer.start(pid, M.online_write);
-		con2.write(pid, pathTuples);
-		con2.write(pid, Ni);
-		timer.stop(pid, M.online_write);
-
-		// step 3
-		if (OTi.getTreeIndex() > 0) {
-			byte[][] b = new byte[pathTuples.length][];
-			for (int i = 0; i < pathTuples.length; i++) {
-				b[i] = ArrayUtils.addAll(pathTuples[i].getF(), pathTuples[i].getN());
-				b[i][0] ^= 1;
-				for (int j = 0; j < Ni.length; j++)
-					b[i][b[i].length - 1 - j] ^= Ni[Ni.length - 1 - j];
-			}
-
-			SSCOT sscot = new SSCOT(con1, con2);
-			sscot.runD(predata, b, timer);
-		}
-
-		// step 4
-		if (OTi.getTreeIndex() < OTi.getH() - 1) {
-			SSIOT ssiot = new SSIOT(con1, con2);
-			ssiot.runD(predata, Nip1_pr, timer);
-		}
-
-		timer.stop(pid, M.online_comp);
-
-		return Li;
-	}
-
-	public OutAccess runC(Metadata md, int treeIndex, byte[] Li, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 0: send Li to E and D
-		timer.start(pid, M.online_write);
-		if (treeIndex > 0) {
-			con1.write(pid, Li);
-			con2.write(pid, Li);
-		}
-		timer.stop(pid, M.online_write);
-
-		// step 2
-		timer.start(pid, M.online_read);
-		Tuple[] pathTuples = con2.readTupleArray(pid);
-		byte[] Ni = con2.read(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 3
-		int j1 = 0;
-		byte[] z = null;
-		if (treeIndex == 0) {
-			z = pathTuples[0].getA();
-		} else {
-			SSCOT sscot = new SSCOT(con1, con2);
-			OutSSCOT je = sscot.runC(timer);
-			j1 = je.t;
-			byte[] d = pathTuples[j1].getA();
-			z = Util.xor(je.m_t, d);
-		}
-
-		// step 4
-		int j2 = 0;
-		byte[] Lip1 = null;
-		if (treeIndex < md.getNumTrees() - 1) {
-			SSIOT ssiot = new SSIOT(con1, con2);
-			OutSSIOT jy = ssiot.runC(timer);
-
-			// step 5
-			j2 = jy.t;
-			int lSegBytes = md.getABytesOfTree(treeIndex) / md.getTwoTauPow();
-			byte[] z_j2 = Arrays.copyOfRange(z, j2 * lSegBytes, (j2 + 1) * lSegBytes);
-			Lip1 = Util.xor(jy.m_t, z_j2);
-		}
-
-		Tuple Ti = null;
-		if (treeIndex == 0) {
-			Ti = pathTuples[0];
-		} else {
-			Ti = new Tuple(new byte[] { 1 }, Ni, new byte[md.getLBytesOfTree(treeIndex)], z);
-
-			pathTuples[j1].getF()[0] = (byte) (1 - pathTuples[j1].getF()[0]);
-			Crypto.sr.nextBytes(pathTuples[j1].getN());
-			Crypto.sr.nextBytes(pathTuples[j1].getL());
-			Crypto.sr.nextBytes(pathTuples[j1].getA());
-		}
-
-		OutAccess outaccess = new OutAccess(Li, Lip1, Ti, pathTuples, j2, null, null);
-
-		timer.stop(pid, M.online_comp);
-		return outaccess;
-	}
-
-	public OutAccess runE2(Tree OTi, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 0: get Li from C
-		byte[] Li = new byte[0];
-		timer.start(pid, M.online_read);
-		if (OTi.getTreeIndex() > 0)
-			Li = con2.read(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 1
-		Bucket[] pathBuckets = OTi.getBucketsOnPath(Li);
-		Tuple[] pathTuples = Bucket.bucketsToTuples(pathBuckets);
-
-		// step 5
-		Tuple Ti = null;
-		if (OTi.getTreeIndex() == 0)
-			Ti = pathTuples[0];
-		else {
-			Ti = new Tuple(1, OTi.getNBytes(), OTi.getLBytes(), OTi.getABytes(), Crypto.sr);
-			Ti.setF(new byte[1]);
-		}
-
-		OutAccess outaccess = new OutAccess(Li, null, null, null, null, Ti, pathTuples);
-
-		timer.stop(pid, M.online_comp);
-		return outaccess;
-	}
-
-	public byte[] runD2(Tree OTi, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 0: get Li from C
-		byte[] Li = new byte[0];
-		timer.start(pid, M.online_read);
-		if (OTi.getTreeIndex() > 0)
-			Li = con2.read(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 1
-		Bucket[] pathBuckets = OTi.getBucketsOnPath(Li);
-		Tuple[] pathTuples = Bucket.bucketsToTuples(pathBuckets);
-
-		// step 2
-		timer.start(pid, M.online_write);
-		con2.write(pid, pathTuples);
-		timer.stop(pid, M.online_write);
-
-		timer.stop(pid, M.online_comp);
-		return Li;
-	}
-
-	public OutAccess runC2(Metadata md, int treeIndex, byte[] Li, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 0: send Li to E and D
-		timer.start(pid, M.online_write);
-		if (treeIndex > 0) {
-			con1.write(pid, Li);
-			con2.write(pid, Li);
-		}
-		timer.stop(pid, M.online_write);
-
-		// step 2
-		timer.start(pid, M.online_read);
-		Tuple[] pathTuples = con2.readTupleArray(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 5
-		Tuple Ti = null;
-		if (treeIndex == 0) {
-			Ti = pathTuples[0];
-		} else {
-			Ti = new Tuple(1, md.getNBytesOfTree(treeIndex), md.getLBytesOfTree(treeIndex),
-					md.getABytesOfTree(treeIndex), Crypto.sr);
-			Ti.setF(new byte[1]);
-		}
-
-		OutAccess outaccess = new OutAccess(Li, null, Ti, pathTuples, null, null, null);
-
-		timer.stop(pid, M.online_comp);
-		return outaccess;
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		int records = 5;
-		int repeat = 5;
-
-		int tau = md.getTau();
-		int numTrees = md.getNumTrees();
-		long numInsert = md.getNumInsertRecords();
-		int addrBits = md.getAddrBits();
-
-		Timer timer = new Timer();
-
-		sanityCheck();
-
-		System.out.println();
-
-		for (int i = 0; i < records; i++) {
-			long N = Global.cheat ? 0 : Util.nextLong(numInsert, Crypto.sr);
-
-			for (int j = 0; j < repeat; j++) {
-				System.out.println("Test: " + i + " " + j);
-				System.out.println("N=" + BigInteger.valueOf(N).toString(2));
-
-				byte[] Li = new byte[0];
-
-				for (int ti = 0; ti < numTrees; ti++) {
-					long Ni_value = Util.getSubBits(N, addrBits, addrBits - md.getNBitsOfTree(ti));
-					long Nip1_pr_value = Util.getSubBits(N, addrBits - md.getNBitsOfTree(ti),
-							Math.max(addrBits - md.getNBitsOfTree(ti) - tau, 0));
-					byte[] Ni = Util.longToBytes(Ni_value, md.getNBytesOfTree(ti));
-					byte[] Nip1_pr = Util.longToBytes(Nip1_pr_value, (tau + 7) / 8);
-
-					PreData predata = new PreData();
-					PreAccess preaccess = new PreAccess(con1, con2);
-
-					if (party == Party.Eddie) {
-						Tree OTi = forest.getTree(ti);
-						int numTuples = (OTi.getD() - 1) * OTi.getW() + OTi.getStashSize();
-						int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-								md.getABytesOfTree(ti) };
-						preaccess.runE(predata, md.getTwoTauPow(), numTuples, tupleParam, timer);
-
-						byte[] sE_Ni = Util.nextBytes(Ni.length, Crypto.sr);
-						byte[] sD_Ni = Util.xor(Ni, sE_Ni);
-						con1.write(sD_Ni);
-
-						byte[] sE_Nip1_pr = Util.nextBytes(Nip1_pr.length, Crypto.sr);
-						byte[] sD_Nip1_pr = Util.xor(Nip1_pr, sE_Nip1_pr);
-						con1.write(sD_Nip1_pr);
-
-						runE(predata, OTi, sE_Ni, sE_Nip1_pr, timer);
-
-						if (ti == numTrees - 1)
-							con2.write(N);
-
-					} else if (party == Party.Debbie) {
-						Tree OTi = forest.getTree(ti);
-						preaccess.runD(predata, timer);
-
-						byte[] sD_Ni = con1.read();
-
-						byte[] sD_Nip1_pr = con1.read();
-
-						runD(predata, OTi, sD_Ni, sD_Nip1_pr, timer);
-
-					} else if (party == Party.Charlie) {
-						preaccess.runC(timer);
-
-						System.out.println("L" + ti + "=" + new BigInteger(1, Li).toString(2));
-
-						OutAccess outaccess = runC(md, ti, Li, timer);
-
-						Li = outaccess.C_Lip1;
-
-						if (ti == numTrees - 1) {
-							N = con1.readLong();
-							long data = new BigInteger(1, outaccess.C_Ti.getA()).longValue();
-							if (N == data) {
-								System.out.println("Access passed");
-								System.out.println();
-							} else {
-								throw new AccessException("Access failed");
-							}
-						}
-
-					} else {
-						throw new NoSuchPartyException(party + "");
-					}
-				}
-			}
-		}
-
-		// timer.print();
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 246
src/protocols/PostProcessT.java

@@ -1,246 +0,0 @@
-package protocols;
-
-import java.math.BigInteger;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.AccessException;
-import exceptions.NoSuchPartyException;
-import oram.Forest;
-import oram.Global;
-import oram.Metadata;
-import oram.Tree;
-import oram.Tuple;
-import protocols.precomputation.PreAccess;
-import protocols.precomputation.PrePostProcessT;
-import protocols.struct.OutAccess;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PostProcessT extends Protocol {
-
-	private int pid = P.PPT;
-
-	public PostProcessT(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public Tuple runE(PreData predata, Tuple Ti, boolean lastTree, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		if (lastTree) {
-			Tuple out = new Tuple(Ti);
-			Util.setXor(out.getL(), predata.ppt_Li);
-
-			timer.stop(pid, M.online_comp);
-			return out;
-		}
-
-		// step 1
-		timer.start(pid, M.online_read);
-		int delta = con2.readInt(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 3
-		int twoTauPow = predata.ppt_s.length;
-		byte[][] e = new byte[twoTauPow][];
-		for (int i = 0; i < twoTauPow; i++)
-			e[i] = predata.ppt_s[(i + delta) % twoTauPow];
-		byte[] e_all = new byte[twoTauPow * e[0].length];
-		for (int i = 0; i < twoTauPow; i++)
-			System.arraycopy(e[i], 0, e_all, i * e[0].length, e[0].length);
-
-		Tuple out = new Tuple(Ti);
-		Util.setXor(out.getL(), predata.ppt_Li);
-		Util.setXor(out.getA(), e_all);
-
-		timer.stop(pid, M.online_comp);
-		return out;
-	}
-
-	public void runD() {
-	}
-
-	public Tuple runC(PreData predata, Tuple Ti, byte[] Li, byte[] Lip1, int j2, boolean lastTree, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		if (lastTree) {
-			Tuple out = new Tuple(Ti);
-			Util.setXor(out.getL(), Util.xor(Li, predata.ppt_Li));
-
-			timer.stop(pid, M.online_comp);
-			return out;
-		}
-
-		// step 1
-		int twoTauPow = predata.ppt_r.length;
-		int delta = (predata.ppt_alpha - j2 + twoTauPow) % twoTauPow;
-
-		timer.start(pid, M.online_write);
-		con1.write(pid, delta);
-		timer.stop(pid, M.online_write);
-
-		// step 2
-		byte[][] c = new byte[twoTauPow][];
-		for (int i = 0; i < twoTauPow; i++)
-			c[i] = predata.ppt_r[(i + delta) % twoTauPow];
-		c[j2] = Util.xor(Util.xor(c[j2], Lip1), predata.ppt_Lip1);
-		byte[] c_all = new byte[twoTauPow * Lip1.length];
-		for (int i = 0; i < twoTauPow; i++)
-			System.arraycopy(c[i], 0, c_all, i * Lip1.length, Lip1.length);
-
-		Tuple out = new Tuple(Ti);
-		Util.setXor(out.getL(), Util.xor(Li, predata.ppt_Li));
-		Util.setXor(out.getA(), c_all);
-
-		timer.stop(pid, M.online_comp);
-		return out;
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		int records = 5;
-		int repeat = 5;
-
-		int tau = md.getTau();
-		int numTrees = md.getNumTrees();
-		long numInsert = md.getNumInsertRecords();
-		int addrBits = md.getAddrBits();
-
-		Timer timer = new Timer();
-
-		sanityCheck();
-
-		System.out.println();
-
-		for (int i = 0; i < records; i++) {
-			long N = Global.cheat ? 0 : Util.nextLong(numInsert, Crypto.sr);
-
-			for (int j = 0; j < repeat; j++) {
-				System.out.println("Test: " + i + " " + j);
-				System.out.println("N=" + BigInteger.valueOf(N).toString(2));
-
-				byte[] Li = new byte[0];
-
-				PreData prev = null;
-
-				for (int ti = 0; ti < numTrees; ti++) {
-					long Ni_value = Util.getSubBits(N, addrBits, addrBits - md.getNBitsOfTree(ti));
-					long Nip1_pr_value = Util.getSubBits(N, addrBits - md.getNBitsOfTree(ti),
-							Math.max(addrBits - md.getNBitsOfTree(ti) - tau, 0));
-					byte[] Ni = Util.longToBytes(Ni_value, md.getNBytesOfTree(ti));
-					byte[] Nip1_pr = Util.longToBytes(Nip1_pr_value, (tau + 7) / 8);
-
-					PreData predata = new PreData();
-					PreAccess preaccess = new PreAccess(con1, con2);
-					Access access = new Access(con1, con2);
-					PrePostProcessT prepostprocesst = new PrePostProcessT(con1, con2);
-
-					if (party == Party.Eddie) {
-						Tree OTi = forest.getTree(ti);
-						int numTuples = (OTi.getD() - 1) * OTi.getW() + OTi.getStashSize();
-						int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-								md.getABytesOfTree(ti) };
-						preaccess.runE(predata, md.getTwoTauPow(), numTuples, tupleParam, timer);
-
-						byte[] sE_Ni = Util.nextBytes(Ni.length, Crypto.sr);
-						byte[] sD_Ni = Util.xor(Ni, sE_Ni);
-						con1.write(sD_Ni);
-
-						byte[] sE_Nip1_pr = Util.nextBytes(Nip1_pr.length, Crypto.sr);
-						byte[] sD_Nip1_pr = Util.xor(Nip1_pr, sE_Nip1_pr);
-						con1.write(sD_Nip1_pr);
-
-						OutAccess outaccess = access.runE(predata, OTi, sE_Ni, sE_Nip1_pr, timer);
-
-						if (ti == numTrees - 1)
-							con2.write(N);
-
-						prepostprocesst.runE(predata, timer);
-						Tuple Ti_prime = runE(predata, outaccess.E_Ti, ti == numTrees - 1, timer);
-
-						Ti_prime.setXor(con2.readTuple());
-						byte[] Li_prime = Util.xor(predata.ppt_Li, con2.read());
-						byte[] Lip1_prime = Util.xor(predata.ppt_Lip1, con2.read());
-						int j2 = con2.readInt();
-						Tuple Ti = outaccess.E_Ti.xor(con2.readTuple());
-
-						if (!Util.equal(Ti.getF(), Ti_prime.getF()))
-							System.err.println("PPT test failed");
-						else if (!Util.equal(Ti.getN(), Ti_prime.getN()))
-							System.err.println("PPT test failed");
-						else if (!Util.equal(Li_prime, Ti_prime.getL()))
-							System.err.println("PPT test failed");
-						else if (!Util.equal(Lip1_prime,
-								Ti_prime.getSubA(j2 * Lip1_prime.length, (j2 + 1) * Lip1_prime.length)))
-							System.err.println("PPT test failed");
-						else
-							System.out.println("PPT test passed");
-
-					} else if (party == Party.Debbie) {
-						Tree OTi = forest.getTree(ti);
-						preaccess.runD(predata, timer);
-
-						byte[] sD_Ni = con1.read();
-
-						byte[] sD_Nip1_pr = con1.read();
-
-						access.runD(predata, OTi, sD_Ni, sD_Nip1_pr, timer);
-
-						prepostprocesst.runD(predata, prev, md.getLBytesOfTree(ti), md.getAlBytesOfTree(ti), tau,
-								timer);
-						runD();
-
-					} else if (party == Party.Charlie) {
-						preaccess.runC(timer);
-
-						System.out.println("L" + ti + "=" + new BigInteger(1, Li).toString(2));
-
-						OutAccess outaccess = access.runC(md, ti, Li, timer);
-
-						prepostprocesst.runC(predata, prev, md.getLBytesOfTree(ti), md.getAlBytesOfTree(ti), timer);
-						Tuple Ti_prime = runC(predata, outaccess.C_Ti, Li, outaccess.C_Lip1, outaccess.C_j2,
-								ti == numTrees - 1, timer);
-
-						Li = outaccess.C_Lip1;
-
-						if (ti == numTrees - 1) {
-							N = con1.readLong();
-							long data = new BigInteger(1, outaccess.C_Ti.getA()).longValue();
-							if (N == data) {
-								System.out.println("Access passed");
-								System.out.println();
-							} else {
-								throw new AccessException("Access failed");
-							}
-						}
-
-						con1.write(Ti_prime);
-						con1.write(predata.ppt_Li);
-						con1.write(predata.ppt_Lip1);
-						con1.write(outaccess.C_j2);
-						con1.write(outaccess.C_Ti);
-
-					} else {
-						throw new NoSuchPartyException(party + "");
-					}
-
-					prev = predata;
-				}
-			}
-		}
-
-		// timer.print();
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 214
src/protocols/Reshuffle.java

@@ -1,214 +0,0 @@
-package protocols;
-
-import java.math.BigInteger;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.AccessException;
-import exceptions.NoSuchPartyException;
-import oram.Forest;
-import oram.Global;
-import oram.Metadata;
-import oram.Tree;
-import oram.Tuple;
-import protocols.precomputation.PreAccess;
-import protocols.precomputation.PreReshuffle;
-import protocols.struct.OutAccess;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class Reshuffle extends Protocol {
-
-	private int pid = P.RSF;
-
-	public Reshuffle(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public Tuple[] runE(PreData predata, Tuple[] path, boolean firstTree, Timer timer) {
-		if (firstTree)
-			return path;
-
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		timer.start(pid, M.online_read);
-		Tuple[] z = con2.readTupleArray(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 2
-		Tuple[] b = new Tuple[z.length];
-		for (int i = 0; i < b.length; i++)
-			b[i] = path[i].xor(z[i]).xor(predata.reshuffle_r[i]);
-		Tuple[] b_prime = Util.permute(b, predata.reshuffle_pi);
-
-		timer.stop(pid, M.online_comp);
-		return b_prime;
-	}
-
-	public void runD() {
-	}
-
-	public Tuple[] runC(PreData predata, Tuple[] path, boolean firstTree, Timer timer) {
-		if (firstTree)
-			return path;
-
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		Tuple[] z = new Tuple[path.length];
-		for (int i = 0; i < z.length; i++)
-			z[i] = path[i].xor(predata.reshuffle_p[i]);
-
-		timer.start(pid, M.online_write);
-		con1.write(pid, z);
-		timer.stop(pid, M.online_write);
-
-		timer.stop(pid, M.online_comp);
-		return predata.reshuffle_a_prime;
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		int records = 5;
-		int repeat = 5;
-
-		int tau = md.getTau();
-		int numTrees = md.getNumTrees();
-		long numInsert = md.getNumInsertRecords();
-		int addrBits = md.getAddrBits();
-
-		Timer timer = new Timer();
-
-		sanityCheck();
-
-		System.out.println();
-
-		for (int i = 0; i < records; i++) {
-			long N = Global.cheat ? 0 : Util.nextLong(numInsert, Crypto.sr);
-
-			for (int j = 0; j < repeat; j++) {
-				System.out.println("Test: " + i + " " + j);
-				System.out.println("N=" + BigInteger.valueOf(N).toString(2));
-
-				byte[] Li = new byte[0];
-
-				for (int ti = 0; ti < numTrees; ti++) {
-					long Ni_value = Util.getSubBits(N, addrBits, addrBits - md.getNBitsOfTree(ti));
-					long Nip1_pr_value = Util.getSubBits(N, addrBits - md.getNBitsOfTree(ti),
-							Math.max(addrBits - md.getNBitsOfTree(ti) - tau, 0));
-					byte[] Ni = Util.longToBytes(Ni_value, md.getNBytesOfTree(ti));
-					byte[] Nip1_pr = Util.longToBytes(Nip1_pr_value, (tau + 7) / 8);
-
-					PreData predata = new PreData();
-					PreAccess preaccess = new PreAccess(con1, con2);
-					Access access = new Access(con1, con2);
-					PreReshuffle prereshuffle = new PreReshuffle(con1, con2);
-
-					if (party == Party.Eddie) {
-						Tree OTi = forest.getTree(ti);
-						int numTuples = (OTi.getD() - 1) * OTi.getW() + OTi.getStashSize();
-						int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-								md.getABytesOfTree(ti) };
-						preaccess.runE(predata, md.getTwoTauPow(), numTuples, tupleParam, timer);
-
-						byte[] sE_Ni = Util.nextBytes(Ni.length, Crypto.sr);
-						byte[] sD_Ni = Util.xor(Ni, sE_Ni);
-						con1.write(sD_Ni);
-
-						byte[] sE_Nip1_pr = Util.nextBytes(Nip1_pr.length, Crypto.sr);
-						byte[] sD_Nip1_pr = Util.xor(Nip1_pr, sE_Nip1_pr);
-						con1.write(sD_Nip1_pr);
-
-						OutAccess outaccess = access.runE(predata, OTi, sE_Ni, sE_Nip1_pr, timer);
-
-						if (ti == numTrees - 1)
-							con2.write(N);
-
-						prereshuffle.runE(predata, timer);
-						Tuple[] E_P_prime = runE(predata, outaccess.E_P, ti == 0, timer);
-
-						Tuple[] C_P = con2.readTupleArray();
-						Tuple[] C_P_prime = con2.readTupleArray();
-						Tuple[] oldPath = new Tuple[C_P.length];
-						Tuple[] newPath = new Tuple[C_P.length];
-
-						for (int k = 0; k < C_P.length; k++) {
-							oldPath[k] = outaccess.E_P[k].xor(C_P[k]);
-							newPath[k] = E_P_prime[k].xor(C_P_prime[k]);
-						}
-						oldPath = Util.permute(oldPath, predata.reshuffle_pi);
-
-						boolean pass = true;
-						for (int k = 0; k < newPath.length; k++) {
-							if (!oldPath[k].equals(newPath[k])) {
-								System.err.println("Reshuffle test failed");
-								pass = false;
-								break;
-							}
-						}
-						if (pass)
-							System.out.println("Reshuffle test passed");
-
-					} else if (party == Party.Debbie) {
-						Tree OTi = forest.getTree(ti);
-						preaccess.runD(predata, timer);
-
-						byte[] sD_Ni = con1.read();
-
-						byte[] sD_Nip1_pr = con1.read();
-
-						access.runD(predata, OTi, sD_Ni, sD_Nip1_pr, timer);
-
-						int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-								md.getABytesOfTree(ti) };
-						prereshuffle.runD(predata, tupleParam, timer);
-						runD();
-
-					} else if (party == Party.Charlie) {
-						preaccess.runC(timer);
-
-						System.out.println("L" + ti + "=" + new BigInteger(1, Li).toString(2));
-
-						OutAccess outaccess = access.runC(md, ti, Li, timer);
-
-						prereshuffle.runC(predata, timer);
-						Tuple[] C_P_prime = runC(predata, outaccess.C_P, ti == 0, timer);
-
-						Li = outaccess.C_Lip1;
-
-						if (ti == numTrees - 1) {
-							N = con1.readLong();
-							long data = new BigInteger(1, outaccess.C_Ti.getA()).longValue();
-							if (N == data) {
-								System.out.println("Access passed");
-								System.out.println();
-							} else {
-								throw new AccessException("Access failed");
-							}
-						}
-
-						con1.write(outaccess.C_P);
-						con1.write(C_P_prime);
-
-					} else {
-						throw new NoSuchPartyException(party + "");
-					}
-				}
-			}
-		}
-
-		// timer.print();
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 382
src/protocols/Retrieve.java

@@ -1,382 +0,0 @@
-package protocols;
-
-import java.math.BigInteger;
-import java.util.Arrays;
-
-import communication.Communication;
-import crypto.Crypto;
-import exceptions.AccessException;
-import exceptions.NoSuchPartyException;
-import oram.Forest;
-import oram.Global;
-import oram.Metadata;
-import oram.Tree;
-import oram.Tuple;
-import protocols.precomputation.PreRetrieve;
-import protocols.struct.OutAccess;
-import protocols.struct.OutRetrieve;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.Bandwidth;
-import util.P;
-import util.StopWatch;
-import util.Timer;
-import util.Util;
-
-public class Retrieve extends Protocol {
-
-	Communication[] cons1;
-	Communication[] cons2;
-
-	public Retrieve(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void setCons(Communication[] a, Communication[] b) {
-		cons1 = a;
-		cons2 = b;
-	}
-
-	public void runE(PreData[] predata, Tree OTi, byte[] Ni, byte[] Nip1_pr, int h, Timer timer) {
-		// 1st eviction
-		Access access = new Access(con1, con2);
-		Reshuffle reshuffle = new Reshuffle(con1, con2);
-		PostProcessT postprocesst = new PostProcessT(con1, con2);
-		UpdateRoot updateroot = new UpdateRoot(con1, con2);
-		Eviction eviction = new Eviction(con1, con2);
-
-		OutAccess outaccess = access.runE(predata[0], OTi, Ni, Nip1_pr, timer);
-		Tuple[] path = reshuffle.runE(predata[0], outaccess.E_P, OTi.getTreeIndex() == 0, timer);
-		Tuple Ti = postprocesst.runE(predata[0], outaccess.E_Ti, OTi.getTreeIndex() == h - 1, timer);
-		Tuple[] root = Arrays.copyOfRange(path, 0, OTi.getStashSize());
-		root = updateroot.runE(predata[0], OTi.getTreeIndex() == 0, outaccess.Li, root, Ti, timer);
-		System.arraycopy(root, 0, path, 0, root.length);
-		eviction.runE(predata[0], OTi.getTreeIndex() == 0, outaccess.Li,
-				OTi.getTreeIndex() == 0 ? new Tuple[] { Ti } : path, OTi, timer);
-
-		// 2nd eviction
-		OutAccess outaccess2 = access.runE2(OTi, timer);
-		Tuple[] path2 = outaccess2.E_P;
-		Tuple Ti2 = outaccess2.E_Ti;
-		Tuple[] root2 = Arrays.copyOfRange(path2, 0, OTi.getStashSize());
-		root2 = updateroot.runE(predata[1], OTi.getTreeIndex() == 0, outaccess2.Li, root2, Ti2, timer);
-		System.arraycopy(root2, 0, path2, 0, root2.length);
-		eviction.runE(predata[1], OTi.getTreeIndex() == 0, outaccess2.Li,
-				OTi.getTreeIndex() == 0 ? new Tuple[] { Ti2 } : path2, OTi, timer);
-	}
-
-	public void runD(PreData predata[], Tree OTi, byte[] Ni, byte[] Nip1_pr, Timer timer) {
-		// 1st eviction
-		Access access = new Access(con1, con2);
-		Reshuffle reshuffle = new Reshuffle(con1, con2);
-		PostProcessT postprocesst = new PostProcessT(con1, con2);
-		UpdateRoot updateroot = new UpdateRoot(con1, con2);
-		Eviction eviction = new Eviction(con1, con2);
-
-		byte[] Li = access.runD(predata[0], OTi, Ni, Nip1_pr, timer);
-		reshuffle.runD();
-		postprocesst.runD();
-		updateroot.runD(predata[0], OTi.getTreeIndex() == 0, Li, OTi.getW(), timer);
-		eviction.runD(predata[0], OTi.getTreeIndex() == 0, Li, OTi, timer);
-
-		// 2nd eviction
-		byte[] Li2 = access.runD2(OTi, timer);
-		updateroot.runD(predata[1], OTi.getTreeIndex() == 0, Li2, OTi.getW(), timer);
-		eviction.runD(predata[1], OTi.getTreeIndex() == 0, Li2, OTi, timer);
-	}
-
-	public OutAccess runC(PreData[] predata, Metadata md, int ti, byte[] Li, Timer timer) {
-		// 1st eviction
-		Access access = new Access(con1, con2);
-		Reshuffle reshuffle = new Reshuffle(con1, con2);
-		PostProcessT postprocesst = new PostProcessT(con1, con2);
-		UpdateRoot updateroot = new UpdateRoot(con1, con2);
-		Eviction eviction = new Eviction(con1, con2);
-
-		OutAccess outaccess = access.runC(md, ti, Li, timer);
-		Tuple[] path = reshuffle.runC(predata[0], outaccess.C_P, ti == 0, timer);
-		Tuple Ti = postprocesst.runC(predata[0], outaccess.C_Ti, Li, outaccess.C_Lip1, outaccess.C_j2,
-				ti == md.getNumTrees() - 1, timer);
-		Tuple[] root = Arrays.copyOfRange(path, 0, md.getStashSizeOfTree(ti));
-		root = updateroot.runC(predata[0], ti == 0, root, Ti, timer);
-		System.arraycopy(root, 0, path, 0, root.length);
-		eviction.runC(predata[0], ti == 0, ti == 0 ? new Tuple[] { Ti } : path, md.getLBitsOfTree(ti) + 1,
-				md.getStashSizeOfTree(ti), md.getW(), timer);
-
-		// 2nd eviction
-		byte[] Li2 = Util.nextBytes(md.getLBytesOfTree(ti), Crypto.sr);
-		OutAccess outaccess2 = access.runC2(md, ti, Li2, timer);
-		Tuple[] path2 = outaccess2.C_P;
-		Tuple Ti2 = outaccess2.C_Ti;
-		Tuple[] root2 = Arrays.copyOfRange(path2, 0, md.getStashSizeOfTree(ti));
-		root2 = updateroot.runC(predata[1], ti == 0, root2, Ti2, timer);
-		System.arraycopy(root2, 0, path2, 0, root2.length);
-		eviction.runC(predata[1], ti == 0, ti == 0 ? new Tuple[] { Ti2 } : path2, md.getLBitsOfTree(ti) + 1,
-				md.getStashSizeOfTree(ti), md.getW(), timer);
-
-		return outaccess;
-	}
-
-	public Pipeline pipelineE(PreData[] predata, Tree OTi, byte[] Ni, byte[] Nip1_pr, int h, Timer[] timer) {
-		Access access = new Access(con1, con2);
-		OutAccess outaccess = access.runE(predata[0], OTi, Ni, Nip1_pr, timer[0]);
-
-		int ti = OTi.getTreeIndex();
-		Pipeline pipeline = new Pipeline(cons1[ti + 1], cons2[ti + 1], Party.Eddie, predata, OTi, h, timer[ti + 1],
-				null, ti, outaccess.Li, outaccess);
-		pipeline.start();
-
-		return pipeline;
-	}
-
-	public Pipeline pipelineD(PreData predata[], Tree OTi, byte[] Ni, byte[] Nip1_pr, Timer[] timer) {
-		Access access = new Access(con1, con2);
-		byte[] Li = access.runD(predata[0], OTi, Ni, Nip1_pr, timer[0]);
-
-		int ti = OTi.getTreeIndex();
-		Pipeline pipeline = new Pipeline(cons1[ti + 1], cons2[ti + 1], Party.Debbie, predata, OTi, 0, timer[ti + 1],
-				null, ti, Li, null);
-		pipeline.start();
-
-		return pipeline;
-	}
-
-	public OutRetrieve pipelineC(PreData[] predata, Metadata md, int ti, byte[] Li, Timer[] timer) {
-		Access access = new Access(con1, con2);
-		OutAccess outaccess = access.runC(md, ti, Li, timer[0]);
-
-		Pipeline pipeline = new Pipeline(cons1[ti + 1], cons2[ti + 1], Party.Charlie, predata, null, 0, timer[ti + 1],
-				md, ti, Li, outaccess);
-		pipeline.start();
-
-		return new OutRetrieve(outaccess, pipeline);
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		if (Global.pipeline)
-			System.out.println("Pipeline Mode is On");
-		if (Global.cheat)
-			System.out.println("Cheat Mode is On");
-
-		int records = 30;
-		int reset = 5;
-		int repeat = 10;
-
-		int tau = md.getTau();
-		int numTrees = md.getNumTrees();
-		long numInsert = md.getNumInsertRecords();
-		int addrBits = md.getAddrBits();
-
-		int numTimer = Global.pipeline ? numTrees + 1 : 1;
-		Timer[] timer = new Timer[numTimer];
-		for (int i = 0; i < numTimer; i++)
-			timer[i] = new Timer();
-
-		StopWatch ete_off = new StopWatch("ETE_offline");
-		StopWatch ete_on = new StopWatch("ETE_online");
-
-		long[] gates = new long[2];
-
-		Pipeline[] threads = new Pipeline[numTrees];
-
-		sanityCheck();
-		System.out.println();
-
-		for (int i = 0; i < records; i++) {
-			long N = Global.cheat ? 0 : Util.nextLong(numInsert, Crypto.sr);
-
-			for (int j = 0; j < repeat; j++) {
-				int cycleIndex = i * repeat + j;
-				if (cycleIndex == reset * repeat) {
-					for (int k = 0; k < timer.length; k++)
-						timer[k].reset();
-					ete_on.reset();
-					ete_off.reset();
-				}
-				if (cycleIndex == 1) {
-					for (int k = 0; k < cons1.length; k++) {
-						cons1[k].bandSwitch = false;
-						cons2[k].bandSwitch = false;
-					}
-				}
-
-				System.out.println("Test: " + i + " " + j);
-				System.out.println("N=" + BigInteger.valueOf(N).toString(2));
-
-				System.out.print("Precomputation... ");
-
-				PreData[][] predata = new PreData[numTrees][2];
-				PreRetrieve preretrieve = new PreRetrieve(con1, con2);
-				for (int ti = 0; ti < numTrees; ti++) {
-					predata[ti][0] = new PreData();
-					predata[ti][1] = new PreData();
-
-					if (party == Party.Eddie) {
-						ete_off.start();
-						preretrieve.runE(predata[ti], md, ti, timer[0]);
-						ete_off.stop();
-
-					} else if (party == Party.Debbie) {
-						ete_off.start();
-						long[] cnt = preretrieve.runD(predata[ti], md, ti, ti == 0 ? null : predata[ti - 1][0],
-								timer[0]);
-						ete_off.stop();
-
-						if (cycleIndex == 0) {
-							gates[0] += cnt[0];
-							gates[1] += cnt[1];
-						}
-
-					} else if (party == Party.Charlie) {
-						ete_off.start();
-						preretrieve.runC(predata[ti], md, ti, ti == 0 ? null : predata[ti - 1][0], timer[0]);
-						ete_off.stop();
-
-					} else {
-						throw new NoSuchPartyException(party + "");
-					}
-				}
-
-				sanityCheck();
-				System.out.println("done!");
-
-				byte[] Li = new byte[0];
-				for (int ti = 0; ti < numTrees; ti++) {
-					long Ni_value = Util.getSubBits(N, addrBits, addrBits - md.getNBitsOfTree(ti));
-					long Nip1_pr_value = Util.getSubBits(N, addrBits - md.getNBitsOfTree(ti),
-							Math.max(addrBits - md.getNBitsOfTree(ti) - tau, 0));
-					byte[] Ni = Util.longToBytes(Ni_value, md.getNBytesOfTree(ti));
-					byte[] Nip1_pr = Util.longToBytes(Nip1_pr_value, (tau + 7) / 8);
-
-					if (party == Party.Eddie) {
-						Tree OTi = forest.getTree(ti);
-
-						byte[] sE_Ni = Util.nextBytes(Ni.length, Crypto.sr);
-						byte[] sD_Ni = Util.xor(Ni, sE_Ni);
-						con1.write(sD_Ni);
-
-						byte[] sE_Nip1_pr = Util.nextBytes(Nip1_pr.length, Crypto.sr);
-						byte[] sD_Nip1_pr = Util.xor(Nip1_pr, sE_Nip1_pr);
-						con1.write(sD_Nip1_pr);
-
-						if (!Global.pipeline) {
-							ete_on.start();
-							runE(predata[ti], OTi, sE_Ni, sE_Nip1_pr, numTrees, timer[0]);
-							ete_on.stop();
-						} else {
-							if (ti == 0)
-								ete_on.start();
-							threads[ti] = pipelineE(predata[ti], OTi, sE_Ni, sE_Nip1_pr, numTrees, timer);
-						}
-
-						if (ti == numTrees - 1)
-							con2.write(N);
-
-					} else if (party == Party.Debbie) {
-						Tree OTi = forest.getTree(ti);
-
-						byte[] sD_Ni = con1.read();
-						byte[] sD_Nip1_pr = con1.read();
-
-						if (!Global.pipeline) {
-							ete_on.start();
-							runD(predata[ti], OTi, sD_Ni, sD_Nip1_pr, timer[0]);
-							ete_on.stop();
-						} else {
-							if (ti == 0)
-								ete_on.start();
-							threads[ti] = pipelineD(predata[ti], OTi, sD_Ni, sD_Nip1_pr, timer);
-						}
-
-					} else if (party == Party.Charlie) {
-						int lBits = md.getLBitsOfTree(ti);
-						System.out.println("L" + ti + "="
-								+ Util.addZeros(Util.getSubBits(new BigInteger(1, Li), lBits, 0).toString(2), lBits));
-
-						OutAccess outaccess = null;
-						if (!Global.pipeline) {
-							ete_on.start();
-							outaccess = runC(predata[ti], md, ti, Li, timer[0]);
-							ete_on.stop();
-						} else {
-							if (ti == 0)
-								ete_on.start();
-							OutRetrieve outretrieve = pipelineC(predata[ti], md, ti, Li, timer);
-							outaccess = outretrieve.outaccess;
-							threads[ti] = outretrieve.pipeline;
-						}
-
-						Li = outaccess.C_Lip1;
-
-						if (ti == numTrees - 1) {
-							N = con1.readLong();
-							long data = new BigInteger(1, outaccess.C_Ti.getA()).longValue();
-							if (N == data) {
-								System.out.println("Access passed");
-								System.out.println();
-							} else {
-								throw new AccessException("Access failed");
-							}
-						}
-
-					} else {
-						throw new NoSuchPartyException(party + "");
-					}
-				}
-
-				if (Global.pipeline) {
-					for (int ti = 0; ti < numTrees; ti++) {
-						try {
-							threads[ti].join();
-						} catch (InterruptedException e) {
-							e.printStackTrace();
-						}
-					}
-					ete_on.stop();
-				}
-			}
-		}
-		System.out.println();
-
-		Timer sum = new Timer();
-		for (int i = 0; i < timer.length; i++)
-			sum = sum.add(timer[i]);
-		sum.noPrePrint();
-		System.out.println();
-
-		StopWatch comEnc = new StopWatch("CE_online_comp");
-		for (int i = 0; i < cons1.length; i++)
-			comEnc = comEnc.add(cons1[i].comEnc.add(cons2[i].comEnc));
-		System.out.println(comEnc.noPreToMS());
-		System.out.println();
-
-		if (Global.pipeline)
-			ete_on.elapsedCPU = 0;
-		System.out.println(ete_on.noPreToMS());
-		System.out.println(ete_off.noPreToMS());
-		System.out.println();
-
-		Bandwidth[] bandwidth = new Bandwidth[P.size];
-		for (int i = 0; i < P.size; i++) {
-			bandwidth[i] = new Bandwidth(P.names[i]);
-			for (int j = 0; j < cons1.length; j++)
-				bandwidth[i] = bandwidth[i].add(cons1[j].bandwidth[i].add(cons2[j].bandwidth[i]));
-			System.out.println(bandwidth[i].noPreToString());
-		}
-		System.out.println();
-
-		System.out.println(gates[0]);
-		System.out.println(gates[1]);
-		System.out.println();
-
-		sanityCheck();
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 173
src/protocols/SSCOT.java

@@ -1,173 +0,0 @@
-package protocols;
-
-import communication.Communication;
-import crypto.Crypto;
-import crypto.PRG;
-import exceptions.NoSuchPartyException;
-import exceptions.SSCOTException;
-import oram.Forest;
-import oram.Metadata;
-import protocols.precomputation.PreSSCOT;
-import protocols.struct.OutSSCOT;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class SSCOT extends Protocol {
-
-	private int pid = P.COT;
-
-	public SSCOT(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, byte[][] m, byte[][] a, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		int n = m.length;
-		int l = m[0].length * 8;
-		byte[][] x = predata.sscot_r;
-		byte[][] e = new byte[n][];
-		byte[][] v = new byte[n][];
-		PRG G = new PRG(l);
-
-		for (int i = 0; i < n; i++) {
-			for (int j = 0; j < a[i].length; j++)
-				x[i][j] = (byte) (predata.sscot_r[i][j] ^ a[i][j]);
-
-			e[i] = Util.xor(G.compute(predata.sscot_F_k.compute(x[i])), m[i]);
-			v[i] = predata.sscot_F_kprime.compute(x[i]);
-		}
-
-		timer.start(pid, M.online_write);
-		con2.write(pid, e);
-		con2.write(pid, v);
-		timer.stop(pid, M.online_write);
-
-		timer.stop(pid, M.online_comp);
-	}
-
-	public void runD(PreData predata, byte[][] b, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 2
-		int n = b.length;
-		byte[][] y = predata.sscot_r;
-		byte[][] p = new byte[n][];
-		byte[][] w = new byte[n][];
-
-		for (int i = 0; i < n; i++) {
-			for (int j = 0; j < b[i].length; j++)
-				y[i][j] = (byte) (predata.sscot_r[i][j] ^ b[i][j]);
-
-			p[i] = predata.sscot_F_k.compute(y[i]);
-			w[i] = predata.sscot_F_kprime.compute(y[i]);
-		}
-
-		timer.start(pid, M.online_write);
-		con2.write(pid, p);
-		con2.write(pid, w);
-		timer.stop(pid, M.online_write);
-
-		timer.stop(pid, M.online_comp);
-	}
-
-	public OutSSCOT runC(Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		timer.start(pid, M.online_read);
-		byte[][] e = con1.readDoubleByteArray(pid);
-		byte[][] v = con1.readDoubleByteArray(pid);
-
-		// step 2
-		byte[][] p = con2.readDoubleByteArray(pid);
-		byte[][] w = con2.readDoubleByteArray(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 3
-		int n = e.length;
-		int l = e[0].length * 8;
-		PRG G = new PRG(l);
-		OutSSCOT output = null;
-		int invariant = 0;
-
-		for (int i = 0; i < n; i++) {
-			if (Util.equal(v[i], w[i])) {
-				byte[] m = Util.xor(e[i], G.compute(p[i]));
-				output = new OutSSCOT(i, m);
-				invariant++;
-			}
-		}
-
-		if (invariant != 1)
-			throw new SSCOTException("Invariant error: " + invariant);
-
-		timer.stop(pid, M.online_comp);
-		return output;
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		Timer timer = new Timer();
-
-		for (int j = 0; j < 100; j++) {
-			int n = 100;
-			int A = 32;
-			int FN = 5;
-			byte[][] m = new byte[n][A];
-			byte[][] a = new byte[n][FN];
-			byte[][] b = new byte[n][FN];
-			for (int i = 0; i < n; i++) {
-				Crypto.sr.nextBytes(m[i]);
-				Crypto.sr.nextBytes(a[i]);
-				Crypto.sr.nextBytes(b[i]);
-				while (Util.equal(a[i], b[i]))
-					Crypto.sr.nextBytes(b[i]);
-			}
-			int index = Crypto.sr.nextInt(n);
-			b[index] = a[index].clone();
-
-			PreData predata = new PreData();
-			PreSSCOT presscot = new PreSSCOT(con1, con2);
-			if (party == Party.Eddie) {
-				con1.write(b);
-				con2.write(m);
-				con2.write(index);
-				presscot.runE(predata, n, timer);
-				runE(predata, m, a, timer);
-
-			} else if (party == Party.Debbie) {
-				b = con1.readDoubleByteArray();
-				presscot.runD(predata, timer);
-				runD(predata, b, timer);
-
-			} else if (party == Party.Charlie) {
-				m = con1.readDoubleByteArray();
-				index = con1.readInt();
-				presscot.runC();
-				OutSSCOT output = runC(timer);
-				if (output.t == index && Util.equal(output.m_t, m[index]))
-					System.out.println("SSCOT test passed");
-				else
-					System.err.println("SSCOT test failed");
-
-			} else {
-				throw new NoSuchPartyException(party + "");
-			}
-		}
-
-		// timer.print();
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 164
src/protocols/SSIOT.java

@@ -1,164 +0,0 @@
-package protocols;
-
-import communication.Communication;
-import crypto.Crypto;
-import crypto.PRG;
-import exceptions.NoSuchPartyException;
-import exceptions.SSIOTException;
-import oram.Forest;
-import oram.Metadata;
-import protocols.precomputation.PreSSIOT;
-import protocols.struct.OutSSIOT;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class SSIOT extends Protocol {
-
-	private int pid = P.IOT;
-
-	public SSIOT(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, byte[][] y, byte[] Nip1_pr, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		int n = y.length;
-		int l = y[0].length * 8;
-		byte[][] x = new byte[n][];
-		byte[][] e = new byte[n][];
-		byte[][] v = new byte[n][];
-		PRG G = new PRG(l);
-
-		for (int i = 0; i < n; i++) {
-			byte[] i_bytes = Util.intToBytes(i);
-			x[i] = predata.ssiot_r.clone();
-			for (int j = 0; j < Nip1_pr.length; j++)
-				x[i][x[i].length - 1 - j] ^= Nip1_pr[Nip1_pr.length - 1 - j] ^ i_bytes[i_bytes.length - 1 - j];
-
-			e[i] = Util.xor(G.compute(predata.ssiot_F_k.compute(x[i])), y[i]);
-			v[i] = predata.ssiot_F_kprime.compute(x[i]);
-		}
-
-		timer.start(pid, M.online_write);
-		con2.write(pid, e);
-		con2.write(pid, v);
-		timer.stop(pid, M.online_write);
-
-		timer.stop(pid, M.online_comp);
-	}
-
-	public void runD(PreData predata, byte[] Nip1_pr, Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 2
-		byte[] y = predata.ssiot_r;
-		for (int i = 0; i < Nip1_pr.length; i++)
-			y[y.length - 1 - i] ^= Nip1_pr[Nip1_pr.length - 1 - i];
-		byte[] p = predata.ssiot_F_k.compute(y);
-		byte[] w = predata.ssiot_F_kprime.compute(y);
-
-		timer.start(pid, M.online_write);
-		con2.write(pid, p);
-		con2.write(pid, w);
-		timer.stop(pid, M.online_write);
-
-		timer.stop(pid, M.online_comp);
-	}
-
-	public OutSSIOT runC(Timer timer) {
-		timer.start(pid, M.online_comp);
-
-		// step 1
-		timer.start(pid, M.online_read);
-		byte[][] e = con1.readDoubleByteArray(pid);
-		byte[][] v = con1.readDoubleByteArray(pid);
-
-		// step 2
-		byte[] p = con2.read(pid);
-		byte[] w = con2.read(pid);
-		timer.stop(pid, M.online_read);
-
-		// step 3
-		int n = e.length;
-		int l = e[0].length * 8;
-		PRG G = new PRG(l);
-		OutSSIOT output = null;
-		int invariant = 0;
-
-		for (int i = 0; i < n; i++) {
-			if (Util.equal(v[i], w)) {
-				byte[] y = Util.xor(e[i], G.compute(p));
-				output = new OutSSIOT(i, y);
-				invariant++;
-			}
-		}
-
-		if (invariant != 1)
-			throw new SSIOTException("Invariant error: " + invariant);
-
-		timer.stop(pid, M.online_comp);
-		return output;
-	}
-
-	// for testing correctness
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-		Timer timer = new Timer();
-
-		for (int j = 0; j < 100; j++) {
-			int twoTauPow = 64;
-			int label = 4;
-			byte[][] y = new byte[twoTauPow][label];
-			byte[] sE_Nip1_pr = new byte[1];
-			byte[] sD_Nip1_pr = new byte[1];
-			for (int i = 0; i < twoTauPow; i++)
-				Crypto.sr.nextBytes(y[i]);
-			int index = Crypto.sr.nextInt(twoTauPow);
-			Crypto.sr.nextBytes(sE_Nip1_pr);
-			sD_Nip1_pr[0] = (byte) (Util.intToBytes(index)[3] ^ sE_Nip1_pr[0]);
-
-			PreData predata = new PreData();
-			PreSSIOT pressiot = new PreSSIOT(con1, con2);
-
-			if (party == Party.Eddie) {
-				con1.write(sD_Nip1_pr);
-				con2.write(y);
-				con2.write(index);
-				pressiot.runE(predata, twoTauPow, timer);
-				runE(predata, y, sE_Nip1_pr, timer);
-
-			} else if (party == Party.Debbie) {
-				sD_Nip1_pr = con1.read();
-				pressiot.runD(predata, timer);
-				runD(predata, sD_Nip1_pr, timer);
-
-			} else if (party == Party.Charlie) {
-				y = con1.readDoubleByteArray();
-				index = con1.readInt();
-				pressiot.runC();
-				OutSSIOT output = runC(timer);
-				if (output.t == index && Util.equal(output.m_t, y[index]))
-					System.out.println("SSIOT test passed");
-				else
-					System.err.println("SSIOT test failed");
-
-			} else {
-				throw new NoSuchPartyException(party + "");
-			}
-		}
-
-		// timer.print();
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 92
src/protocols/precomputation/PreAccess.java

@@ -1,92 +0,0 @@
-package protocols.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import oram.Forest;
-import oram.Metadata;
-import oram.Tuple;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PreAccess extends Protocol {
-
-	private int pid = P.ACC;
-
-	public PreAccess(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, int twotaupow, int numTuples, int[] tupleParam, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		// SSCOT
-		PreSSCOT presscot = new PreSSCOT(con1, con2);
-		presscot.runE(predata, numTuples, timer);
-
-		// SSIOT
-		PreSSIOT pressiot = new PreSSIOT(con1, con2);
-		pressiot.runE(predata, twotaupow, timer);
-
-		// Access
-		predata.access_sigma = Util.randomPermutation(numTuples, Crypto.sr);
-		predata.access_p = new Tuple[numTuples];
-		for (int i = 0; i < numTuples; i++)
-			predata.access_p[i] = new Tuple(tupleParam[0], tupleParam[1], tupleParam[2], tupleParam[3], Crypto.sr);
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.access_sigma);
-		con1.write(predata.access_p);
-		timer.stop(pid, M.offline_write);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runD(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		// SSCOT
-		PreSSCOT presscot = new PreSSCOT(con1, con2);
-		presscot.runD(predata, timer);
-
-		// SSIOT
-		PreSSIOT pressiot = new PreSSIOT(con1, con2);
-		pressiot.runD(predata, timer);
-
-		// Access
-		timer.start(pid, M.offline_read);
-		predata.access_sigma = con1.readIntArray();
-		predata.access_p = con1.readTupleArray();
-		timer.stop(pid, M.offline_read);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runC(Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		// SSCOT
-		PreSSCOT presscot = new PreSSCOT(con1, con2);
-		presscot.runC();
-
-		// SSIOT
-		PreSSIOT pressiot = new PreSSIOT(con1, con2);
-		pressiot.runC();
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 231
src/protocols/precomputation/PreEviction.java

@@ -1,231 +0,0 @@
-package protocols.precomputation;
-
-import com.oblivm.backend.flexsc.CompEnv;
-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 gc.GCRoute;
-import gc.GCUtil;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PreEviction extends Protocol {
-
-	private int pid = P.EVI;
-
-	public PreEviction(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, boolean firstTree, int d, int w, Timer timer) {
-		if (firstTree)
-			return;
-
-		timer.start(pid, M.offline_comp);
-
-		// GC
-		int logW = (int) Math.ceil(Math.log(w + 1) / Math.log(2));
-
-		predata.evict_LiKeyPairs = GCUtil.genKeyPairs(d - 1);
-		GCSignal[] LiZeroKeys = GCUtil.getZeroKeys(predata.evict_LiKeyPairs);
-
-		predata.evict_E_feKeyPairs = new GCSignal[d][][];
-		predata.evict_C_feKeyPairs = new GCSignal[d][][];
-		GCSignal[][] E_feZeroKeys = new GCSignal[d][];
-		GCSignal[][] C_feZeroKeys = new GCSignal[d][];
-
-		predata.evict_E_labelKeyPairs = new GCSignal[d][w][][];
-		predata.evict_C_labelKeyPairs = new GCSignal[d][w][][];
-		GCSignal[][][] E_labelZeroKeys = new GCSignal[d][w][];
-		GCSignal[][][] C_labelZeroKeys = new GCSignal[d][w][];
-
-		predata.evict_deltaKeyPairs = new GCSignal[d][][];
-		GCSignal[][] deltaZeroKeys = new GCSignal[d][];
-
-		for (int i = 0; i < d; i++) {
-			predata.evict_E_feKeyPairs[i] = GCUtil.genKeyPairs(w);
-			predata.evict_C_feKeyPairs[i] = GCUtil.genKeyPairs(w);
-			E_feZeroKeys[i] = GCUtil.getZeroKeys(predata.evict_E_feKeyPairs[i]);
-			C_feZeroKeys[i] = GCUtil.getZeroKeys(predata.evict_C_feKeyPairs[i]);
-
-			predata.evict_deltaKeyPairs[i] = GCUtil.genKeyPairs(logW);
-			deltaZeroKeys[i] = GCUtil.getZeroKeys(predata.evict_deltaKeyPairs[i]);
-
-			for (int j = 0; j < w; j++) {
-				predata.evict_E_labelKeyPairs[i][j] = GCUtil.genKeyPairs(d - 1);
-				predata.evict_C_labelKeyPairs[i][j] = GCUtil.genKeyPairs(d - 1);
-				E_labelZeroKeys[i][j] = GCUtil.getZeroKeys(predata.evict_E_labelKeyPairs[i][j]);
-				C_labelZeroKeys[i][j] = GCUtil.getZeroKeys(predata.evict_C_labelKeyPairs[i][j]);
-			}
-		}
-
-		Network channel = new Network(null, con1);
-		CompEnv<GCSignal> gen = new GCGen(channel, timer, pid, M.offline_write);
-		GCSignal[][][] outZeroKeys = new GCRoute<GCSignal>(gen, d, w).routing(LiZeroKeys, E_feZeroKeys, C_feZeroKeys,
-				E_labelZeroKeys, C_labelZeroKeys, deltaZeroKeys);
-		((GCGen) gen).sendLastSetGTT();
-
-		predata.evict_tiOutKeyHashes = new byte[d][][];
-		predata.evict_targetOutKeyPairs = new GCSignal[d][][];
-		for (int i = 0; i < d; i++) {
-			predata.evict_tiOutKeyHashes[i] = GCUtil.genOutKeyHashes(outZeroKeys[1][i]);
-			predata.evict_targetOutKeyPairs[i] = GCUtil.recoverOutKeyPairs(outZeroKeys[0][i]);
-		}
-
-		timer.start(pid, M.offline_write);
-		con2.write(predata.evict_C_feKeyPairs);
-		con2.write(predata.evict_C_labelKeyPairs);
-
-		con1.write(predata.evict_tiOutKeyHashes);
-		con1.write(predata.evict_targetOutKeyPairs);
-		timer.stop(pid, M.offline_write);
-
-		// Permutation
-		predata.evict_pi = Util.randomPermutation(d, Crypto.sr);
-		predata.evict_delta = new byte[d][];
-		predata.evict_rho = new byte[d][];
-		predata.evict_delta_p = new int[d][];
-		predata.evict_rho_p = new int[d][];
-
-		for (int i = 0; i < d; i++) {
-			predata.evict_delta[i] = Util.nextBytes((logW + 7) / 8, Crypto.sr);
-			predata.evict_rho[i] = Util.nextBytes((logW + 7) / 8, Crypto.sr);
-			predata.evict_delta_p[i] = Util.getXorPermutation(predata.evict_delta[i], logW);
-			predata.evict_rho_p[i] = Util.getXorPermutation(predata.evict_rho[i], logW);
-		}
-
-		timer.start(pid, M.offline_write);
-		con2.write(predata.evict_pi);
-		con2.write(predata.evict_delta);
-		con2.write(predata.evict_rho);
-		con2.write(predata.evict_delta_p);
-		con2.write(predata.evict_rho_p);
-		timer.stop(pid, M.offline_write);
-
-		// PermuteTarget
-		PrePermuteTarget prepermutetarget = new PrePermuteTarget(con1, con2);
-		prepermutetarget.runE(predata, d, timer);
-
-		// PermuteIndex
-		PrePermuteIndex prepermuteindex = new PrePermuteIndex(con1, con2);
-		prepermuteindex.runE(predata, d, w, timer);
-
-		// SSXOT
-		PreSSXOT pressxot = new PreSSXOT(con1, con2, 1);
-		pressxot.runE(predata, timer);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public long runD(PreData predata, boolean firstTree, int d, int w, int[] tupleParam, Timer timer) {
-		if (firstTree)
-			return 0;
-
-		timer.start(pid, M.offline_comp);
-
-		// GC
-		int logW = (int) Math.ceil(Math.log(w + 1) / Math.log(2));
-
-		GCSignal[] LiZeroKeys = GCUtil.genEmptyKeys(d - 1);
-		GCSignal[][] E_feZeroKeys = new GCSignal[d][];
-		GCSignal[][] C_feZeroKeys = new GCSignal[d][];
-		GCSignal[][][] E_labelZeroKeys = new GCSignal[d][w][];
-		GCSignal[][][] C_labelZeroKeys = new GCSignal[d][w][];
-		GCSignal[][] deltaZeroKeys = new GCSignal[d][];
-
-		for (int i = 0; i < d; i++) {
-			E_feZeroKeys[i] = GCUtil.genEmptyKeys(w);
-			C_feZeroKeys[i] = GCUtil.genEmptyKeys(w);
-			deltaZeroKeys[i] = GCUtil.genEmptyKeys(logW);
-
-			for (int j = 0; j < w; j++) {
-				E_labelZeroKeys[i][j] = GCUtil.genEmptyKeys(d - 1);
-				C_labelZeroKeys[i][j] = GCUtil.genEmptyKeys(d - 1);
-			}
-		}
-
-		Network channel = new Network(con1, null);
-		CompEnv<GCSignal> eva = new GCEva(channel, timer, pid, M.offline_read);
-		predata.evict_gcroute = new GCRoute<GCSignal>(eva, d, w);
-		predata.evict_gcroute.routing(LiZeroKeys, E_feZeroKeys, C_feZeroKeys, E_labelZeroKeys, C_labelZeroKeys,
-				deltaZeroKeys);
-		((GCEva) eva).receiveLastSetGTT();
-		eva.setEvaluate();
-
-		timer.start(pid, M.offline_read);
-		predata.evict_tiOutKeyHashes = con1.readTripleByteArray();
-		predata.evict_targetOutKeyPairs = con1.readTripleGCSignalArray();
-		timer.stop(pid, M.offline_read);
-
-		// PermuteTarget
-		PrePermuteTarget prepermutetarget = new PrePermuteTarget(con1, con2);
-		prepermutetarget.runD(predata, d, timer);
-
-		// PermuteIndex
-		PrePermuteIndex prepermuteindex = new PrePermuteIndex(con1, con2);
-		prepermuteindex.runD(predata, timer);
-
-		// SSXOT
-		int W = (int) Math.pow(2, logW);
-		PreSSXOT pressxot = new PreSSXOT(con1, con2, 1);
-		pressxot.runD(predata, d * W, d * W, tupleParam, timer);
-
-		timer.stop(pid, M.offline_comp);
-		return eva.numOfAnds;
-	}
-
-	public void runC(PreData predata, boolean firstTree, Timer timer) {
-		if (firstTree)
-			return;
-
-		timer.start(pid, M.offline_comp);
-
-		// GC
-		timer.start(pid, M.offline_read);
-		predata.evict_C_feKeyPairs = con1.readTripleGCSignalArray();
-		predata.evict_C_labelKeyPairs = con1.readQuadGCSignalArray();
-
-		// Permutation
-		predata.evict_pi = con1.readIntArray();
-		predata.evict_delta = con1.readDoubleByteArray();
-		predata.evict_rho = con1.readDoubleByteArray();
-		predata.evict_delta_p = con1.readDoubleIntArray();
-		predata.evict_rho_p = con1.readDoubleIntArray();
-		timer.stop(pid, M.offline_read);
-
-		// PermuteTarget
-		PrePermuteTarget prepermutetarget = new PrePermuteTarget(con1, con2);
-		prepermutetarget.runC(predata, timer);
-
-		// PermuteIndex
-		PrePermuteIndex prepermuteindex = new PrePermuteIndex(con1, con2);
-		prepermuteindex.runC(predata, timer);
-
-		// SSXOT
-		PreSSXOT pressxot = new PreSSXOT(con1, con2, 1);
-		pressxot.runC(predata, timer);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 69
src/protocols/precomputation/PrePermuteIndex.java

@@ -1,69 +0,0 @@
-package protocols.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PrePermuteIndex extends Protocol {
-
-	private int pid = P.PI;
-
-	public PrePermuteIndex(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, int d, int w, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		int logW = (int) Math.ceil(Math.log(w + 1) / Math.log(2));
-
-		predata.pi_p = new byte[d][];
-		predata.pi_r = new byte[d][];
-		predata.pi_a = new byte[d][];
-		for (int i = 0; i < d; i++) {
-			predata.pi_p[i] = Util.nextBytes((logW + 7) / 8, Crypto.sr);
-			predata.pi_r[i] = Util.nextBytes((logW + 7) / 8, Crypto.sr);
-			predata.pi_a[i] = Util.xor(predata.pi_p[i], predata.pi_r[i]);
-		}
-		predata.pi_a = Util.permute(predata.pi_a, predata.evict_pi);
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.pi_p);
-		con1.write(predata.pi_a);
-		con2.write(predata.pi_r);
-		timer.stop(pid, M.offline_write);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runD(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_read);
-		predata.pi_p = con1.readDoubleByteArray();
-		predata.pi_a = con1.readDoubleByteArray();
-		timer.stop(pid, M.offline_read);
-	}
-
-	public void runC(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_read);
-		predata.pi_r = con1.readDoubleByteArray();
-		timer.stop(pid, M.offline_read);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 114
src/protocols/precomputation/PrePermuteTarget.java

@@ -1,114 +0,0 @@
-package protocols.precomputation;
-
-import java.math.BigInteger;
-
-import com.oblivm.backend.gc.GCSignal;
-
-import communication.Communication;
-import crypto.Crypto;
-import gc.GCUtil;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PrePermuteTarget extends Protocol {
-
-	private int pid = P.PT;
-
-	public PrePermuteTarget(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, int d, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		// PermuteTargetI
-		int logD = (int) Math.ceil(Math.log(d) / Math.log(2));
-
-		predata.pt_keyT = new byte[d][d][];
-		predata.pt_targetT = new byte[d][d][];
-		predata.pt_maskT = new byte[d][d][];
-
-		for (int i = 0; i < d; i++) {
-			for (int j = 0; j < d; j++) {
-				GCSignal[] keys = GCUtil.revSelectKeys(predata.evict_targetOutKeyPairs[i],
-						BigInteger.valueOf(j).toByteArray());
-				predata.pt_keyT[i][j] = GCUtil.hashAll(keys);
-
-				predata.pt_maskT[i][j] = Util.nextBytes((logD + 7) / 8, Crypto.sr);
-
-				predata.pt_targetT[i][j] = Util.xor(
-						Util.padArray(BigInteger.valueOf(predata.evict_pi[j]).toByteArray(), (logD + 7) / 8),
-						predata.pt_maskT[i][j]);
-			}
-
-			int[] randPerm = Util.randomPermutation(d, Crypto.sr);
-			predata.pt_keyT[i] = Util.permute(predata.pt_keyT[i], randPerm);
-			predata.pt_maskT[i] = Util.permute(predata.pt_maskT[i], randPerm);
-			predata.pt_targetT[i] = Util.permute(predata.pt_targetT[i], randPerm);
-		}
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.pt_keyT);
-		con1.write(predata.pt_targetT);
-		con2.write(predata.pt_maskT);
-		timer.stop(pid, M.offline_write);
-
-		// PermuteTargetII
-		predata.pt_p = new byte[d][];
-		predata.pt_r = new byte[d][];
-		predata.pt_a = new byte[d][];
-		for (int i = 0; i < d; i++) {
-			predata.pt_p[i] = Util.nextBytes((logD + 7) / 8, Crypto.sr);
-			predata.pt_r[i] = Util.nextBytes((logD + 7) / 8, Crypto.sr);
-			predata.pt_a[i] = Util.xor(predata.pt_p[i], predata.pt_r[i]);
-		}
-		predata.pt_a = Util.permute(predata.pt_a, predata.evict_pi);
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.pt_p);
-		con1.write(predata.pt_a);
-		con2.write(predata.pt_r);
-		timer.stop(pid, M.offline_write);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runD(PreData predata, int d, Timer timer) {
-		timer.start(pid, M.offline_read);
-		// PermuteTargetI
-		predata.pt_keyT = con1.readTripleByteArray();
-		predata.pt_targetT = con1.readTripleByteArray();
-
-		// PermuteTargetII
-		predata.pt_p = con1.readDoubleByteArray();
-		predata.pt_a = con1.readDoubleByteArray();
-		timer.stop(pid, M.offline_read);
-	}
-
-	public void runC(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_read);
-		// PermuteTargetI
-		predata.pt_maskT = con1.readTripleByteArray();
-
-		// PermuteTargetII
-		predata.pt_r = con1.readDoubleByteArray();
-		timer.stop(pid, M.offline_read);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 89
src/protocols/precomputation/PrePostProcessT.java

@@ -1,89 +0,0 @@
-package protocols.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PrePostProcessT extends Protocol {
-
-	private int pid = P.PPT;
-
-	public PrePostProcessT(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_read);
-		predata.ppt_Li = con1.read();
-		predata.ppt_Lip1 = con1.read();
-
-		predata.ppt_s = con1.readDoubleByteArray();
-		timer.stop(pid, M.offline_read);
-	}
-
-	public void runD(PreData predata, PreData prev, int LiBytes, int Lip1Bytes, int tau, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		if (prev != null)
-			predata.ppt_Li = prev.ppt_Lip1;
-		else
-			predata.ppt_Li = Util.nextBytes(LiBytes, Crypto.sr);
-		predata.ppt_Lip1 = Util.nextBytes(Lip1Bytes, Crypto.sr);
-
-		int twoTauPow = (int) Math.pow(2, tau);
-		predata.ppt_alpha = Crypto.sr.nextInt(tau);
-		predata.ppt_r = new byte[twoTauPow][];
-		predata.ppt_s = new byte[twoTauPow][];
-		for (int i = 0; i < twoTauPow; i++) {
-			predata.ppt_r[i] = Util.nextBytes(Lip1Bytes, Crypto.sr);
-			predata.ppt_s[i] = predata.ppt_r[i];
-		}
-		predata.ppt_s[predata.ppt_alpha] = Util.xor(predata.ppt_r[predata.ppt_alpha], predata.ppt_Lip1);
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.ppt_Li);
-		con1.write(predata.ppt_Lip1);
-
-		con2.write(predata.ppt_alpha);
-		con2.write(predata.ppt_r);
-		con1.write(predata.ppt_s);
-		timer.stop(pid, M.offline_write);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runC(PreData predata, PreData prev, int LiBytes, int Lip1Bytes, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		if (prev != null)
-			predata.ppt_Li = prev.ppt_Lip1;
-		else
-			predata.ppt_Li = Util.nextBytes(LiBytes, Crypto.sr);
-		predata.ppt_Lip1 = Util.nextBytes(Lip1Bytes, Crypto.sr);
-
-		timer.start(pid, M.offline_read);
-		predata.ppt_alpha = con2.readInt();
-		predata.ppt_r = con2.readDoubleByteArray();
-		timer.stop(pid, M.offline_read);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 76
src/protocols/precomputation/PreReshuffle.java

@@ -1,76 +0,0 @@
-package protocols.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import oram.Forest;
-import oram.Metadata;
-import oram.Tuple;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PreReshuffle extends Protocol {
-
-	private int pid = P.RSF;
-
-	public PreReshuffle(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		predata.reshuffle_pi = Util.inversePermutation(predata.access_sigma);
-
-		timer.start(pid, M.offline_read);
-		predata.reshuffle_r = con1.readTupleArray();
-		timer.stop(pid, M.offline_read);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runD(PreData predata, int[] tupleParam, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		predata.reshuffle_pi = Util.inversePermutation(predata.access_sigma);
-		int numTuples = predata.reshuffle_pi.length;
-		predata.reshuffle_p = new Tuple[numTuples];
-		predata.reshuffle_r = new Tuple[numTuples];
-		Tuple[] a = new Tuple[numTuples];
-		for (int i = 0; i < numTuples; i++) {
-			predata.reshuffle_p[i] = new Tuple(tupleParam[0], tupleParam[1], tupleParam[2], tupleParam[3], Crypto.sr);
-			predata.reshuffle_r[i] = new Tuple(tupleParam[0], tupleParam[1], tupleParam[2], tupleParam[3], Crypto.sr);
-			a[i] = predata.reshuffle_p[i].xor(predata.reshuffle_r[i]);
-		}
-		predata.reshuffle_a_prime = Util.permute(a, predata.reshuffle_pi);
-
-		timer.start(pid, M.offline_write);
-		con2.write(predata.reshuffle_p);
-		con2.write(predata.reshuffle_a_prime);
-		con1.write(predata.reshuffle_r);
-		timer.stop(pid, M.offline_write);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runC(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_read);
-		predata.reshuffle_p = con2.readTupleArray();
-		predata.reshuffle_a_prime = con2.readTupleArray();
-		timer.stop(pid, M.offline_read);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 96
src/protocols/precomputation/PreRetrieve.java

@@ -1,96 +0,0 @@
-package protocols.precomputation;
-
-import communication.Communication;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.Timer;
-
-public class PreRetrieve extends Protocol {
-	public PreRetrieve(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	// TODO: not all protocols run on all trees (remove unnecessary precomp)
-
-	public void runE(PreData[] predata, Metadata md, int ti, Timer timer) {
-		// 1st eviction
-		PreAccess preaccess = new PreAccess(con1, con2);
-		PreReshuffle prereshuffle = new PreReshuffle(con1, con2);
-		PrePostProcessT prepostprocesst = new PrePostProcessT(con1, con2);
-		PreUpdateRoot preupdateroot = new PreUpdateRoot(con1, con2);
-		PreEviction preeviction = new PreEviction(con1, con2);
-
-		int numTuples = md.getStashSizeOfTree(ti) + md.getLBitsOfTree(ti) * md.getW();
-		int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-				md.getABytesOfTree(ti) };
-
-		preaccess.runE(predata[0], md.getTwoTauPow(), numTuples, tupleParam, timer);
-		prereshuffle.runE(predata[0], timer);
-		prepostprocesst.runE(predata[0], timer);
-		preupdateroot.runE(predata[0], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), timer);
-		preeviction.runE(predata[0], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), timer);
-
-		// 2nd eviction
-		preupdateroot.runE(predata[1], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), timer);
-		preeviction.runE(predata[1], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), timer);
-	}
-
-	public long[] runD(PreData[] predata, Metadata md, int ti, PreData prev, Timer timer) {
-		// 1st eviction
-		PreAccess preaccess = new PreAccess(con1, con2);
-		PreReshuffle prereshuffle = new PreReshuffle(con1, con2);
-		PrePostProcessT prepostprocesst = new PrePostProcessT(con1, con2);
-		PreUpdateRoot preupdateroot = new PreUpdateRoot(con1, con2);
-		PreEviction preeviction = new PreEviction(con1, con2);
-
-		int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
-				md.getABytesOfTree(ti) };
-		long[] cnt = new long[2];
-
-		preaccess.runD(predata[0], timer);
-		prereshuffle.runD(predata[0], tupleParam, timer);
-		prepostprocesst.runD(predata[0], prev, md.getLBytesOfTree(ti), md.getAlBytesOfTree(ti), md.getTau(), timer);
-		cnt[0] += preupdateroot.runD(predata[0], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), tupleParam,
-				timer);
-		cnt[1] += preeviction.runD(predata[0], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), tupleParam, timer);
-
-		// 2nd eviction
-		cnt[0] += preupdateroot.runD(predata[1], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), tupleParam,
-				timer);
-		cnt[1] += preeviction.runD(predata[1], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), tupleParam, timer);
-
-		return cnt;
-	}
-
-	public void runC(PreData[] predata, Metadata md, int ti, PreData prev, Timer timer) {
-		// 1st eviction
-		PreAccess preaccess = new PreAccess(con1, con2);
-		PreReshuffle prereshuffle = new PreReshuffle(con1, con2);
-		PrePostProcessT prepostprocesst = new PrePostProcessT(con1, con2);
-		PreUpdateRoot preupdateroot = new PreUpdateRoot(con1, con2);
-		PreEviction preeviction = new PreEviction(con1, con2);
-
-		preaccess.runC(timer);
-		prereshuffle.runC(predata[0], timer);
-		prepostprocesst.runC(predata[0], prev, md.getLBytesOfTree(ti), md.getAlBytesOfTree(ti), timer);
-		preupdateroot.runC(predata[0], ti == 0, timer);
-		preeviction.runC(predata[0], ti == 0, timer);
-
-		// 2nd eviction
-		preupdateroot.runC(predata[1], ti == 0, timer);
-		preeviction.runC(predata[1], ti == 0, timer);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 77
src/protocols/precomputation/PreSSCOT.java

@@ -1,77 +0,0 @@
-package protocols.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import crypto.PRF;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-
-public class PreSSCOT extends Protocol {
-
-	private int pid = P.COT;
-
-	public PreSSCOT(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, int n, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		predata.sscot_k = PRF.generateKey(Crypto.sr);
-		predata.sscot_kprime = PRF.generateKey(Crypto.sr);
-		predata.sscot_r = new byte[n][];
-		for (int i = 0; i < n; i++) {
-			predata.sscot_r[i] = new byte[Crypto.secParamBytes];
-			Crypto.sr.nextBytes(predata.sscot_r[i]);
-		}
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.sscot_k);
-		con1.write(predata.sscot_kprime);
-		con1.write(predata.sscot_r);
-		timer.stop(pid, M.offline_write);
-
-		predata.sscot_F_k = new PRF(Crypto.secParam);
-		predata.sscot_F_k.init(predata.sscot_k);
-		predata.sscot_F_kprime = new PRF(Crypto.secParam);
-		predata.sscot_F_kprime.init(predata.sscot_kprime);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runD(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		timer.start(pid, M.offline_read);
-		predata.sscot_k = con1.read();
-		predata.sscot_kprime = con1.read();
-		predata.sscot_r = con1.readDoubleByteArray();
-		timer.stop(pid, M.offline_read);
-
-		predata.sscot_F_k = new PRF(Crypto.secParam);
-		predata.sscot_F_k.init(predata.sscot_k);
-		predata.sscot_F_kprime = new PRF(Crypto.secParam);
-		predata.sscot_F_kprime.init(predata.sscot_kprime);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runC() {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 74
src/protocols/precomputation/PreSSIOT.java

@@ -1,74 +0,0 @@
-package protocols.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import crypto.PRF;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PreSSIOT extends Protocol {
-
-	private int pid = P.IOT;
-
-	public PreSSIOT(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, int n, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		predata.ssiot_k = PRF.generateKey(Crypto.sr);
-		predata.ssiot_kprime = PRF.generateKey(Crypto.sr);
-		predata.ssiot_r = Util.nextBytes(Crypto.secParamBytes, Crypto.sr);
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.ssiot_k);
-		con1.write(predata.ssiot_kprime);
-		con1.write(predata.ssiot_r);
-		timer.stop(pid, M.offline_write);
-
-		predata.ssiot_F_k = new PRF(Crypto.secParam);
-		predata.ssiot_F_k.init(predata.ssiot_k);
-		predata.ssiot_F_kprime = new PRF(Crypto.secParam);
-		predata.ssiot_F_kprime.init(predata.ssiot_kprime);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runD(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		timer.start(pid, M.offline_read);
-		predata.ssiot_k = con1.read();
-		predata.ssiot_kprime = con1.read();
-		predata.ssiot_r = con1.read();
-		timer.stop(pid, M.offline_read);
-
-		predata.ssiot_F_k = new PRF(Crypto.secParam);
-		predata.ssiot_F_k.init(predata.ssiot_k);
-		predata.ssiot_F_kprime = new PRF(Crypto.secParam);
-		predata.ssiot_F_kprime.init(predata.ssiot_kprime);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runC() {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 80
src/protocols/precomputation/PreSSXOT.java

@@ -1,80 +0,0 @@
-package protocols.precomputation;
-
-import communication.Communication;
-import crypto.Crypto;
-import oram.Forest;
-import oram.Metadata;
-import oram.Tuple;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-import util.Util;
-
-public class PreSSXOT extends Protocol {
-
-	private int id;
-	private int pid;
-
-	public PreSSXOT(Communication con1, Communication con2, int id) {
-		super(con1, con2);
-		this.id = id;
-		pid = id == 0 ? P.URXOT : P.XOT;
-	}
-
-	public void runE(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_read);
-		predata.ssxot_E_pi[id] = con1.readIntArray();
-		predata.ssxot_E_r[id] = con1.readTupleArray();
-		timer.stop(pid, M.offline_read);
-	}
-
-	public void runD(PreData predata, int n, int k, int[] tupleParam, Timer timer) {
-		timer.start(pid, M.offline_comp);
-
-		predata.ssxot_delta[id] = new Tuple[k];
-		for (int i = 0; i < k; i++)
-			predata.ssxot_delta[id][i] = new Tuple(tupleParam[0], tupleParam[1], tupleParam[2], tupleParam[3],
-					Crypto.sr);
-
-		predata.ssxot_E_pi[id] = Util.randomPermutation(n, Crypto.sr);
-		predata.ssxot_C_pi[id] = Util.randomPermutation(n, Crypto.sr);
-		predata.ssxot_E_pi_ivs[id] = Util.inversePermutation(predata.ssxot_E_pi[id]);
-		predata.ssxot_C_pi_ivs[id] = Util.inversePermutation(predata.ssxot_C_pi[id]);
-
-		predata.ssxot_E_r[id] = new Tuple[n];
-		predata.ssxot_C_r[id] = new Tuple[n];
-		for (int i = 0; i < n; i++) {
-			predata.ssxot_E_r[id][i] = new Tuple(tupleParam[0], tupleParam[1], tupleParam[2], tupleParam[3], Crypto.sr);
-			predata.ssxot_C_r[id][i] = new Tuple(tupleParam[0], tupleParam[1], tupleParam[2], tupleParam[3], Crypto.sr);
-		}
-
-		timer.start(pid, M.offline_write);
-		con1.write(predata.ssxot_E_pi[id]);
-		con1.write(predata.ssxot_E_r[id]);
-		con2.write(predata.ssxot_C_pi[id]);
-		con2.write(predata.ssxot_C_r[id]);
-		timer.stop(pid, M.offline_write);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public void runC(PreData predata, Timer timer) {
-		timer.start(pid, M.offline_read);
-		predata.ssxot_C_pi[id] = con2.readIntArray();
-		predata.ssxot_C_r[id] = con2.readTupleArray();
-		timer.stop(pid, M.offline_read);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 0 - 140
src/protocols/precomputation/PreUpdateRoot.java

@@ -1,140 +0,0 @@
-package protocols.precomputation;
-
-import com.oblivm.backend.flexsc.CompEnv;
-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 gc.GCUpdateRoot;
-import gc.GCUtil;
-import oram.Forest;
-import oram.Metadata;
-import protocols.Protocol;
-import protocols.struct.Party;
-import protocols.struct.PreData;
-import util.M;
-import util.P;
-import util.Timer;
-
-public class PreUpdateRoot extends Protocol {
-
-	private int pid = P.UR;
-
-	public PreUpdateRoot(Communication con1, Communication con2) {
-		super(con1, con2);
-	}
-
-	public void runE(PreData predata, boolean firstTree, int sw, int lBits, Timer timer) {
-		if (firstTree)
-			return;
-
-		timer.start(pid, M.offline_comp);
-
-		int sLogW = (int) Math.ceil(Math.log(sw) / Math.log(2));
-		predata.ur_j1KeyPairs = GCUtil.genKeyPairs(sLogW);
-		predata.ur_LiKeyPairs = GCUtil.genKeyPairs(lBits);
-		predata.ur_E_feKeyPairs = GCUtil.genKeyPairs(sw);
-		predata.ur_C_feKeyPairs = GCUtil.genKeyPairs(sw);
-		GCSignal[] j1ZeroKeys = GCUtil.getZeroKeys(predata.ur_j1KeyPairs);
-		GCSignal[] LiZeroKeys = GCUtil.getZeroKeys(predata.ur_LiKeyPairs);
-		GCSignal[] E_feZeroKeys = GCUtil.getZeroKeys(predata.ur_E_feKeyPairs);
-		GCSignal[] C_feZeroKeys = GCUtil.getZeroKeys(predata.ur_C_feKeyPairs);
-		predata.ur_E_labelKeyPairs = new GCSignal[sw][][];
-		predata.ur_C_labelKeyPairs = new GCSignal[sw][][];
-		GCSignal[][] E_labelZeroKeys = new GCSignal[sw][];
-		GCSignal[][] C_labelZeroKeys = new GCSignal[sw][];
-		for (int i = 0; i < sw; i++) {
-			predata.ur_E_labelKeyPairs[i] = GCUtil.genKeyPairs(lBits);
-			predata.ur_C_labelKeyPairs[i] = GCUtil.genKeyPairs(lBits);
-			E_labelZeroKeys[i] = GCUtil.getZeroKeys(predata.ur_E_labelKeyPairs[i]);
-			C_labelZeroKeys[i] = GCUtil.getZeroKeys(predata.ur_C_labelKeyPairs[i]);
-		}
-
-		Network channel = new Network(null, con1);
-		CompEnv<GCSignal> gen = new GCGen(channel, timer, pid, M.offline_write);
-		GCSignal[][] outZeroKeys = new GCUpdateRoot<GCSignal>(gen, lBits + 1, sw).rootFindDeepestAndEmpty(j1ZeroKeys,
-				LiZeroKeys, E_feZeroKeys, C_feZeroKeys, E_labelZeroKeys, C_labelZeroKeys);
-		((GCGen) gen).sendLastSetGTT();
-
-		predata.ur_outKeyHashes = new byte[outZeroKeys.length][][];
-		for (int i = 0; i < outZeroKeys.length; i++)
-			predata.ur_outKeyHashes[i] = GCUtil.genOutKeyHashes(outZeroKeys[i]);
-
-		timer.start(pid, M.offline_write);
-		con2.write(predata.ur_C_feKeyPairs);
-		con2.write(predata.ur_C_labelKeyPairs);
-		con1.write(predata.ur_outKeyHashes);
-		timer.stop(pid, M.offline_write);
-
-		PreSSXOT pressxot = new PreSSXOT(con1, con2, 0);
-		pressxot.runE(predata, timer);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	public long runD(PreData predata, boolean firstTree, int sw, int lBits, int[] tupleParam, Timer timer) {
-		if (firstTree)
-			return 0;
-
-		timer.start(pid, M.offline_comp);
-
-		int logSW = (int) Math.ceil(Math.log(sw) / Math.log(2));
-		GCSignal[] j1ZeroKeys = GCUtil.genEmptyKeys(logSW);
-		GCSignal[] LiZeroKeys = GCUtil.genEmptyKeys(lBits);
-		GCSignal[] E_feZeroKeys = GCUtil.genEmptyKeys(sw);
-		GCSignal[] C_feZeroKeys = GCUtil.genEmptyKeys(sw);
-		GCSignal[][] E_labelZeroKeys = new GCSignal[sw][];
-		GCSignal[][] C_labelZeroKeys = new GCSignal[sw][];
-		for (int i = 0; i < sw; i++) {
-			E_labelZeroKeys[i] = GCUtil.genEmptyKeys(lBits);
-			C_labelZeroKeys[i] = GCUtil.genEmptyKeys(lBits);
-		}
-
-		Network channel = new Network(con1, null);
-		CompEnv<GCSignal> eva = new GCEva(channel, timer, pid, M.offline_read);
-		predata.ur_gcur = new GCUpdateRoot<GCSignal>(eva, lBits + 1, sw);
-		predata.ur_gcur.rootFindDeepestAndEmpty(j1ZeroKeys, LiZeroKeys, E_feZeroKeys, C_feZeroKeys, E_labelZeroKeys,
-				C_labelZeroKeys);
-		((GCEva) eva).receiveLastSetGTT();
-		eva.setEvaluate();
-
-		timer.start(pid, M.offline_read);
-		predata.ur_outKeyHashes = con1.readTripleByteArray();
-		timer.stop(pid, M.offline_read);
-
-		PreSSXOT pressxot = new PreSSXOT(con1, con2, 0);
-		pressxot.runD(predata, sw + 1, sw, tupleParam, timer);
-
-		timer.stop(pid, M.offline_comp);
-		return eva.numOfAnds;
-	}
-
-	public void runC(PreData predata, boolean firstTree, Timer timer) {
-		if (firstTree)
-			return;
-
-		timer.start(pid, M.offline_comp);
-
-		timer.start(pid, M.offline_read);
-		predata.ur_C_feKeyPairs = con1.readDoubleGCSignalArray();
-		predata.ur_C_labelKeyPairs = con1.readTripleGCSignalArray();
-		timer.stop(pid, M.offline_read);
-
-		PreSSXOT pressxot = new PreSSXOT(con1, con2, 0);
-		pressxot.runC(predata, timer);
-
-		timer.stop(pid, M.offline_comp);
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest forest) {
-	}
-
-	@Override
-	public void run(Party party, Metadata md, Forest[] forest) {
-		// TODO Auto-generated method stub
-
-	}
-}

+ 1 - 27
src/ui/CLI.java

@@ -70,17 +70,7 @@ public class CLI {
 		Class<? extends Protocol> operation = null;
 		String protocol = cmd.getOptionValue("protocol", "retrieve").toLowerCase();
 
-		if (protocol.equals("acc")) {
-			operation = Access.class;
-		} else if (protocol.equals("cot")) {
-			operation = SSCOT.class;
-		} else if (protocol.equals("iot")) {
-			operation = SSIOT.class;
-		} else if (protocol.equals("rsf")) {
-			operation = Reshuffle.class;
-		} else if (protocol.equals("ppt")) {
-			operation = PostProcessT.class;
-		} else if (protocol.equals("ur")) {
+		if (protocol.equals("ur")) {
 			operation = UpdateRoot.class;
 		} else if (protocol.equals("evi")) {
 			operation = Eviction.class;
@@ -90,19 +80,12 @@ public class CLI {
 			operation = PermuteIndex.class;
 		} else if (protocol.equals("xot")) {
 			operation = SSXOT.class;
-		} else if (protocol.equals("rtv")) {
-			operation = Retrieve.class;
-
 		} else if (protocol.equals("pircot")) {
 			operation = PIRCOT.class;
-		} else if (protocol.equals("piriot")) {
-			operation = PIRIOT.class;
 		} else if (protocol.equals("piracc")) {
 			operation = PIRAccess.class;
 		} else if (protocol.equals("pirrtv")) {
 			operation = PIRRetrieve.class;
-		} else if (protocol.equals("pirrsf")) {
-			operation = PIRReshuffle.class;
 		} else if (protocol.equals("sspir")) {
 			operation = SSPIR.class;
 		} else if (protocol.equals("shiftpir")) {
@@ -171,9 +154,6 @@ public class CLI {
 
 			try {
 				Protocol p = operationCtor.newInstance(con1[0], con2[0]);
-				if (protocol.equals("rtv")) {
-					((Retrieve) p).setCons(con1, con2);
-				}
 				if (protocol.equals("pirrtv")) {
 					((PIRRetrieve) p).setCons(con1, con2);
 				}
@@ -216,9 +196,6 @@ public class CLI {
 
 			try {
 				Protocol p = operationCtor.newInstance(con1[0], con2[0]);
-				if (protocol.equals("rtv")) {
-					((Retrieve) p).setCons(con1, con2);
-				}
 				if (protocol.equals("pirrtv")) {
 					((PIRRetrieve) p).setCons(con1, con2);
 				}
@@ -262,9 +239,6 @@ public class CLI {
 
 			try {
 				Protocol p = operationCtor.newInstance(con1[0], con2[0]);
-				if (protocol.equals("rtv")) {
-					((Retrieve) p).setCons(con1, con2);
-				}
 				if (protocol.equals("pirrtv")) {
 					((PIRRetrieve) p).setCons(con1, con2);
 				}

+ 0 - 50
test/pir/TestPIRIOT_C.java

@@ -1,50 +0,0 @@
-package pir;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPIRIOT_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 piriot 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/pir/TestPIRIOT_D.java

@@ -1,50 +0,0 @@
-package pir;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPIRIOT_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 piriot 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/pir/TestPIRIOT_E.java

@@ -1,50 +0,0 @@
-package pir;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPIRIOT_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 piriot 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/pir/TestPIRReshuffle_C.java

@@ -1,50 +0,0 @@
-package pir;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPIRReshuffle_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 pirrsf 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/pir/TestPIRReshuffle_D.java

@@ -1,50 +0,0 @@
-package pir;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPIRReshuffle_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 pirrsf 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/pir/TestPIRReshuffle_E.java

@@ -1,50 +0,0 @@
-package pir;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-
-public class TestPIRReshuffle_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 pirrsf 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/TestAccess_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 TestAccess_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 acc 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/TestAccess_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 TestAccess_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 acc 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/TestAccess_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 TestAccess_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 acc 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/TestPostProcessT_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 TestPostProcessT_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 ppt 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/TestPostProcessT_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 TestPostProcessT_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 ppt 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/TestPostProcessT_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 TestPostProcessT_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 ppt 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/TestReshuffle_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 TestReshuffle_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 rsf 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/TestReshuffle_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 TestReshuffle_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 rsf 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/TestReshuffle_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 TestReshuffle_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 rsf 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/TestRetrieve_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 TestRetrieve_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 rtv 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/TestRetrieve_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 TestRetrieve_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 rtv 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/TestRetrieve_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 TestRetrieve_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 rtv 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/TestSSCOT_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 TestSSCOT_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 cot 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/TestSSCOT_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 TestSSCOT_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 cot 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/TestSSCOT_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 TestSSCOT_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 cot 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/TestSSIOT_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 TestSSIOT_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 iot 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/TestSSIOT_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 TestSSIOT_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 iot 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/TestSSIOT_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 TestSSIOT_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 iot 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();
-		}
-	}
-
-}