Protocol#

class Protocol#

A Protocol for Multi-Party operations between multiple parties.

execute_next_round(self: pyhelayers.Protocol, output_messages: std::vector<helayers::ProtocolMessage, std::allocator<helayers::ProtocolMessage> >, input_messages: std::vector<helayers::ProtocolMessage, std::allocator<helayers::ProtocolMessage> >) bool#

Execute the next round of this protocol and generate output messages for the next round for all parties.

Parameters:
  • output_messages (Vector of ProtocolMessage objects.) – The output messages of the round.

  • input_messages (Vector of ProtocolMessage objects.) – The input messages for the round.

Returns:

A boolean value indicates whether the protocol received all the needed messages to execute the next round successfully.

Return type:

bool.

Raises:

RuntimeError – if the given input messages are not valid.

get_current_round(self: pyhelayers.Protocol) int#
Returns:

Returns the current round number.

Return type:

int.

get_protocol_type(self: pyhelayers.Protocol) pyhelayers.ProtocolType#
Returns:

Returns the protocol type of this protocol.

Return type:

ProtocolType.

get_roles(self: pyhelayers.Protocol) std::set<helayers::MultiPartyRole, std::less<helayers::MultiPartyRole>, std::allocator<helayers::MultiPartyRole> >#
Returns:

Returns the roles in the protocol of the current participant.

Return type:

Set of integers.

get_total_number_of_rounds(self: pyhelayers.Protocol) int#
Returns:

Returns the total number of rounds in the protocol.

Return type:

int.

is_input_message_valid_for_current_round(self: pyhelayers.Protocol, input_message: helayers::ProtocolMessage) bool#
Parameters:

input_message (ProtocolMessage.) – The input message to check.

Returns:

Returns true if the given message is a valid input message for the current round (e.g., that the destination role of the message matches the role of the current participant).

Return type:

bool.

is_role(self: pyhelayers.Protocol, role: pyhelayers.MultiPartyRole) bool#
Parameters:

role (MultiPartyRole.) – The role to check.

Returns:

Return true if the current participant has the given role in the protocol.

Return type:

bool.

needs_another_round(self: pyhelayers.Protocol) bool#
Returns:

Returns true iff this protocol needs another round.

Return type:

bool.

reset_protocol(self: pyhelayers.Protocol) None#

Reset the protocol prior to another use.

set_verbosity(self: pyhelayers.Protocol, verbosity: pyhelayers.Verbosity) None#

Sets the verbosity level.

Parameters:

verbosity (Verbosity.) – The verbosity level.