Skip to content

Commit

Permalink
More checks on base OTs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed Jul 25, 2024
1 parent f43dc3e commit 2a66d44
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions OT/BaseOT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand All @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions Tools/BitVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2a66d44

Please sign in to comment.