|
@@ -21,12 +21,15 @@ 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, int sw, int lBits, Timer timer) {
|
|
|
- timer.start(P.UR, M.offline_comp);
|
|
|
+ timer.start(pid, M.offline_comp);
|
|
|
|
|
|
int sLogW = (int) Math.ceil(Math.log(sw) / Math.log(2));
|
|
|
predata.ur_j1KeyPairs = GCUtil.genKeyPairs(sLogW);
|
|
@@ -49,7 +52,7 @@ public class PreUpdateRoot extends Protocol {
|
|
|
}
|
|
|
|
|
|
Network channel = new Network(null, con1);
|
|
|
- CompEnv<GCSignal> gen = new GCGen(channel, timer, P.UR, M.offline_write);
|
|
|
+ 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);
|
|
|
|
|
@@ -57,20 +60,20 @@ public class PreUpdateRoot extends Protocol {
|
|
|
for (int i = 0; i < outZeroKeys.length; i++)
|
|
|
predata.ur_outKeyHashes[i] = GCUtil.genOutKeyHashes(outZeroKeys[i]);
|
|
|
|
|
|
- timer.start(P.UR, M.offline_write);
|
|
|
+ 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(P.UR, M.offline_write);
|
|
|
+ timer.stop(pid, M.offline_write);
|
|
|
|
|
|
PreSSXOT pressxot = new PreSSXOT(con1, con2, 0);
|
|
|
pressxot.runE(predata, timer);
|
|
|
|
|
|
- timer.stop(P.UR, M.offline_comp);
|
|
|
+ timer.stop(pid, M.offline_comp);
|
|
|
}
|
|
|
|
|
|
public void runD(PreData predata, int sw, int lBits, int[] tupleParam, Timer timer) {
|
|
|
- timer.start(P.UR, M.offline_comp);
|
|
|
+ timer.start(pid, M.offline_comp);
|
|
|
|
|
|
int logSW = (int) Math.ceil(Math.log(sw) / Math.log(2));
|
|
|
GCSignal[] j1ZeroKeys = GCUtil.genEmptyKeys(logSW);
|
|
@@ -85,34 +88,34 @@ public class PreUpdateRoot extends Protocol {
|
|
|
}
|
|
|
|
|
|
Network channel = new Network(con1, null);
|
|
|
- CompEnv<GCSignal> eva = new GCEva(channel, timer, P.UR, M.offline_read);
|
|
|
+ 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);
|
|
|
eva.setEvaluate();
|
|
|
|
|
|
- timer.start(P.UR, M.offline_read);
|
|
|
+ timer.start(pid, M.offline_read);
|
|
|
predata.ur_outKeyHashes = con1.readObject();
|
|
|
- timer.stop(P.UR, M.offline_read);
|
|
|
+ timer.stop(pid, M.offline_read);
|
|
|
|
|
|
PreSSXOT pressxot = new PreSSXOT(con1, con2, 0);
|
|
|
pressxot.runD(predata, sw + 1, sw, tupleParam, timer);
|
|
|
|
|
|
- timer.stop(P.UR, M.offline_comp);
|
|
|
+ timer.stop(pid, M.offline_comp);
|
|
|
}
|
|
|
|
|
|
public void runC(PreData predata, Timer timer) {
|
|
|
- timer.start(P.UR, M.offline_comp);
|
|
|
+ timer.start(pid, M.offline_comp);
|
|
|
|
|
|
- timer.start(P.UR, M.offline_read);
|
|
|
+ timer.start(pid, M.offline_read);
|
|
|
predata.ur_C_feKeyPairs = con1.readObject();
|
|
|
predata.ur_C_labelKeyPairs = con1.readObject();
|
|
|
- timer.stop(P.UR, M.offline_read);
|
|
|
+ timer.stop(pid, M.offline_read);
|
|
|
|
|
|
PreSSXOT pressxot = new PreSSXOT(con1, con2, 0);
|
|
|
pressxot.runC(predata, timer);
|
|
|
|
|
|
- timer.stop(P.UR, M.offline_comp);
|
|
|
+ timer.stop(pid, M.offline_comp);
|
|
|
}
|
|
|
|
|
|
@Override
|