mirror of
https://github.com/emp-toolkit/emp-ag2pc.git
synced 2026-01-10 07:47:59 -05:00
add new test for simple circuits
This commit is contained in:
@@ -66,6 +66,7 @@ before_install:
|
||||
script:
|
||||
- cat /proc/cpuinfo
|
||||
- cmake -DCMAKE_BUILD_TYPE=$TYPE . && make
|
||||
- ./run ./bin/simple_circuit 12345
|
||||
- ./run ./bin/aes 12345
|
||||
- ./run ./bin/sha1 12345
|
||||
- ./run ./bin/sha256 12345
|
||||
|
||||
@@ -18,6 +18,7 @@ endmacro()
|
||||
add_test(aes)
|
||||
add_test(sha1)
|
||||
add_test(sha256)
|
||||
add_test (simple_circuit)
|
||||
#add_test (abit)
|
||||
#add_test (amortized_2pc)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ int main(int argc, char** argv) {
|
||||
parse_party_and_port(argv, &party, &port);
|
||||
NetIO* io = new NetIO(party==ALICE ? nullptr:IP, port);
|
||||
io->set_nodelay();
|
||||
test(party, io, "AES-non-expanded.txt");
|
||||
test(party, io, circuit_file_location+"AES-non-expanded.txt");
|
||||
delete io;
|
||||
return 0;
|
||||
}
|
||||
|
||||
9
test/ands.txt
Normal file
9
test/ands.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
6 14
|
||||
4 4 6
|
||||
|
||||
2 1 0 4 8 AND
|
||||
2 1 1 5 9 AND
|
||||
2 1 2 6 10 AND
|
||||
2 1 3 7 11 AND
|
||||
1 1 8 12 INV
|
||||
2 1 9 12 13 AND
|
||||
@@ -8,7 +8,7 @@ int main(int argc, char** argv) {
|
||||
parse_party_and_port(argv, &party, &port);
|
||||
NetIO* io = new NetIO(party==ALICE ? nullptr:IP, port);
|
||||
io->set_nodelay();
|
||||
test(party, io, "sha-1.txt", string("92b404e556588ced6c1acd4ebf053f6809f73a93"));
|
||||
test(party, io, circuit_file_location+"sha-1.txt", string("92b404e556588ced6c1acd4ebf053f6809f73a93"));
|
||||
delete io;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ int main(int argc, char** argv) {
|
||||
parse_party_and_port(argv, &party, &port);
|
||||
NetIO* io = new NetIO(party==ALICE ? nullptr:IP, port);
|
||||
io->set_nodelay();
|
||||
test(party, io, "sha-256.txt", "da5698be17b9b46962335799779fbeca8ce5d491c0d26243bafef9ea1837a9d8");
|
||||
test(party, io, circuit_file_location+"sha-256.txt", "da5698be17b9b46962335799779fbeca8ce5d491c0d26243bafef9ea1837a9d8");
|
||||
delete io;
|
||||
return 0;
|
||||
}
|
||||
|
||||
14
test/simple_circuit.cpp
Normal file
14
test/simple_circuit.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <emp-tool/emp-tool.h>
|
||||
#include "test/single_execution.h"
|
||||
using namespace std;
|
||||
using namespace emp;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int party, port;
|
||||
parse_party_and_port(argv, &party, &port);
|
||||
NetIO* io = new NetIO(party==ALICE ? nullptr:IP, port);
|
||||
io->set_nodelay();
|
||||
test(party, io, "test/ands.txt");
|
||||
delete io;
|
||||
return 0;
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using namespace emp;
|
||||
|
||||
const string circuit_file_location = macro_xstr(EMP_CIRCUIT_PATH);
|
||||
void test(int party, NetIO* io, string name, string check_output = "") {
|
||||
string file = circuit_file_location + name;
|
||||
string file = name;//circuit_file_location + name;
|
||||
CircuitFile cf(file.c_str());
|
||||
auto t1 = clock_start();
|
||||
C2PC twopc(io, party, &cf);
|
||||
|
||||
Reference in New Issue
Block a user