emp-toolkit / emp-sh2pc

Semi-honest Two Party Computation Based on Garbled Circuits.
Other
75 stars 38 forks source link

Does sh2pc do garbled circuit? #32

Open tomato990 opened 2 years ago

tomato990 commented 2 years ago

I am looking at circuit_file.cpp and try to understand how sh2pc works. In circuit_file.cpp, Alice and Bob tries to compute AES function together, but it seems they do not run it on a garbled circuit or ot. Instead, they run on a straight-forward circuit evaluation. I do not know whether it can be defined as semi-honest, since either Bob or Alice can easily learn the other's secret in the test function. Is there any hint?

wangxiao1254 commented 2 years ago

It is done using garbled circuits and OT. You need to look into emp-tool and emp-ot for these components as well.

tomato990 commented 2 years ago

It is done using garbled circuits and OT. You need to look into emp-tool and emp-ot for these components as well.

Now I understand that it is doing OT and Garbled circuit. Thank you.

I have a quick follow-up question for garbling AES. Will the efficiency be improved a lot if Alice sends all garbled circuit tables to Bob first and let Bob evaluate the circuit offline instead of sending tables for each AND gate during the evaluation? It seems that it can make much much fewer round trips.

wangxiao1254 commented 2 years ago

the protocol is constant round regardless of how the data is sent. Sending a lot of data all at once will only make it slower because now when the garbling is done, the evaluator is just waiting and not doing anything.

wangxiao1254 commented 2 years ago

io->send(xx, 1); io->send(xx, 1) has the same round complexity as io->send(xx, 2)