Config Module

Functions for loading and saving player configurations. Each player participating in a protocol execution must know some information about the other players, namely their hostname and port number. The player also needs to know something about itself, namely the keys used for pseudo-random secret sharing (PRSS).

The Player class encapsulates this information. Generating a player configuration is done using the generate_configs() function. The generate_config_files.py script uses that function to generate a player config and save it in a number of .ini files. Such a .ini file can be loaded with the load_config() function.

class viff.config.Player(id, host, port, pubkey, seckey=None, keys=None, dealer_keys=None)

Wrapper for information about a player in the protocol.

id
host
port

ID, hostname, and portnumber of the player.

dealer_prfs(modulus)

Retrieve dealer PRSS PRFs.

The pseudo-random functions are used when this player is the dealer in a pseudo-random secret sharing.

Return a mapping from player subsets to viff.prss.PRF instances.

prfs(modulus)

Retrieve PRSS PRFs.

The pseudo-random functions are used when this player is part of a pseudo-random secret sharing for sharing an element random to all players.

Return a mapping from player subsets to viff.prss.PRF instances.

viff.config.generate_configs(n, t, paillier=<viff.paillierutil.ViffPaillier instance at 0x44165a8>, addresses=None, prefix=None, skip_prss=False)

Generate player configurations.

Generates n configuration objects with a threshold of t. The addresses is an optional list of (host, port) pairs and prefix is a filename prefix. One can avoid generating keys for PRSS by setting skip_prss to True. This is useful when the number of players is large.

The configurations are returned as ConfigObj instances and can be saved to disk if desired.

Returns a mapping from player ID to player configuration.

viff.config.load_config(source)

Load a player configuration file.

Configuration files are simple INI-files containing information (hostname and port number) about the other players in the protocol.

One of the players own the config file and for this player additional information on PRSS keys is available.

Returns the owner ID and a mapping of player IDs to Player instances.

Previous topic

PRSS Module

Next topic

AES Module

This Page