Browse Source

Add an iters: field to the config.yaml file

It controls the number of iterations of the PIRRetrieve test
Ian Goldberg 1 year ago
parent
commit
08d6ec9855
3 changed files with 13 additions and 3 deletions
  1. 3 2
      config/config.yaml
  2. 9 0
      src/oram/Metadata.java
  3. 1 1
      src/protocols/PIRRetrieve.java

+ 3 - 2
config/config.yaml

@@ -1,7 +1,8 @@
 tau: 3					# tau
-addrBits: 12			# bit length of record address
+addrBits: 26			# bit length of record address
+iters: 5
 w: 3					# number of tuples in each bucket
 dBytes: 4 				# record D bytes in the last tree
 
 insert: 100				# number of records to be initially inserted (-1 means insert max number)
-stash: 32				# stash size
+stash: 32				# stash size

+ 9 - 0
src/oram/Metadata.java

@@ -22,10 +22,12 @@ public class Metadata {
 	private String DBYTES = "dBytes";
 	private String INSERT = "insert";
 	private String STASH = "stash";
+	private String ITERS = "iters";
 
 	private int tau;
 	private int twoTauPow;
 	private int addrBits;
+	private int iters;
 	private int w;
 	private int dBytes;
 	private int stashSize;
@@ -70,6 +72,7 @@ public class Metadata {
 
 		tau = Integer.parseInt(configMap.get(TAU).toString());
 		addrBits = Integer.parseInt(configMap.get(ADDRBITS).toString());
+		iters = Integer.parseInt(configMap.get(ITERS).toString());
 		w = Integer.parseInt(configMap.get(W).toString());
 		dBytes = Integer.parseInt(configMap.get(DBYTES).toString());
 		numInsertRecords = Long.parseLong(configMap.get(INSERT).toString(), 10);
@@ -141,6 +144,7 @@ public class Metadata {
 		System.out.println();
 		System.out.println("tau:				" + tau);
 		System.out.println("address bits:		" + addrBits);
+		System.out.println("iters:		" + iters);
 		System.out.println("w:					" + w);
 		System.out.println("D bytes:			" + dBytes);
 		System.out.println();
@@ -181,6 +185,7 @@ public class Metadata {
 		Map<String, String> configMap = new HashMap<String, String>();
 		configMap.put(TAU, "" + tau);
 		configMap.put(ADDRBITS, "" + addrBits);
+		configMap.put(ITERS, "" + iters);
 		configMap.put(W, "" + w);
 		configMap.put(DBYTES, "" + dBytes);
 		configMap.put(INSERT, "" + numInsertRecords);
@@ -228,6 +233,10 @@ public class Metadata {
 		return addrBits;
 	}
 
+	public int getIters() {
+		return iters;
+	}
+
 	public int getW() {
 		return w;
 	}

+ 1 - 1
src/protocols/PIRRetrieve.java

@@ -283,7 +283,7 @@ public class PIRRetrieve extends Protocol {
 		Tree tree_DE = null;
 		Tree tree_CE = null;
 
-		int iterations = 10;
+		int iterations = md.getIters()+2;
 		int reset = 2;
 
 		for (int test = 0; test < iterations; test++) {