mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-08 21:18:03 -05:00
Required preprocessing for semi-honest protocols.
This commit is contained in:
@@ -160,6 +160,12 @@ string BaseMachine::memory_filename(const string& type_short, int my_number)
|
||||
|
||||
string BaseMachine::get_domain(string progname)
|
||||
{
|
||||
if (singleton)
|
||||
{
|
||||
assert(s().progname == progname);
|
||||
return s().domain;
|
||||
}
|
||||
|
||||
assert(not singleton);
|
||||
BaseMachine machine;
|
||||
singleton = 0;
|
||||
|
||||
@@ -166,7 +166,9 @@ void OfflineMachine<W>::generate()
|
||||
{
|
||||
ofstream out(filename, ios::binary);
|
||||
file_signature<T>().output(out);
|
||||
for (int i = 0; i < buffered_total(total, batch); i++)
|
||||
auto& opts = OnlineOptions::singleton;
|
||||
opts.batch_size = DIV_CEIL(opts.batch_size, batch) * batch;
|
||||
for (int i = 0; i < buffered_total(total, batch) / batch; i++)
|
||||
preprocessing.template get_edabitvec<0>(true, n_bits).output(n_bits,
|
||||
out);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,8 @@ public:
|
||||
ez::ezOptionParser& opt);
|
||||
};
|
||||
|
||||
template<template<int K> class T, template<class V> class U>
|
||||
template<template<int K> class T, template<class V> class U,
|
||||
class W = DishonestMajorityMachine>
|
||||
class DishonestMajorityRingMachine
|
||||
{
|
||||
public:
|
||||
@@ -49,7 +50,7 @@ public:
|
||||
OnlineOptions& online_opts = OnlineOptions::singleton;
|
||||
online_opts = {opt, argc, argv, T<64>(), live_prep_default};
|
||||
|
||||
RingMachine<T, U, DishonestMajorityMachine>(argc, argv, opt, online_opts);
|
||||
RingMachine<T, U, W>(argc, argv, opt, online_opts);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ RingMachine<U, V, W>::RingMachine(int argc, const char** argv,
|
||||
ez::ezOptionParser& opt, OnlineOptions& online_opts, int nplayers)
|
||||
{
|
||||
RingOptions opts(opt, argc, argv);
|
||||
W machine(argc, argv, opt, online_opts, nplayers);
|
||||
W machine(argc, argv, opt, online_opts, gf2n(), nplayers);
|
||||
int R = opts.ring_size_from_opts_or_schedule(online_opts.progname);
|
||||
switch (R)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user