mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-08 05:03:59 -05:00
60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
/*
|
|
* DishonestMajorityMachine.h
|
|
*
|
|
*/
|
|
|
|
#ifndef PROCESSOR_ONLINEMACHINE_H_
|
|
#define PROCESSOR_ONLINEMACHINE_H_
|
|
|
|
#include "Processor/OnlineOptions.h"
|
|
#include "Math/gf2n.h"
|
|
#include "Networking/Player.h"
|
|
|
|
class OnlineMachine
|
|
{
|
|
protected:
|
|
int argc;
|
|
const char** argv;
|
|
OnlineOptions& online_opts;
|
|
|
|
Names playerNames;
|
|
|
|
bool use_encryption;
|
|
|
|
ez::ezOptionParser& opt;
|
|
|
|
int nplayers;
|
|
|
|
public:
|
|
template<class V = gf2n>
|
|
OnlineMachine(int argc, const char** argv, ez::ezOptionParser& opt,
|
|
OnlineOptions& online_opts, int nplayers = 0, V = {});
|
|
|
|
void start_networking();
|
|
|
|
template<class T, class U>
|
|
int run();
|
|
template<class T, class U>
|
|
int run_with_error();
|
|
|
|
Player* new_player(const string& id_base);
|
|
|
|
int get_lg2()
|
|
{
|
|
return online_opts.lg2;
|
|
}
|
|
};
|
|
|
|
class DishonestMajorityMachine : public OnlineMachine
|
|
{
|
|
public:
|
|
template<class V>
|
|
DishonestMajorityMachine(int argc, const char** argv,
|
|
ez::ezOptionParser& opt, OnlineOptions& online_opts, V,
|
|
int nplayers = 0);
|
|
DishonestMajorityMachine(int argc, const char** argv,
|
|
ez::ezOptionParser& opt, OnlineOptions& online_opts, int nplayers);
|
|
};
|
|
|
|
#endif /* PROCESSOR_ONLINEMACHINE_H_ */
|