mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-09 13:37:58 -05:00
35 lines
613 B
C++
35 lines
613 B
C++
/*
|
|
* Rep4Prep.cpp
|
|
*
|
|
*/
|
|
|
|
#include "Rep4Prep.h"
|
|
|
|
#include "Protocols/Rep4.hpp"
|
|
#include "Protocols/Rep4Input.hpp"
|
|
#include "Protocols/Replicated.hpp"
|
|
#include "Protocols/ReplicatedPrep.hpp"
|
|
|
|
namespace GC
|
|
{
|
|
|
|
Rep4Prep::Rep4Prep(DataPositions& usage, int) :
|
|
BufferPrep<Rep4Secret>(usage)
|
|
{
|
|
}
|
|
|
|
void Rep4Prep::set_protocol(Rep4Secret::Protocol& protocol)
|
|
{
|
|
this->P = &protocol.P;
|
|
}
|
|
|
|
void Rep4Prep::buffer_bits()
|
|
{
|
|
assert(P);
|
|
Rep4<Rep4Secret> proto(*P);
|
|
for (int i = 0; i < OnlineOptions::singleton.batch_size; i++)
|
|
this->bits.push_back(proto.get_random() & 1);
|
|
}
|
|
|
|
} /* namespace GC */
|