add new test for simple circuits

This commit is contained in:
Xiao Wang
2019-04-11 10:44:57 -04:00
parent ca8232da44
commit 3af062bc1b
8 changed files with 29 additions and 4 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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
View 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

View File

@@ -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;
}

View File

@@ -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
View 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;
}

View File

@@ -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);