E_T1_FF1_O_2_1.java 795 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // by Boyang Wei
  2. package YaoGC;
  3. import java.math.*;
  4. import Cipher.*;
  5. import sprout.oram.PID;
  6. import sprout.oram.TID;
  7. class E_T1_FF1_O_2_1 extends T1_FF1_O_2_1 {
  8. public E_T1_FF1_O_2_1() {
  9. super();
  10. }
  11. protected void execYao() {
  12. Wire inWireL = inputWires[0];
  13. Wire inWireR = inputWires[1];
  14. Wire outWire = outputWires[0];
  15. // receiveGTT();
  16. int i0 = Wire.getLSB(inWireL.lbl);
  17. i0 = inWireL.invd ? (1 - i0) : i0;
  18. int i1 = Wire.getLSB(inWireR.lbl);
  19. i1 = inWireR.invd ? (1 - i1) : i1;
  20. timing.stopwatch[PID.sha1][TID.online].start();
  21. BigInteger out = Cipher.decrypt(inWireL.lbl, inWireR.lbl,
  22. outWire.serialNum, gtt[i0][i1]);
  23. timing.stopwatch[PID.sha1][TID.online].stop();
  24. outWire.setLabel(out);
  25. }
  26. @Override
  27. protected void passTruthTable() {
  28. receiveGTT();
  29. }
  30. }