changeset 857:f89875736767

Added prss_share_zero method to the Runtime class.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 30 Jul 2008 22:12:45 +0200
parents c2c1fcdd710c
children 2d2c641a2762
files viff/runtime.py
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/viff/runtime.py	Wed Jul 30 22:04:15 2008 +0200
+++ b/viff/runtime.py	Wed Jul 30 22:12:45 2008 +0200
@@ -40,7 +40,7 @@
 from collections import deque
 
 from viff import shamir
-from viff.prss import prss, prss_lsb
+from viff.prss import prss, prss_lsb, prss_zero
 from viff.field import GF256, FieldElement
 from viff.matrix import Matrix, hyper
 from viff.util import wrapper, rand
@@ -923,6 +923,19 @@
         return result
 
     @increment_pc
+    def prss_share_zero(self, field):
+        """Generate shares of the zero element from the field given.
+
+        Communication cost: none.
+        """
+        # Key used for PRSS.
+        prss_key = tuple(self.program_counter)
+        prfs = self.players[self.id].prfs(field.modulus)
+        zero_share = prss_zero(self.num_players, self.threshold, self.id,
+                               field, prfs, prss_key)
+        return Share(self, field, zero_share)
+
+    @increment_pc
     def prss_share_bit_double(self, field):
         """Share a random bit over *field* and GF256.