/* * FakePrep.h * */ #ifndef PROTOCOLS_FAKEPREP_H_ #define PROTOCOLS_FAKEPREP_H_ #include "ReplicatedPrep.h" template class FakePrep : public BufferPrep { SeededPRNG G; public: FakePrep(SubProcessor*, DataPositions& usage) : BufferPrep(usage) { } FakePrep(DataPositions& usage, GC::ShareThread&) : BufferPrep(usage) { } FakePrep(DataPositions& usage, int = 0) : BufferPrep(usage) { } void set_protocol(typename T::Protocol&) { } void buffer_triples() { for (int i = 0; i < 1000; i++) { auto a = G.get(); auto b = G.get(); this->triples.push_back({{a, b, a * b}}); } } void buffer_squares() { for (int i = 0; i < 1000; i++) { auto a = G.get(); this->squares.push_back({{a, a * a}}); } } void buffer_inverses() { for (int i = 0; i < 1000; i++) { auto a = G.get(); this->inverses.push_back({{a, a.invert()}}); } } void buffer_bits() { for (int i = 0; i < 1000; i++) { this->bits.push_back(G.get_bit()); } } void buffer_inputs(int) { this->inputs.resize(1); for (int i = 0; i < 1000; i++) { auto r = G.get(); this->inputs[0].push_back({r, r}); } } void get_dabit_no_count(T& a, typename T::bit_type& b) { auto bit = G.get_bit(); a = bit; b = bit; } void get_one_no_count(Dtype dtype, T& a) { assert(dtype == DATA_BIT); a = G.get_uchar() & 1; } }; #endif /* PROTOCOLS_FAKEPREP_H_ */