Skip to content

Commit

Permalink
Fix bug in emulation of splitting.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed Nov 20, 2024
1 parent c56ff58 commit e7554cc
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions Protocols/FakeShare.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,24 @@ void FakeShare<T>::split(StackedVector<bit_type>& dest,
int start = k * unit;
int m = min(unit, n_inputs - start);

switch (regs.size() / n_bits)
{
case 3:
{
for (int i = 0; i < n_bits; i++)
for (int j = 1; j < 3; j++)
dest.at(regs.at(3 * i + j) + k) = {};
int n_split = regs.size() / n_bits;
for (int i = 0; i < n_bits; i++)
for (int j = 1; j < n_split; j++)
dest.at(regs.at(n_split * i + j) + k) = {};

square64 square;
square64 square;

for (int j = 0; j < m; j++)
{
square.rows[j] = (source[j + start]).get_limb(0);
}
for (int j = 0; j < m; j++)
{
square.rows[j] = (source[j + start]).get_limb(0);
}

square.transpose(m, n_bits);
square.transpose(m, n_bits);

for (int j = 0; j < n_bits; j++)
{
auto& dest_reg = dest.at(regs.at(3 * j) + k);
dest_reg = square.rows[j];
}
break;
}
default:
not_implemented();
for (int j = 0; j < n_bits; j++)
{
auto& dest_reg = dest.at(regs.at(n_split * j) + k);
dest_reg = square.rows[j];
}
}
}

0 comments on commit e7554cc

Please sign in to comment.