secure_inner_join.player module
Code for the abstract player class to implement parties performing secure set intersection
- class secure_inner_join.player.Player(identifier, pool, data_parties=('alice', 'bob'), helper='henri')[source]
Bases:
ABC
Class for a player
- __init__(identifier, pool, data_parties=('alice', 'bob'), helper='henri')[source]
Initializes the database owner
- Parameters:
identifier (
str
) – identifier of the playerpool (
Pool
) – instance of tno.mpc.communication.Pooldata_parties (
Tuple
[str
,...
]) – identifiers of the data_partieshelper (
str
) – identifier of the helper
- static create_logger(name)[source]
Create logger for class
- Parameters:
name (
str
) – name of the logger- Return type:
Logger
- Returns:
logger object
- property data_parties: Tuple[str, ...]
The identifiers of all data parties (sorted alphabetically, and the same for each player).
- Returns:
A tuple containing the identifiers of all data parties.
- property data_parties_and_addresses: Tuple[Tuple[str, str | None, int | None], ...]
Tuples containing (identifier, address, port) of all data parties (sorted alphabetically on identifier, and the same for each player).
- Returns:
A tuple containing the identifiers, addresses, and ports of all data parties.
- property helper: str
The identifier of the helper party.
- Returns:
The identifier of the helper.
- property identifier: str
The identifier of this party.
- Returns:
The identifier of this party.
- abstract property intersection_size: int
Returns the size of the intersection of the identifier columns of all data parties.
- Returns:
The intersection size.
- async receive_message(party, msg_id=None)[source]
Receive a message from party with the given msg_id, if no msg_id is given the message with the lowest numerical id is selected.
- Parameters:
party (
str
) – Identifier of the party to receive message from.msg_id (
Optional
[str
]) – Optional identifier for the message.
- Return type:
Any
- Returns:
The received message contents.
- abstract async run_protocol()[source]
Runs the entire protocol, start to end, in an asynchronous manner.
- Return type:
None
- async send_message(receiver, payload, msg_id=None)[source]
Sends the given payload to the receiver with the given msg_id.
- Parameters:
receiver (
str
) – Identifier of the party to send the message to.payload (
Any
) – Data to send.msg_id (
Optional
[str
]) – Optional identifier for the message.
- Return type:
None