MultiPartyConfig#
- class MultiPartyConfig#
A configuration of the Multi-Party setup via various parameters.
- property aggregator_id#
The ID of the aggregator (see MultiPartyRole::MP_AGGREGATOR).
- property initiator_id#
The IDs of the key-owners (see MultiPartyRole::MP_KEY_OWNER).
- is_aggregator(self: pyhelayers.MultiPartyConfig) bool #
Whether this participant is the aggregator (see MultiPartyRole::MP_AGGREGATOR).
- Return type:
boolean.
- is_id_key_owner(self: pyhelayers.MultiPartyConfig, id: int) bool #
Whether the given ID is an ID of a key-owner (seeMultiPartyRole::MP_KEY_OWNER).
- Parameters:
id (int.) – The ID to check.
- Return type:
boolean.
- is_initiator(self: pyhelayers.MultiPartyConfig) bool #
Whether this participant is the initiator (see MultiPartyRole::MP_INITIATOR).
- Return type:
boolean.
- is_key_owner(self: pyhelayers.MultiPartyConfig) bool #
Whether this participant is a key-owner (see MultiPartyRole::MP_KEY_OWNER).
- Return type:
boolean.
- property key_owners_ids#
The IDs of the key-owners (see MultiPartyRole::MP_KEY_OWNER).
- num_key_owners(self: pyhelayers.MultiPartyConfig) int #
Returns the number of key-owners (see MultiPartyRole::MP_KEY_OWNER).
- Return type:
int.
- property participant_id#
Id of this participant.
-
class MultiPartyConfig : public helayers::SaveableBasic#
A configuration of the Multi-Party setup via various parameters.
Public Functions
-
int32_t numKeyOwners() const#
Returns the number of key-owners (see MultiPartyRole::MP_KEY_OWNER).
-
bool isKeyOwner() const#
Whether this participant is a key-owner (see MultiPartyRole::MP_KEY_OWNER).
-
bool isInitiator() const#
Whether this participant is the initiator (see MultiPartyRole::MP_INITIATOR).
-
bool isAggregator() const#
Whether this participant is the aggregator (see MultiPartyRole::MP_AGGREGATOR).
-
bool isIdKeyOwner(int32_t id) const#
Whether the given ID is an ID of a key-owner (seeMultiPartyRole::MP_KEY_OWNER).
-
void toJson(JsonWrapper &jw, const std::string &prefix = "") const#
Populates the content of this object into a JSON wrapper.
- Parameters:
jw – The JSON wrapper to populate.
prefix – An optional prefix. Attributes will be written as a sub-tree under this given prefix.
-
void fromJson(const JsonWrapper &jw, const std::string &prefix = "")#
Populates this object from a JSON wrapper.
- Parameters:
jw – The JSON wrapper to populate from.
prefix – An optional prefix. Attributes will be taken from a sub-tree under this given prefix.
-
virtual std::streamoff save(std::ostream &stream) const override#
Saves this object to a stream in binary form.
Returns the number of bytes written to the output stream.
- Parameters:
stream – [in] output stream to write to
-
virtual std::streamoff load(std::istream &stream) override#
Loads this object from the given stream.
Returns the number of bytes read from the input stream.
- Parameters:
stream – [in] input stream to read from
-
virtual void debugPrint(const std::string &title = "", Verbosity verbosity = VERBOSITY_REGULAR, std::ostream &out = std::cout) const override#
Prints the content of this object.
- Parameters:
title – Text to add to the print
verbosity – Verbosity level
out – Output stream
Public Members
-
int32_t participantId = MultiPartyConfig::emptyParticipantId#
Id of this participant.
-
std::vector<int32_t> keyOwnersIds#
The IDs of the key-owners (see MultiPartyRole::MP_KEY_OWNER).
-
int32_t initiatorId#
The ID of the initiator (see MultiPartyRole::MP_INITIATOR).
-
int32_t aggregatorId#
The ID of the aggregator (see MultiPartyRole::MP_AGGREGATOR).
Public Static Attributes
-
static const int32_t emptyParticipantId = -1#
Friends
-
friend bool operator==(const MultiPartyConfig &mkc1, const MultiPartyConfig &mkc2)#
-
int32_t numKeyOwners() const#