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

Return type

Type[SecureFixedPoint]

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 data_parties: Tuple[str, str]

The identifiers of data parties involved in the protocol

Return type

Tuple[str, str]

Returns

a collection of data parties

property helper: str

The identifier of the helper party

Return type

str

Returns

the identifier of the helper party

property identifier: str

Identifier of this instance

Return type

str

Returns

the identifier of this instance

async obtain_secret_sharing_additively_shared_database()[source]

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

Return type

None

async obtain_secret_sharing_factors()[source]

Method to obtain Shamir secret sharings of factors needed in the secure computation of the log-rank statistic.

These factors are pre-computed by Alice, leveraging her locally available information.

Return type

None

async obtain_secret_sharings()[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

Return type

str

Returns

the identifier of Alice

property party_B: str

The identifier of party Bob

Return type

str

Returns

the identifier of Bob

async run_mpyc()[source]

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

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

property share: ndarray[FixedPoint]

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

Return type

ndarray[FixedPoint]

Returns

additive share

Raises

ValueError – raised when sharing is not set

async start_protocol()[source]

Starts and runs the protocol

Raises

NotImplementedError – raised when it is called but not implemented

Return type

None