forked from data61/MP-SPDZ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgc-emulate.cpp
35 lines (31 loc) · 858 Bytes
/
gc-emulate.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* gc-emulate.cpp
*
*/
#include <GC/Program.h>
#include <GC/Instruction.h>
#include <GC/FakeSecret.h>
#include "GC/Machine.h"
#include "GC/Processor.h"
#include "GC/Processor.hpp"
#include "GC/Machine.hpp"
#include "GC/Program.hpp"
#include "GC/Thread.hpp"
#include "GC/ThreadMaster.hpp"
#include "Processor/Machine.hpp"
#include "Processor/Instruction.hpp"
int main(int argc, char** argv)
{
if (argc < 2)
exit(1);
GC::Memory<GC::FakeSecret> dynamic_memory;
GC::Machine<GC::FakeSecret> machine;
GC::Processor<GC::FakeSecret> processor(machine);
GC::Program program;
program.parse(string(argv[1]) + "-0");
machine.reset(program, dynamic_memory);
processor.reset(program);
if (argc > 2)
processor.open_input_file(argv[2]);
while (program.execute(processor, dynamic_memory) != GC::DONE_BREAK);
}