mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-14 16:08:04 -05:00
41 lines
714 B
C++
41 lines
714 B
C++
/*
|
|
* SquarePrep.h
|
|
*
|
|
*/
|
|
|
|
#ifndef PROTOCOLS_SQUAREPREP_H_
|
|
#define PROTOCOLS_SQUAREPREP_H_
|
|
|
|
#include "ReplicatedPrep.h"
|
|
|
|
template<class T, class U>
|
|
void generate_squares(vector<array<T, 2>>& squares, int n_squares,
|
|
U* protocol);
|
|
|
|
template<class T>
|
|
class SquarePrep : public BufferPrep<T>
|
|
{
|
|
void buffer_triples()
|
|
{
|
|
throw runtime_error("no triples here");
|
|
}
|
|
|
|
void buffer_squares()
|
|
{
|
|
generate_squares(this->squares, this->buffer_size,
|
|
&this->proc->protocol);
|
|
}
|
|
|
|
public:
|
|
SquarePrep(DataPositions& usage) :
|
|
BufferPrep<T>(usage)
|
|
{
|
|
}
|
|
|
|
void set_protocol(typename T::Protocol&)
|
|
{
|
|
}
|
|
};
|
|
|
|
#endif /* PROTOCOLS_SQUAREPREP_H_ */
|