changeset 1572:54f02cd75714

BeDOZa: Improved comments.
author Thomas P Jakobsen <tpj@cs.au.dk>
date Mon, 04 Oct 2010 10:58:23 +0200
parents cb800e02f5bd
children d2d8fda44084
files viff/bedoza/share.py viff/bedoza/zero_knowledge.py
diffstat 2 files changed, 19 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/viff/bedoza/share.py	Mon Oct 04 10:27:01 2010 +0200
+++ b/viff/bedoza/share.py	Mon Oct 04 10:58:23 2010 +0200
@@ -21,11 +21,19 @@
 from viff.bedoza.util import _convolute
 
 def generate_partial_share_contents(field_elements, runtime, paillier):
-    """Each party input a list of field elements *field_elements*.
-    The value of the field elements are encrypted and the encrypted
-    values are exchanged.
+    """Protocol for generating partial shares.
 
-    Returns a deferred, which yields a list of PartialShareContents.  
+    This protocol corresponds to the "Share" protocol in the document
+    "A new On- and Off-line Phase for MPC".
+
+    Each party inputs a list of field elements *field_elements*. The
+    values of the field elements are encrypted, the encrypted values
+    are exchanged, and for each player, a zero-knowledge proof is
+    carried out, proving that each player knows the plaintexts
+    corresponding to the ciphertexts, he broadcasts, and that the
+    plaintexts are of limited size.
+
+    Returns a deferred, which yields a list of PartialShareContents.
     """
     
     runtime.increment_pc()
--- a/viff/bedoza/zero_knowledge.py	Mon Oct 04 10:27:01 2010 +0200
+++ b/viff/bedoza/zero_knowledge.py	Mon Oct 04 10:58:23 2010 +0200
@@ -23,12 +23,13 @@
 from viff.bedoza.util import rand_int_signed
 
 class ZKProof(object):
-    """Protocol proving that a player's plaintexts are of limited size.
-    
-    This is a zero-knowledge protocol in which player with prover_id
-    inputs s ciphertexts c[i] = E(x[j], r[j]), i = 1, ..., s, created
-    using the modified Paillier cipher and proves to the other players
-    that the x[i]'s are of limited size, e.g. that abs(x[i]) <= 2**k.
+    """Zero-knowledge protocol used as part of the Share protocol.
+
+    In this proof, a player (the player with id prover_id) inputs s
+    ciphertexts c[i] = E(x[j], r[j]), for i = 1, ..., s, created using
+    the modified Paillier cipher and proves to the other players that
+    he knows the plaintexts x[j] and that the x[i]'s are of limited
+    size, e.g. that abs(x[i]) <= 2**k.
     """
     
     def __init__(self, s, prover_id, k, runtime, c, random=None, paillier=None, x=None, r=None):