mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-04-20 03:01:31 -04:00
27 lines
471 B
C++
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;
|
|
}
|
|
|
|
}
|