viff

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 diff
     1.1 --- a/viff/aes.py	Thu Feb 19 16:22:15 2009 +0100
     1.2 +++ b/viff/aes.py	Mon Feb 23 14:04:15 2009 +0100
     1.3 @@ -136,8 +136,8 @@
     1.4              if (c_opened == 0):
     1.5                  r_trial = self.runtime.prss_share_random(GF256)
     1.6                  c_trial = self.runtime.open((byte + b) * r_trial)
     1.7 -                c_trial.addCallback(get_masked_byte, r_trial,
     1.8 -                                    c, r, byte)
     1.9 +                self.runtime.schedule_callback(c_trial, get_masked_byte,
    1.10 +                                               r_trial, c, r, byte)
    1.11              else:
    1.12                  r_related.addCallback(r.callback)
    1.13                  c.callback(~c_opened)
    1.14 @@ -375,9 +375,11 @@
    1.15                  get_last(state).addCallback(progress, i, time.time())
    1.16  
    1.17                  if (i < self.rounds - 1):
    1.18 -                    get_trigger(state).addCallback(round, state, i + 1)
    1.19 +                    self.runtime.schedule_callback(get_trigger(state),
    1.20 +                                                   round, state, i + 1)
    1.21                  else:
    1.22 -                    get_trigger(state).addCallback(final_round, state)
    1.23 +                    self.runtime.schedule_callback(get_trigger(state),
    1.24 +                                                   final_round, state)
    1.25  
    1.26              prep_progress(i, start_round)
    1.27