E_OR_2_1.java 818 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (C) 2010 by Yan Huang <yhuang@virginia.edu>
  2. package YaoGC;
  3. import java.math.*;
  4. import Cipher.*;
  5. import sprout.oram.PID;
  6. import sprout.oram.TID;
  7. class E_OR_2_1 extends OR_2_1 {
  8. public E_OR_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. }