MOTION  0.01
Framework for mixed-protocol multi-party computation
Public Member Functions | List of all members
encrypto::motion::Party Class Reference

#include <party.h>

Public Member Functions

 Party ()=delete
 
 Party (Party &party)=delete
 
 Party (std::unique_ptr< communication::CommunicationLayer > parties)
 
 ~Party ()
 
ConfigurationPointer GetConfiguration ()
 
communication::CommunicationLayerGetCommunicationLayer ()
 
template<MpcProtocol P>
SharePointer In (std::span< const BitVector<>> input, std::size_t party_id=std::numeric_limits< std::size_t >::max())
 
template<MpcProtocol P>
SharePointer In (std::vector< BitVector<>> &&input, std::size_t party_id=std::numeric_limits< std::size_t >::max())
 
template<MpcProtocol P>
SharePointer In (const BitVector<> &input, std::size_t party_id=std::numeric_limits< std::size_t >::max())
 
template<MpcProtocol P>
SharePointer In (BitVector<> &&input, std::size_t party_id=std::numeric_limits< std::size_t >::max())
 
template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer In (const std::vector< T > &input, std::size_t party_id=std::numeric_limits< std::size_t >::max())
 
template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer In (std::vector< T > &&input, std::size_t party_id=std::numeric_limits< std::size_t >::max())
 
template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer In (T input, std::size_t party_id=std::numeric_limits< std::size_t >::max())
 
template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer SharedIn (T input)
 
template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer SharedIn (const std::vector< T > &input)
 
template<MpcProtocol P>
SharePointer SharedIn (std::span< const BitVector<>> input)
 
SharePointer Xor (const SharePointer &a, const SharePointer &b)
 
SharePointer Out (SharePointer parent, std::size_t output_owner)
 
SharePointer Add (const SharePointer &a, const SharePointer &b)
 
SharePointer And (const SharePointer &a, const SharePointer &b)
 
void Run (std::size_t repetitions=1)
 Evaluates the constructed gates a predefined number of times. This is realized via repeatedly calling Party::Clear() after each evaluation. If Connect() was not called yet, it is called automatically at the beginning of this method. More...
 
void Reset ()
 Destroys all the gates and wires that were constructed until now. More...
 
void Clear ()
 Interprets the gates and wires as newly created, i.e., Party::Run() can be executed again. More...
 
const auto & GetLogger ()
 
void Finish ()
 Sends a termination message to all of the connected parties. In case a TCP connection is used, this will internally be interpreted as a signal to disconnect. More...
 
auto & GetBackend ()
 

Constructor & Destructor Documentation

◆ Party() [1/3]

encrypto::motion::Party::Party ( )
delete

◆ Party() [2/3]

encrypto::motion::Party::Party ( Party party)
delete

◆ Party() [3/3]

encrypto::motion::Party::Party ( std::unique_ptr< communication::CommunicationLayer parties)

◆ ~Party()

encrypto::motion::Party::~Party ( )
Here is the call graph for this function:

Member Function Documentation

◆ Add()

SharePointer encrypto::motion::Party::Add ( const SharePointer a,
const SharePointer b 
)

◆ And()

SharePointer encrypto::motion::Party::And ( const SharePointer a,
const SharePointer b 
)

◆ Clear()

void encrypto::motion::Party::Clear ( )

Interprets the gates and wires as newly created, i.e., Party::Run() can be executed again.

Here is the caller graph for this function:

◆ Finish()

void encrypto::motion::Party::Finish ( )

Sends a termination message to all of the connected parties. In case a TCP connection is used, this will internally be interpreted as a signal to disconnect.

This method is executed by the Party destructor, but if the parties are run locally, e.g., for testing purposes, the user SHALL ensure that Party::Finish() is run in parallel or otherwise the desctructors will likely be called sequentially which will result in a deadlock, since both connected parties must have sent a termination message and the destructor will wait for the other party to send the signal. It is allowed to call Party::Finish() multiple times.

Here is the caller graph for this function:

◆ GetBackend()

auto& encrypto::motion::Party::GetBackend ( )
inline

◆ GetCommunicationLayer()

communication::CommunicationLayer& encrypto::motion::Party::GetCommunicationLayer ( )
inline

◆ GetConfiguration()

ConfigurationPointer encrypto::motion::Party::GetConfiguration ( )
inline

◆ GetLogger()

const auto& encrypto::motion::Party::GetLogger ( )
inline

◆ In() [1/7]

template<MpcProtocol P>
SharePointer encrypto::motion::Party::In ( BitVector<> &&  input,
std::size_t  party_id = std::numeric_limits<std::size_t>::max() 
)
inline

◆ In() [2/7]

template<MpcProtocol P>
SharePointer encrypto::motion::Party::In ( const BitVector<> &  input,
std::size_t  party_id = std::numeric_limits<std::size_t>::max() 
)
inline

◆ In() [3/7]

template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer encrypto::motion::Party::In ( const std::vector< T > &  input,
std::size_t  party_id = std::numeric_limits<std::size_t>::max() 
)
inline

◆ In() [4/7]

template<MpcProtocol P>
SharePointer encrypto::motion::Party::In ( std::span< const BitVector<>>  input,
std::size_t  party_id = std::numeric_limits<std::size_t>::max() 
)
inline

◆ In() [5/7]

template<MpcProtocol P>
SharePointer encrypto::motion::Party::In ( std::vector< BitVector<>> &&  input,
std::size_t  party_id = std::numeric_limits<std::size_t>::max() 
)
inline

◆ In() [6/7]

template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer encrypto::motion::Party::In ( std::vector< T > &&  input,
std::size_t  party_id = std::numeric_limits<std::size_t>::max() 
)
inline

◆ In() [7/7]

template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer encrypto::motion::Party::In ( input,
std::size_t  party_id = std::numeric_limits<std::size_t>::max() 
)
inline

◆ Out()

SharePointer encrypto::motion::Party::Out ( SharePointer  parent,
std::size_t  output_owner 
)

◆ Reset()

void encrypto::motion::Party::Reset ( )

Destroys all the gates and wires that were constructed until now.

◆ Run()

void encrypto::motion::Party::Run ( std::size_t  repetitions = 1)

Evaluates the constructed gates a predefined number of times. This is realized via repeatedly calling Party::Clear() after each evaluation. If Connect() was not called yet, it is called automatically at the beginning of this method.

Parameters
repetitionsNumber of iterations.
Here is the call graph for this function:

◆ SharedIn() [1/3]

template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer encrypto::motion::Party::SharedIn ( const std::vector< T > &  input)
inline

◆ SharedIn() [2/3]

template<MpcProtocol P>
SharePointer encrypto::motion::Party::SharedIn ( std::span< const BitVector<>>  input)
inline

◆ SharedIn() [3/3]

template<MpcProtocol P, typename T = std::uint8_t, typename = std::enable_if_t<std::is_unsigned_v<T>>>
SharePointer encrypto::motion::Party::SharedIn ( input)
inline

◆ Xor()

SharePointer encrypto::motion::Party::Xor ( const SharePointer a,
const SharePointer b 
)

The documentation for this class was generated from the following files: