コード例 #1
0
 def _ch(self, a, b, c):
     gc_ = garbled_circuit.GC(a + b + c, self._input_wire['ch'],
                              self._output_wire['ch'], self._circuit['ch'])
     gc_.update()
     ans = gc_.ans
     self.genTime += gc_.genTime
     self.decTime += gc_.decTime
     s = ""
     for i in range(0, 32):
         s += str(ans['o_' + str(i)])
     return s
コード例 #2
0
 def _ma(self, a, b, c):
     gc_ = garbled_circuit.GC(a + b + c, self._input_wire['ma'],
                              self._output_wire['ma'], self._circuit['ma'])
     #gc_.update()
     #ans = gc_.ans
     self.genTime += gc_.genTime
     # self.decTime += gc_.decTime
     s = ""
     #for i in range(0, 32):
     #    s += str(ans['o_' + str(i)])
     return s
コード例 #3
0
 def _sigma11(self, x):
     gc_ = garbled_circuit.GC(x, self._input_wire['s11'],
                              self._output_wire['s11'],
                              self._circuit['s11'])
     gc_.update()
     ans = gc_.ans
     self.genTime += gc_.genTime
     self.decTime += gc_.decTime
     s = ""
     for i in range(0, 32):
         s += str(ans['o_' + str(i)])
     return s
コード例 #4
0
 def _sigma00(self, x):
     gc_ = garbled_circuit.GC(x, self._input_wire['s00'],
                              self._output_wire['s00'],
                              self._circuit['s00'])
     # gc_.update()
     # ans = gc_.ans
     self.genTime += gc_.genTime
     # self.decTime += gc_.decTime
     s = ""
     #for i in range(0, 32):
     #    s += str(ans['o_' + str(i)])
     return s