http://hg.viff.dk/viff/rev/4506ca5dbf70
changeset: 1143:4506ca5dbf70
user:      Marcel Keller <mkel...@cs.au.dk>
date:      Mon Feb 23 17:22:30 2009 +0100
summary:   Trigger next AES round on the whole state, not only on the last byte.

diffstat:

1 file changed, 8 insertions(+), 11 deletions(-)
viff/aes.py |   19 ++++++++-----------

diffs (48 lines):

diff -r 73b8246fbe5b -r 4506ca5dbf70 viff/aes.py
--- a/viff/aes.py       Mon Feb 23 14:04:15 2009 +0100
+++ b/viff/aes.py       Mon Feb 23 17:22:30 2009 +0100
@@ -358,10 +358,7 @@
         prep_progress(0, start)
 
         def get_trigger(state):
-            return state[3][self.n_b-1]
-
-        def get_last(state):
-            return state[3][self.n_b-1]
+            return gather_shares(reduce(operator.add, state))
 
         def round(_, state, i):
             start_round = time.time()
@@ -372,14 +369,13 @@
             self.add_round_key(state, expanded_key[i*self.n_b:(i+1)*self.n_b])
 
             if (not prepare_at_once):
-                get_last(state).addCallback(progress, i, time.time())
+                trigger = get_trigger(state)
+                trigger.addCallback(progress, i, time.time())
 
                 if (i < self.rounds - 1):
-                    self.runtime.schedule_callback(get_trigger(state),
-                                                   round, state, i + 1)
+                    self.runtime.schedule_callback(trigger, round, state, i + 
1)
                 else:
-                    self.runtime.schedule_callback(get_trigger(state),
-                                                   final_round, state)
+                    self.runtime.schedule_callback(trigger, final_round, state)
 
             prep_progress(i, start_round)
 
@@ -392,10 +388,11 @@
             self.shift_row(state)
             self.add_round_key(state, expanded_key[self.rounds*self.n_b:])
 
-            get_last(state).addCallback(progress, self.rounds, time.time())
+            trigger = get_trigger(state)
+            trigger.addCallback(progress, self.rounds, time.time())
 
             if (benchmark):
-                get_trigger(state).addCallback(finish, state)
+                trigger.addCallback(finish, state)
 
             # connect to final result
             for a, b in zip(reduce(operator.add, zip(*state)), result):
_______________________________________________
viff-commits mailing list
viff-commits@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk

Reply via email to