viff

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 diff
     1.1 --- a/viff/runtime.py	Wed Jul 30 22:13:11 2008 +0200
     1.2 +++ b/viff/runtime.py	Wed Jul 30 22:45:19 2008 +0200
     1.3 @@ -936,6 +936,17 @@
     1.4          return Share(self, field, zero_share)
     1.5  
     1.6      @increment_pc
     1.7 +    def prss_double_share(self, field):
     1.8 +        """Make a double-sharing using PRSS.
     1.9 +
    1.10 +        The pair of shares will have degree t and 2t where t is the
    1.11 +        default threshold for the runtime.
    1.12 +        """
    1.13 +        r_t = self.prss_share_random(field)
    1.14 +        z_2t = self.prss_share_zero(field)
    1.15 +        return (r_t, r_t + z_2t)
    1.16 +
    1.17 +    @increment_pc
    1.18      def prss_share_bit_double(self, field):
    1.19          """Share a random bit over *field* and GF256.
    1.20