|
@@ -6,6 +6,8 @@ import com.oblivm.backend.gc.GCEvaComp;
|
|
|
import com.oblivm.backend.gc.GCSignal;
|
|
|
import com.oblivm.backend.network.Network;
|
|
|
|
|
|
+import util.Timer;
|
|
|
+
|
|
|
public class GCEva extends GCEvaComp {
|
|
|
Garbler gb;
|
|
|
GCSignal[][] gtt = new GCSignal[2][2];
|
|
@@ -14,6 +16,10 @@ public class GCEva extends GCEvaComp {
|
|
|
GCEva next = null;
|
|
|
GCEva curr = null;
|
|
|
|
|
|
+ Timer timer = null;
|
|
|
+ int p;
|
|
|
+ int m;
|
|
|
+
|
|
|
public GCEva(Network channel) {
|
|
|
super(channel, Mode.REAL);
|
|
|
gb = new Garbler();
|
|
@@ -23,6 +29,19 @@ public class GCEva extends GCEvaComp {
|
|
|
gtt[1][1] = GCSignal.newInstance(new byte[10]);
|
|
|
}
|
|
|
|
|
|
+ public GCEva(Network channel, Timer timer, int p, int m) {
|
|
|
+ super(channel, Mode.REAL);
|
|
|
+ gb = new Garbler();
|
|
|
+ gtt[0][0] = GCSignal.ZERO;
|
|
|
+ gtt[0][1] = GCSignal.newInstance(new byte[10]);
|
|
|
+ gtt[1][0] = GCSignal.newInstance(new byte[10]);
|
|
|
+ gtt[1][1] = GCSignal.newInstance(new byte[10]);
|
|
|
+
|
|
|
+ this.timer = timer;
|
|
|
+ this.p = p;
|
|
|
+ this.m = m;
|
|
|
+ }
|
|
|
+
|
|
|
public void setEvaluate() {
|
|
|
evaluate = true;
|
|
|
curr = this;
|
|
@@ -30,6 +49,9 @@ public class GCEva extends GCEvaComp {
|
|
|
|
|
|
private void receiveGTT() {
|
|
|
try {
|
|
|
+ if (timer != null)
|
|
|
+ timer.start(p, m);
|
|
|
+
|
|
|
Flag.sw.startGCIO();
|
|
|
GCSignal.receive(channel, gtt[0][1]);
|
|
|
GCSignal.receive(channel, gtt[1][0]);
|
|
@@ -37,6 +59,9 @@ public class GCEva extends GCEvaComp {
|
|
|
|
|
|
|
|
|
Flag.sw.stopGCIO();
|
|
|
+
|
|
|
+ if (timer != null)
|
|
|
+ timer.stop(p, m);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
System.exit(1);
|