viff

changeset 1318:70c995d31d1a

Merged.
author Marcel Keller <mkeller@cs.au.dk>
date Fri, 25 Sep 2009 20:30:05 +0200
parents d41aca4d7b6e fe84468a46ca
children 96e0f7de22b0
files viff/active.py viff/aes.py
diffstat 3 files changed, 18 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/apps/aes.py	Fri Sep 25 20:29:18 2009 +0200
     1.2 +++ b/apps/aes.py	Fri Sep 25 20:30:05 2009 +0200
     1.3 @@ -137,10 +137,20 @@
     1.4              max = 301
     1.5              js = [1 + i * 15 + j for i in range(20) for j in range(13)]
     1.6  
     1.7 -        pcs = [(2, 18, k) +  (max,) * i + (j, 1, 0)
     1.8 -               for k in range(1, options.count + 1)
     1.9 -               for i in range(10)
    1.10 -               for j in js]
    1.11 +        if options.exponentiation == 4:
    1.12 +            pcs = [(1, 2 + 130 * options.count + 141 * i + j, 1, 0)
    1.13 +                   for i in range(10 * options.count)
    1.14 +                   for j in range(140)] + \
    1.15 +                  [(2, 18, k) + (81,) * i + (2 + 4 * j, 3, l, 1, 0)
    1.16 +                   for k in range(1, options.count + 1)
    1.17 +                   for i in range(10)
    1.18 +                   for j in range(20)
    1.19 +                   for l in range(1, 7)]
    1.20 +        else:
    1.21 +            pcs = [(2, 18, k) + (max,) * i + (j, 1, 0)
    1.22 +                   for k in range(1, options.count + 1)
    1.23 +                   for i in range(10)
    1.24 +                   for j in js]
    1.25          program_desc[("generate_triples", (GF256,))] = pcs
    1.26  
    1.27      if options.exponentiation == 4:
     2.1 --- a/viff/active.py	Fri Sep 25 20:29:18 2009 +0200
     2.2 +++ b/viff/active.py	Fri Sep 25 20:30:05 2009 +0200
     2.3 @@ -515,7 +515,7 @@
     2.4          result = Share(self, share_x.field)
     2.5          # This is the Deferred we will do processing on.
     2.6          triple = self.get_triple(share_x.field)
     2.7 -        triple = self.schedule_complex_callback(triple, finish_mul)
     2.8 +        triple = self.schedule_callback(triple, finish_mul)
     2.9          # We add the result to the chains in triple.
    2.10          triple.chainDeferred(result)
    2.11          return result
     3.1 --- a/viff/aes.py	Fri Sep 25 20:29:18 2009 +0200
     3.2 +++ b/viff/aes.py	Fri Sep 25 20:30:05 2009 +0200
     3.3 @@ -169,14 +169,14 @@
     3.4  
     3.5          def open_and_exponentiate(random_powers):
     3.6              masked_byte = self.runtime.open(byte + random_powers[0])
     3.7 -            masked_powers = self.runtime.schedule_complex_callback(masked_byte,
     3.8 +            masked_powers = self.runtime.schedule_callback(masked_byte,
     3.9                  lambda masked_byte: self.runtime.powerchain(masked_byte, 7))
    3.10 -            return self.runtime.schedule_complex_callback(
    3.11 +            return self.runtime.schedule_callback(
    3.12                  masked_powers, add_and_multiply, random_powers)
    3.13  
    3.14          result = Share(self.runtime, GF256)
    3.15          self.runtime.prss_powerchain().chainDeferred(result)
    3.16 -        result = self.runtime.schedule_complex_callback(result, open_and_exponentiate)
    3.17 +        result = self.runtime.schedule_callback(result, open_and_exponentiate)
    3.18          return result
    3.19  
    3.20      def invert_by_exponentiation(self, byte):