emp-toolkit / emp-m2pc Goto Github PK
View Code? Open in Web Editor NEWMalicious Two Party Computation Based on Garbled Circuits.
License: Other
Malicious Two Party Computation Based on Garbled Circuits.
License: Other
After compiling the project, when I try to run the examples, I get "*** stack smashing detected ***: ./bin/sha1 terminated"
. This happens with all the examples included in the test
directory.
I am running ./run ./bin/sha1 12345
. The same happens with ./bin/sha1 1 12345
and ./bin/sha1 2 12345
.
But, I am able to run the examples of emp-sh2pc
correctly.
Hello,
I've faced several errors with regard to building the tests. For example:
/emp-m2pc/malicious/malicious.h:17:2: error: ‘MOTExtension’ does not name a type
17 | MOTExtension * ot;
| ^~~~~~~~~~~~
/emp-m2pc/malicious/malicious.h:18:2: error: ‘MOTExtension’ does not name a type
18 | MOTExtension * cot;
| ^~~~~~~~~~~~
/emp-m2pc/malicious/malicious.h:19:2: error: ‘Commitment’ does not name a type
19 | Commitment commitment;
| ^~~~~~~~~~
/emp-m2pc/malicious/malicious.h:21:2: error: ‘XorTree’ does not name a type
21 | XorTree<> * xortree;
| ^~~~~~~
These are some of the errors that crop up when building the sha1 test
The following is the code of bob_preload
in the class Malicious
.
void bob_preload(){
int sent = fio->bytes_sent;
delete fio;
fio = new FileIO(GC_FILE.c_str(), true);
mio = new MemIO(0);
mio->load_from_file(fio, sent);
delete fio;
}
So it actually uses the fio->bytes_sent
from bob_offline()
assuming it is run before the bob_preload()
. I guess it is for experiment purpose because, for measurement, we run offline and then test in online.
If offline and online are highly separated (garble today and use tomorrow), I guess sent
here should be retrieved from the file size of GC_FILE.c_str()
?
considering to submit a short PR for this.
OK:) this is not an easy debug. I found the reason why my Mac always fails for sha256
in emp-m2pc
due to res4=1
and Alice cheat=1
, showing WRONG_ANS
.
It seems that my Mac has a terrible loopback network (or I guess too fast?). The standard NETWORK_BUFFER_SIZE
in emp_tool/utils/constants.h
will make buffer insufficient and cause data loss -- the result is that Bob 'cheats' and the result for sha256
in emp-m2pc
is wrong in my specific case.
My question is:
During the EUROCRYPT'17 paper and previous works on emp-toolkit, will a very high NETWORK_BUFFER_SIZE
obviously hurts the performance (due to the loss of locality?)? If this performance change is not obvious, maybe the default value for NETWORK_BUFFER_SIZE
in emp-tool/utils/constants.h
can be changed to a larger one.
(I see the comment nearby said that this value should be adjusted for the specific network. I feel that this value should increase for emp-m2pc
because the evaluation is slower, the network can be too fast.)
emp-toolkit/emp-m2pc does not compile with the latest emp-toolkit/emp-tool version because of the following issues:
timeStamp
from https://github.com/emp-toolkit/emp-tool/blob/stable/utils/utils.h and https://github.com/emp-toolkit/emp-tool/blob/stable/utils/utils.hpp.xorBlocks_arr2
from https://github.com/emp-toolkit/emp-tool/blob/stable/utils/block.h.For the first point, I guess the function was removed because clock_gettime
was not supported in macOS < 10.12. The best solution might be to use std::chrono
as in https://github.com/emp-toolkit/emp-tool/blob/master/emp-tool/utils/utils.hpp. In the later file however, the return type was changed from double
to uint64_t
. This might yield some issues. In the meantime, it might be simpler to keep the old implementation with clock_gettime
and to require macOS >= 10.12.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.