#include "Share.h" //#include "Tools/random.h" #include "Math/gfp.h" #include "Math/gf2n.h" #include "Math/operators.h" #include "Math/FixedVec.h" #include "Math/Integer.h" template void Share::mul_by_bit(const Share& S,const T& aa) { a.mul(S.a,aa); mac.mul(S.mac,aa); } template<> void Share::mul_by_bit(const Share& S, const gf2n& aa) { a.mul_by_bit(S.a,aa); mac.mul_by_bit(S.mac,aa); } template T combine(const vector< Share >& S) { T ans=S[0].a; for (unsigned int i=1; i inline void Share::pack(octetStream& os, bool full) const { a.pack(os); if (full) mac.pack(os); } template inline void Share::unpack(octetStream& os, bool full) { a.unpack(os); if (full) mac.unpack(os); } template bool check_macs(const vector< Share >& S,const T& key) { T val=combine(S); // Now check the MAC is valid val.mul(val,key); for (unsigned i=0; i; template class Share; template gf2n combine(const vector< Share >& S); template gfp combine(const vector< Share >& S); template bool check_macs(const vector< Share >& S,const gf2n& key); template bool check_macs(const vector< Share >& S,const gfp& key); #ifdef USE_GF2N_LONG template class Share; template gf2n_short combine(const vector< Share >& S); template bool check_macs(const vector< Share >& S,const gf2n_short& key); #endif