Required preprocessing for semi-honest protocols.

This commit is contained in:
Marcel Keller
2023-03-15 12:46:07 +11:00
parent f3d5cc4241
commit 1a73c741c0
10 changed files with 76 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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