changeset 859:885a17b767ef

Added a prss_double_share method. This uses the prss_share_zero method to efficiently generate a pair of shares with degree t and 2t.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 30 Jul 2008 22:45:19 +0200
parents 2d2c641a2762
children b6ae408a0b4f
files viff/runtime.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/viff/runtime.py	Wed Jul 30 22:13:11 2008 +0200
+++ b/viff/runtime.py	Wed Jul 30 22:45:19 2008 +0200
@@ -936,6 +936,17 @@
         return Share(self, field, zero_share)
 
     @increment_pc
+    def prss_double_share(self, field):
+        """Make a double-sharing using PRSS.
+
+        The pair of shares will have degree t and 2t where t is the
+        default threshold for the runtime.
+        """
+        r_t = self.prss_share_random(field)
+        z_2t = self.prss_share_zero(field)
+        return (r_t, r_t + z_2t)
+
+    @increment_pc
     def prss_share_bit_double(self, field):
         """Share a random bit over *field* and GF256.