/* * gf2nSquare.cpp * */ #include "Math/Square.h" template Square& Square::sub(const Square& other) { for (int i = 0; i < U::length(); i++) rows[i] -= other.rows[i]; return *this; } template Square& Square::rsub(const Square& other) { for (int i = 0; i < U::length(); i++) rows[i] = other.rows[i] - rows[i]; return *this; } template Square& Square::sub(const void* other) { U value; value.assign(other); for (int i = 0; i < U::length(); i++) rows[i] -= value; return *this; } template void Square::conditional_add(BitVector& conditions, Square& other, int offset) { for (int i = 0; i < U::length(); i++) if (conditions.get_bit(N_ROWS * offset + i)) rows[i] += other.rows[i]; } template void Square::pack(octetStream& os) const { for (int i = 0; i < U::length(); i++) rows[i].pack(os); } template void Square::unpack(octetStream& os) { for (int i = 0; i < U::length(); i++) rows[i].unpack(os); }