Package viff :: Module config
[hide private]
[frames] | no frames]

Module config

source code

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.

Classes [hide private]
  Player
Wrapper for information about a player in the protocol.
Functions [hide private]
 
load_config(source)
Load a player configuration file.
source code
 
generate_configs(n, t, keysize=1024, addresses=None, prefix=None, skip_prss=False)
Generate player configurations.
source code
Function Details [hide private]

load_config(source)

source code 

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.

generate_configs(n, t, keysize=1024, addresses=None, prefix=None, skip_prss=False)

source code 

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.