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 wrap: on
line diff
--- a/apps/aes.py	Fri Sep 25 20:29:18 2009 +0200
+++ b/apps/aes.py	Fri Sep 25 20:30:05 2009 +0200
@@ -137,10 +137,20 @@
             max = 301
             js = [1 + i * 15 + j for i in range(20) for j in range(13)]
 
-        pcs = [(2, 18, k) +  (max,) * i + (j, 1, 0)
-               for k in range(1, options.count + 1)
-               for i in range(10)
-               for j in js]
+        if options.exponentiation == 4:
+            pcs = [(1, 2 + 130 * options.count + 141 * i + j, 1, 0)
+                   for i in range(10 * options.count)
+                   for j in range(140)] + \
+                  [(2, 18, k) + (81,) * i + (2 + 4 * j, 3, l, 1, 0)
+                   for k in range(1, options.count + 1)
+                   for i in range(10)
+                   for j in range(20)
+                   for l in range(1, 7)]
+        else:
+            pcs = [(2, 18, k) + (max,) * i + (j, 1, 0)
+                   for k in range(1, options.count + 1)
+                   for i in range(10)
+                   for j in js]
         program_desc[("generate_triples", (GF256,))] = pcs
 
     if options.exponentiation == 4:
--- a/viff/active.py	Fri Sep 25 20:29:18 2009 +0200
+++ b/viff/active.py	Fri Sep 25 20:30:05 2009 +0200
@@ -515,7 +515,7 @@
         result = Share(self, share_x.field)
         # This is the Deferred we will do processing on.
         triple = self.get_triple(share_x.field)
-        triple = self.schedule_complex_callback(triple, finish_mul)
+        triple = self.schedule_callback(triple, finish_mul)
         # We add the result to the chains in triple.
         triple.chainDeferred(result)
         return result
--- a/viff/aes.py	Fri Sep 25 20:29:18 2009 +0200
+++ b/viff/aes.py	Fri Sep 25 20:30:05 2009 +0200
@@ -169,14 +169,14 @@
 
         def open_and_exponentiate(random_powers):
             masked_byte = self.runtime.open(byte + random_powers[0])
-            masked_powers = self.runtime.schedule_complex_callback(masked_byte,
+            masked_powers = self.runtime.schedule_callback(masked_byte,
                 lambda masked_byte: self.runtime.powerchain(masked_byte, 7))
-            return self.runtime.schedule_complex_callback(
+            return self.runtime.schedule_callback(
                 masked_powers, add_and_multiply, random_powers)
 
         result = Share(self.runtime, GF256)
         self.runtime.prss_powerchain().chainDeferred(result)
-        result = self.runtime.schedule_complex_callback(result, open_and_exponentiate)
+        result = self.runtime.schedule_callback(result, open_and_exponentiate)
         return result
 
     def invert_by_exponentiation(self, byte):