cicada.przs module

Pseudorandom Zero-Sharing functionality.

class cicada.przs.PRZSProtocol(*, communicator, field, seed)[source]

Bases: object

Implements the Pseudorandom Zero-Sharing protocol of Cramer, Damgard, and Ishai.

Note

Creating the protocol is a collective operation that must be implemented by all players that are members of communicator.

Parameters:
  • communicator (cicada.communicator.interface.Communicator, required) – The communicator that this protocol will use for communication.

  • field (cicada.arithmetic.Field, required) – The field from which generated values will be drawn.

  • seed (int, optional) – Seed used to initialize random number generators. For privacy, this value should be different for each player.

__call__(*, shape)[source]

Generate an array of field values that sum to zero, using pseudorandom zero-sharing.

Note

This is a collective operation that must be called by all players that are members of communicator.

Parameters:

shape (tuple, required) – The shape of the result. Note that all players must specify the same shape.

Returns:

przs – The local share of zeros.

Return type:

numpy.ndarray

property communicator

The Communicator used by this protocol.

property field

The Field used by this protocol.