Files
MP-SPDZ/GC/AuthValue.cpp
Marcel Keller cc0711c224 MP-SPDZ.
2018-10-11 17:20:26 +11:00

27 lines
471 B
C++

/*
* AuthValue.cpp
*
*/
#include "Secret.h"
namespace GC
{
void AuthValue::assign(const word& value, const int128& mac_key, bool not_first_player)
{
if (not_first_player)
share = 0;
else
share = value;
mac = _mm_clmulepi64_si128(_mm_cvtsi64_si128(mac_key.get_lower()), _mm_cvtsi64_si128(value), 0);
}
ostream& operator<<(ostream& o, const AuthValue& auth_value)
{
o << hex << auth_value.share << " " << auth_value.mac;
return o;
}
}