mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-04-20 03:01:31 -04:00
21 lines
349 B
C++
21 lines
349 B
C++
/*
|
|
* Diagonal.cpp
|
|
*
|
|
*/
|
|
|
|
#include <OT/BitDiagonal.h>
|
|
|
|
void BitDiagonal::pack(octetStream& os) const
|
|
{
|
|
for (int i = 0; i < N_ROWS; i++)
|
|
os.store_bit(rows[i].get_bit(i));
|
|
os.append(0);
|
|
}
|
|
|
|
void BitDiagonal::unpack(octetStream& os)
|
|
{
|
|
*this = {};
|
|
for (int i = 0; i < N_ROWS; i++)
|
|
rows[i] = RowType(os.get_bit()) << i;
|
|
}
|