MOTION
0.01
Framework for mixed-protocol multi-party computation
|
Go to the documentation of this file.
52 struct TransportStatistics;
60 CommunicationLayer(std::size_t my_id, std::vector<std::unique_ptr<Transport>>&& transports);
61 CommunicationLayer(std::size_t my_id, std::vector<std::unique_ptr<Transport>>&& transports,
62 std::shared_ptr<Logger> logger);
66 std::size_t
GetMyId()
const {
return my_id_; }
73 void SendMessage(std::size_t party_id, std::vector<std::uint8_t>&& message);
74 void SendMessage(std::size_t party_id,
const std::vector<std::uint8_t>& message);
75 void SendMessage(std::size_t party_id, std::shared_ptr<
const std::vector<std::uint8_t>> message);
76 void SendMessage(std::size_t party_id, flatbuffers::FlatBufferBuilder&& message_builder);
81 void BroadcastMessage(std::shared_ptr<
const std::vector<std::uint8_t>> message);
86 std::function<std::shared_ptr<MessageHandler>(std::size_t party_id)>;
89 const std::vector<MessageType>& message_types);
111 std::
size_t number_of_parties_;
115 std::shared_ptr<
Logger> logger_;
120 std::
size_t number_of_parties);
124 std::
size_t number_of_parties,
bool ipv6 = true);
void Synchronize()
Definition: communication_layer.cpp:302
std::vector< MessageHandlerMap > message_handlers_
Definition: communication_layer.cpp:81
std::vector< std::unique_ptr< CommunicationLayer > > MakeLocalTcpCommunicationLayers(std::size_t number_of_parties, bool ipv6)
Definition: communication_layer.cpp:526
std::vector< SynchronizedFiberQueue< message_t > > send_queues_
Definition: communication_layer.cpp:75
std::vector< std::shared_ptr< MessageHandler > > fallback_message_handlers_
Definition: communication_layer.cpp:82
Definition: communication_layer.cpp:49
void SendTerminationMessages()
std::size_t my_id_
Definition: communication_layer.cpp:62
~CommunicationLayer()
Definition: communication_layer.cpp:276
std::vector< std::thread > receive_threads_
Definition: communication_layer.cpp:76
void Shutdown()
Definition: communication_layer.cpp:233
const encrypto::motion::communication::Message * GetMessage(const void *buf)
Definition: message_generated.h:146
Definition: sync_handler.h:40
type
Definition: geninput.py:149
void ThreadSetName(std::thread &thread, const std::string &name)
Definition: thread.cpp:29
CommunicationLayer(std::size_t my_id, std::vector< std::unique_ptr< Transport >> &&transports)
Definition: communication_layer.cpp:250
void RegisterFallbackMessageHandler(MessageHandlerFunction)
Definition: communication_layer.cpp:449
std::promise< void > start_promise_
Definition: communication_layer.cpp:65
std::shared_ptr< SynchronizationHandler > sync_handler_
Definition: communication_layer.cpp:84
@ kSynchronizationMessage
static std::pair< std::unique_ptr< DummyTransport >, std::unique_ptr< DummyTransport > > MakeTransportPair()
Definition: dummy_transport.cpp:37
MessageHandler & GetMessageHandler(std::size_t party_id, MessageType type)
Definition: communication_layer.cpp:434
void Start()
Definition: communication_layer.cpp:281
void initialize(std::size_t my_id, std::size_t number_of_parties)
bool VerifyMessageBuffer(flatbuffers::Verifier &verifier)
Definition: message_generated.h:154
void RegisterMessageHandler(MessageHandlerFunction, const std::vector< MessageType > &message_types)
Definition: communication_layer.cpp:393
std::unordered_map< MessageType, std::shared_ptr< MessageHandler > > MessageHandlerMap
Definition: communication_layer.cpp:79
std::vector< std::unique_ptr< CommunicationLayer > > MakeDummyCommunicationLayers(std::size_t number_of_parties)
Definition: communication_layer.cpp:503
Definition: tcp_transport.h:69
std::shared_future< void > start_sfuture_
Definition: communication_layer.cpp:66
CommunicationLayerImplementation(std::size_t my_id, std::vector< std::unique_ptr< Transport >> &&transports, std::shared_ptr< Logger > logger)
Definition: communication_layer.cpp:89
std::shared_ptr< Logger > logger_
Definition: communication_layer.cpp:86
std::shared_mutex message_handlers_mutex_
Definition: communication_layer.cpp:80
std::size_t GetNumberOfParties() const
Definition: communication_layer.h:65
std::atomic< bool > continue_communication_
Definition: communication_layer.cpp:67
std::vector< TcpConnectionConfiguration > TcpPartiesConfiguration
Definition: tcp_transport.h:62
std::size_t number_of_parties_
Definition: communication_layer.cpp:63
std::vector< TransportStatistics > GetTransportStatistics() const noexcept
Definition: communication_layer.cpp:482
Definition: algorithm_description.cpp:35
void Shutdown()
Definition: communication_layer.cpp:467
void ReceiveTask(std::size_t party_id)
Definition: communication_layer.cpp:151
void BroadcastMessage(std::vector< std::uint8_t > &&message)
Definition: communication_layer.cpp:353
void SendMessage(std::size_t party_id, std::vector< std::uint8_t > &&message)
Definition: communication_layer.cpp:331
std::size_t GetMyId() const
Definition: communication_layer.h:66
Definition: pooled_work_stealing.hpp:35
std::vector< std::unique_ptr< Transport > > transports_
Definition: communication_layer.cpp:69
Definition: message_handler.h:38
Definition: communication_layer.h:58
const char * EnumNameMessageType(MessageType e)
Definition: message_generated.h:76
flatbuffers::FlatBufferBuilder BuildMessage(MessageType message_type, const std::vector< uint8_t > *payload)
Definition: message.cpp:32
std::variant< std::vector< std::uint8_t >, std::shared_ptr< const std::vector< std::uint8_t > >> message_t
Definition: communication_layer.cpp:73
MessageHandler & GetFallbackMessageHandler(std::size_t party_id)
Definition: communication_layer.cpp:460
constexpr bool kDebug
Definition: config.h:36
MessageType
Definition: message_generated.h:16
void DeregisterMessageHandler(const std::vector< MessageType > &message_types)
Definition: communication_layer.cpp:414
std::vector< std::thread > send_threads_
Definition: communication_layer.cpp:77
std::function< std::shared_ptr< MessageHandler >(std::size_t party_id)> MessageHandlerFunction
Definition: communication_layer.h:86
std::vector< std::unique_ptr< Transport > > SetupConnections()
Definition: tcp_transport.cpp:203
void SetLogger(std::shared_ptr< Logger > logger)
Definition: communication_layer.cpp:494
void SendTask(std::size_t party_id)
Definition: communication_layer.cpp:115