diff --git a/OT/BaseOT.cpp b/OT/BaseOT.cpp index be5e2ad87..24ed5af23 100644 --- a/OT/BaseOT.cpp +++ b/OT/BaseOT.cpp @@ -246,6 +246,10 @@ void BaseOT::exec_base(bool new_receiver_inputs) #endif } + if (ot_role & SENDER) + for (int i = 0; i < nOT; i++) + assert(sender_inputs.at(i).at(0) != sender_inputs.at(i).at(1)); + // Hash with counter to avoid collisions for (int i = 0; i < nOT; i++) { @@ -256,8 +260,16 @@ void BaseOT::exec_base(bool new_receiver_inputs) hash_with_id(sender_inputs.at(i).at(j), i); } + if (ot_role & SENDER) + for (int i = 0; i < nOT; i++) + assert(sender_inputs.at(i).at(0) != sender_inputs.at(i).at(1)); + // Set PRG seeds set_seeds(); + + if (ot_role & SENDER) + for (int i = 0; i < nOT; i++) + assert(sender_inputs.at(i).at(0) != sender_inputs.at(i).at(1)); } void BaseOT::hash_with_id(BitVector& bits, long id) diff --git a/Tools/BitVector.h b/Tools/BitVector.h index 89c404996..06965417d 100644 --- a/Tools/BitVector.h +++ b/Tools/BitVector.h @@ -242,6 +242,11 @@ class BitVector return equals(other); } + bool operator!=(const BitVector& other) const + { + return not equals(other); + } + void append(const BitVector& other, size_t length); void randomize(PRNG& G);