/* * ShareVector.h * */ #ifndef PROTOCOLS_SHAREVECTOR_H_ #define PROTOCOLS_SHAREVECTOR_H_ #include "FHE/AddableVector.h" #include "Protocols/Share.h" #include "Math/gfp.h" template class ShareVector : public AddableVector { public: ShareVector operator+(const ShareVector& other) const { assert(this->size() == other.size()); ShareVector res; for (size_t i = 0; i < other.size(); i++) res.push_back((*this)[i] + other[i]); return res; } ShareVector operator-(const ShareVector& other) const { assert(this->size() == other.size()); ShareVector res; for (size_t i = 0; i < other.size(); i++) res.push_back((*this)[i] - other[i]); return res; } template ShareVector operator*(const AddableVector& other) const { assert(this->size() == other.size()); ShareVector res; for (size_t i = 0; i < other.size(); i++) res.push_back((*this)[i] * other[i]); return res; } template ShareVector operator*(const T& other) const { ShareVector res; for (size_t i = 0; i < this->size(); i++) res.push_back((*this)[i] * other); return res; } void fft(const FFT_Data& fftd); }; #endif /* PROTOCOLS_SHAREVECTOR_H_ */