changeset 1142:73b8246fbe5b

Use schedule_callback() instead of addCallback() for functions relying on the program counter.
author Marcel Keller <mkeller@cs.au.dk>
date Mon, 23 Feb 2009 14:04:15 +0100
parents 4bacbff2e79f
children 4506ca5dbf70
files viff/aes.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/viff/aes.py	Thu Feb 19 16:22:15 2009 +0100
+++ b/viff/aes.py	Mon Feb 23 14:04:15 2009 +0100
@@ -136,8 +136,8 @@
             if (c_opened == 0):
                 r_trial = self.runtime.prss_share_random(GF256)
                 c_trial = self.runtime.open((byte + b) * r_trial)
-                c_trial.addCallback(get_masked_byte, r_trial,
-                                    c, r, byte)
+                self.runtime.schedule_callback(c_trial, get_masked_byte,
+                                               r_trial, c, r, byte)
             else:
                 r_related.addCallback(r.callback)
                 c.callback(~c_opened)
@@ -375,9 +375,11 @@
                 get_last(state).addCallback(progress, i, time.time())
 
                 if (i < self.rounds - 1):
-                    get_trigger(state).addCallback(round, state, i + 1)
+                    self.runtime.schedule_callback(get_trigger(state),
+                                                   round, state, i + 1)
                 else:
-                    get_trigger(state).addCallback(final_round, state)
+                    self.runtime.schedule_callback(get_trigger(state),
+                                                   final_round, state)
 
             prep_progress(i, start_round)