kaplan_meier.player module

Module implements the base player class.

class kaplan_meier.player.MPCProtocolMetadata(data_parties=<factory>, _secfxp=None)[source]

Bases: object

This class contains some metadata that relates to the part of the protocol that relies on the MPyC framework.

data_parties: list[Party]
property secfxp: type[SecureFixedPoint]

Type of SecureFixedPoint that we use throughout the protocol

Returns:

SecureFixedPoint object

Raises:

ValueError – raised when object has not yet been set

class kaplan_meier.player.Player(identifier, party_A='alice', party_B='bob', helper='helper')[source]

Bases: object

This class is the base class for players

__init__(identifier, party_A='alice', party_B='bob', helper='helper')[source]

Initializes player

Parameters:
  • identifier (str) – (unique) name of the player

  • party_A (str) – identifier of party Alice

  • party_B (str) – identifier of party Bob

  • helper (str) – identifier of the helper party

property additive_share: ndarray[FixedPoint]

Additive share used as an input for the Shamir secret sharing part of the protocol.

Returns:

additive share

Raises:

ValueError – raised when sharing is not set

property data_parties: tuple[str, str]

The identifiers of data parties involved in the protocol

Returns:

a collection of data parties

property helper: str

The identifier of the helper party

Returns:

the identifier of the helper party

property identifier: str

Identifier of this instance

Returns:

the identifier of this instance

async obtain_secret_shared_logrank_input()[source]

Method to obtain Shamir secret sharings of the results of the homomorphic encryption part of the protocol.

Return type:

None

property party_A: str

The identifier of party Alice

Returns:

the identifier of Alice

property party_B: str

The identifier of party Bob

Returns:

the identifier of Bob

async run_mpyc_logrank_test()[source]

Runs the Shamir secret sharing part of the protocol using the MPyC framework

Return type:

None

async run_protocol()[source]

Starts and runs the protocol

Raises:

NotImplementedError – raised when it is called but not implemented

Return type:

None

async secure_multivariate_log_rank_test()[source]

Computes the multivariate log rank statistics on the shares.

Raises:

ValueError – raised when there are no shares available yet

Return type:

None