|
@@ -24,12 +24,11 @@ public class Access extends Protocol {
|
|
|
public void runE(PreData predata, Tree OTi, byte[] Li, byte[] Nip1, byte[] Ni, byte[] Nip1_pr) {
|
|
|
|
|
|
Bucket[] pathBuckets = OTi.getBucketsOnPath(new BigInteger(1, Li).longValue());
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- for (int i = 0; i < pathBuckets.length; i++)
|
|
|
- pathBuckets[i].setXor(predata.access_p[i]);
|
|
|
Tuple[] pathTuples = Bucket.bucketsToTuples(pathBuckets);
|
|
|
+ for (int i = 0; i < pathTuples.length; i++)
|
|
|
+ pathTuples[i].setXor(predata.access_p[i]);
|
|
|
+ Object[] objArray = Util.permute(pathTuples, predata.access_sigma);
|
|
|
+ pathTuples = Arrays.copyOf(objArray, objArray.length, Tuple[].class);
|
|
|
|
|
|
|
|
|
byte[][] a = new byte[pathTuples.length][];
|
|
@@ -46,22 +45,23 @@ public class Access extends Protocol {
|
|
|
sscot.runE(predata, m, a);
|
|
|
|
|
|
|
|
|
- System.out.println(OTi.getTau() + " " + OTi.getTwoTauPow());
|
|
|
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);
|
|
|
}
|
|
|
|
|
|
public void runD(PreData predata, Tree OTi, byte[] Li, byte[] Nip1, byte[] Ni, byte[] Nip1_pr) {
|
|
|
|
|
|
Bucket[] pathBuckets = OTi.getBucketsOnPath(new BigInteger(1, Li).longValue());
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- for (int i = 0; i < pathBuckets.length; i++)
|
|
|
- pathBuckets[i].setXor(predata.access_p[i]);
|
|
|
Tuple[] pathTuples = Bucket.bucketsToTuples(pathBuckets);
|
|
|
+ for (int i = 0; i < pathTuples.length; i++)
|
|
|
+ pathTuples[i].setXor(predata.access_p[i]);
|
|
|
+ Object[] objArray = Util.permute(pathTuples, predata.access_sigma);
|
|
|
+ pathTuples = Arrays.copyOf(objArray, objArray.length, Tuple[].class);
|
|
|
|
|
|
|
|
|
con2.write(pathTuples);
|
|
@@ -78,6 +78,10 @@ public class Access extends Protocol {
|
|
|
|
|
|
SSCOT sscot = new SSCOT(con1, con2);
|
|
|
sscot.runD(predata, b);
|
|
|
+
|
|
|
+
|
|
|
+ SSIOT ssiot = new SSIOT(con1, con2);
|
|
|
+ ssiot.runD(predata, Nip1_pr);
|
|
|
}
|
|
|
|
|
|
public void runC() {
|
|
@@ -92,6 +96,9 @@ public class Access extends Protocol {
|
|
|
byte[] d = pathTuples[je.t].getA();
|
|
|
byte[] z = Util.xor(je.m_t, d);
|
|
|
|
|
|
+
|
|
|
+ SSIOT ssiot = new SSIOT(con1, con2);
|
|
|
+ OutSSIOT jy = ssiot.runC();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -100,17 +107,17 @@ public class Access extends Protocol {
|
|
|
PreAccess preaccess = new PreAccess(con1, con2);
|
|
|
int treeIndex = 1;
|
|
|
Tree tree = null;
|
|
|
- int numBuckets = 0;
|
|
|
+ int numTuples = 0;
|
|
|
if (forest != null) {
|
|
|
tree = forest.getTree(treeIndex);
|
|
|
- numBuckets = tree.getD();
|
|
|
+ numTuples = (tree.getD() - 1) * tree.getW() + tree.getStashSize();
|
|
|
}
|
|
|
byte[] Li = new BigInteger("11", 2).toByteArray();
|
|
|
byte[] Nip1 = new byte[] { 0 };
|
|
|
byte[] Ni = new byte[] { 0 };
|
|
|
byte[] Nip1_pr = new byte[] { 0 };
|
|
|
if (party == Party.Eddie) {
|
|
|
- preaccess.runE(predata, tree, numBuckets);
|
|
|
+ preaccess.runE(predata, tree, numTuples);
|
|
|
runE(predata, tree, Li, Nip1, Ni, Nip1_pr);
|
|
|
|
|
|
} else if (party == Party.Debbie) {
|