SPDZ-Yao.

This commit is contained in:
Marcel Keller
2018-05-28 22:45:08 +02:00
parent 78af37ae03
commit 1669ce5bf5
89 changed files with 2345 additions and 449 deletions

View File

@@ -11,6 +11,9 @@
#include <valgrind/callgrind.h>
#include "Yao/YaoGarbleWire.h"
#include "Yao/YaoEvalWire.h"
#ifdef MAX_INLINE
#include "Instruction_inline.h"
#endif
@@ -47,6 +50,16 @@ void Program<T>::compute_constants()
}
}
template <class T>
void Program<T>::parse(const string& bytecode_name)
{
string filename = "Programs/Bytecode/" + bytecode_name + ".bc";
ifstream s(filename.c_str());
if (s.bad() or s.fail())
throw runtime_error("Cannot open " + filename);
parse(s);
}
template <class T>
void Program<T>::parse(istream& s)
{
@@ -57,6 +70,8 @@ void Program<T>::parse(istream& s)
CALLGRIND_STOP_INSTRUMENTATION;
while (!s.eof())
{
if (s.bad() or s.fail())
throw runtime_error("error reading program");
instr.parse(s, pos);
p.push_back(instr);
//cerr << "\t" << instr << endl;
@@ -120,5 +135,7 @@ template class Program< Secret<PRFRegister> >;
template class Program< Secret<EvalRegister> >;
template class Program< Secret<GarbleRegister> >;
template class Program< Secret<RandomRegister> >;
template class Program< Secret<YaoGarbleWire> >;
template class Program< Secret<YaoEvalWire> >;
} /* namespace GC */