Selaa lähdekoodia

fix second second access bandwidth for D

Boyoung- 8 vuotta sitten
vanhempi
commit
264d0abae0
2 muutettua tiedostoa jossa 14 lisäystä ja 10 poistoa
  1. 13 9
      src/pir/PIRAccess.java
  2. 1 1
      src/pir/PIRRetrieve.java

+ 13 - 9
src/pir/PIRAccess.java

@@ -353,19 +353,19 @@ public class PIRAccess extends Protocol {
 		timer.stop(pid, M.online_read);
 
 		// step 1
-		Bucket[] pathBuckets = OTi.getBucketsOnPath(Li);
-		Tuple[] pathTuples = Bucket.bucketsToTuples(pathBuckets);
+		// 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.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) {
+	public OutAccess runC2(Metadata md, Tree OTi, int treeIndex, byte[] Li, Timer timer) {
 		timer.start(pid, M.online_comp);
 
 		// step 0: send Li to E and D
@@ -376,10 +376,14 @@ public class PIRAccess extends Protocol {
 		}
 		timer.stop(pid, M.online_write);
 
+		// step 1
+		Bucket[] pathBuckets = OTi.getBucketsOnPath(Li);
+		Tuple[] pathTuples = Bucket.bucketsToTuples(pathBuckets);
+
 		// step 2
-		timer.start(pid, M.online_read);
-		Tuple[] pathTuples = con2.readTupleArray(pid);
-		timer.stop(pid, M.online_read);
+		// timer.start(pid, M.online_read);
+		// Tuple[] pathTuples = con2.readTupleArray(pid);
+		// timer.stop(pid, M.online_read);
 
 		// step 5
 		Tuple Ti = null;

+ 1 - 1
src/pir/PIRRetrieve.java

@@ -123,7 +123,7 @@ public class PIRRetrieve extends Protocol {
 
 		// 2nd eviction
 		byte[] Li2 = Util.nextBytes(md.getLBytesOfTree(ti), Crypto.sr);
-		OutAccess outaccess2 = access.runC2(md, ti, Li2, timer);
+		OutAccess outaccess2 = access.runC2(md, OTi, ti, Li2, timer);
 		Tuple[] path2 = outaccess2.C_P;
 		Tuple Ti2 = outaccess2.C_Ti;
 		Tuple[] root2 = Arrays.copyOfRange(path2, 0, md.getStashSizeOfTree(ti));