Fix bug in MASCOT GF(2^n) bit generation.

This commit is contained in:
Marcel Keller
2021-09-15 21:54:37 +10:00
parent b78664f763
commit 5c6f101c12
2 changed files with 10 additions and 10 deletions

View File

@@ -88,10 +88,10 @@ class MascotMultiplier : public OTMultiplier<T>
const vector<BitVector>& baseReceiverOutput);
void multiplyForBits();
template <class U>
void multiplyForBits(U);
template <int X, int L>
void multiplyForBits(gfp_<X, L>);
template <int = 0>
void multiplyForBits(true_type);
template <int = 0>
void multiplyForBits(false_type);
public:
vector<typename T::open_type> c_output;

View File

@@ -403,19 +403,19 @@ void Spdz2kMultiplier<K, S>::after_correlation()
template<class T>
void MascotMultiplier<T>::multiplyForBits()
{
multiplyForBits(typename T::clear());
multiplyForBits(T::clear::characteristic_two);
}
template<class T>
template<int X, int L>
void MascotMultiplier<T>::multiplyForBits(gfp_<X, L>)
template<int>
void MascotMultiplier<T>::multiplyForBits(false_type)
{
throw runtime_error("should not be called");
}
template<class T>
template<class U>
void MascotMultiplier<T>::multiplyForBits(U)
template<int>
void MascotMultiplier<T>::multiplyForBits(true_type)
{
auto& macs = this->macs;
auto& outbox = this->outbox;
@@ -459,7 +459,7 @@ void MascotMultiplier<T>::multiplyForBits(U)
{
int128 r = auth_ot_ext.receiverOutputMatrix.squares[j/128].rows[j%128];
int128 s = auth_ot_ext.senderOutputMatrices[0].squares[j/128].rows[j%128];
macs[0][j] = typename T::clear(r ^ s);
macs[0][j] = T::clear::cut(r ^ s);
}
outbox.push(job);