Discussion:
[Fwd: [PATCH 1 of 1] Added computation-id option]
Marcel Keller
2010-08-04 12:28:21 UTC
Permalink
-------- Original Message --------
Subject: [PATCH 1 of 1] Added computation-id option
Date: Wed, 04 Aug 2010 12:17:43 -0000
From: Thomas P Jakobsen <***@cs.au.dk>
To: ***@cs.au.dk
CC: ***@cs.au.dk
References: <***@dhcp-11-67-32.daimi.au.dk>

# HG changeset patch
# User Tomas Toft <***@cs.au.dk>
# Date 1280227043 -7200
# Node ID 7c45463151f482ff75bbd877dad3509e8f9cb3c9
# Parent e7b2fe7eb75319e2f60cc292b0d68fe568d394ab
Added computation-id option.

This changeset adds a command line option to VIFF allowing users to
specify a computation id.

Prior to this changeset, any computation involving pseudo-random
secret sharing (which for the time being boils down to computations
done with the PassiveRuntime) could only be run one time using the
same set of VIFF player configuration files. If more than one
computation was executed with the same set of configuration files, the
security of the system would be broken.

With this changeset, multiple computations can be run securely with
the same set of configuration files as long as each computation is run
with a unique computation id.

diff -r e7b2fe7eb753 -r 7c45463151f4 viff/runtime.py
--- a/viff/runtime.py Thu Jul 29 15:58:52 2010 +0200
+++ b/viff/runtime.py Tue Jul 27 12:37:23 2010 +0200
@@ -536,6 +536,10 @@
"multiple times on the command line; the
first will "
"override host and port of player 1, the
second that "
"of player 2, and so forth.")
+ group.add_option("--computation-id", type="int", metavar="ID",
+ help="Set the (positive, integer) ID for this "
+ "computation. Must be unique to ensure "
+ "security.")

try:
# Using __import__ since we do not use the module, we are
@@ -551,7 +555,8 @@
deferred_debug=False,
profile=False,
track_memory=False,
- statistics=False)
+ statistics=False,
+ computation_id=None)

def __init__(self, player, threshold, options=None):
"""Initialize runtime.
@@ -585,7 +590,12 @@
self._needed_data = {}

#: Current program counter.
- self.program_counter = [0]
+ __comp_id = self.options.computation_id
+ if __comp_id is None:
+ __comp_id = 0
+ else:
+ assert __comp_id >0, "Non-positive ID: %d." % __comp_id
+ self.program_counter = [__comp_id, 0]

#: Connections to the other players.
#:

Loading...