http://hg.viff.dk/viff/rev/c47c7f119808
changeset: 1135:c47c7f119808
user: Marcel Keller <[email protected]>
date: Tue Feb 17 10:55:15 2009 +0100
summary: Use finish() only to print benchmark results.
diffstat:
1 file changed, 9 insertions(+), 9 deletions(-)
viff/aes.py | 18 +++++++++---------
diffs (41 lines):
diff -r 56d259ed2a3d -r c47c7f119808 viff/aes.py
--- a/viff/aes.py Mon Feb 16 19:32:31 2009 +0100
+++ b/viff/aes.py Tue Feb 17 10:55:15 2009 +0100
@@ -21,6 +21,7 @@
import time
+import operator
from viff.field import GF256
from viff.runtime import Share
@@ -350,21 +351,20 @@
get_last(state).addCallback(progress, self.rounds, time.time())
- get_trigger(state).addCallback(finish, state)
+ if (benchmark):
+ get_trigger(state).addCallback(finish, state)
+
+ # connect to final result
+ for a, b in zip(reduce(operator.add, zip(*state)), result):
+ a.addCallback(b.callback)
prep_progress(self.rounds, start_round)
return _
def finish(_, state):
- actual_result = [byte for word in zip(*state) for byte in word]
-
- for a, b in zip(actual_result, result):
- a.addCallback(b.callback)
-
- if (benchmark):
- print "Total preparation time: %f" % preparation
- print "Total communication time: %f" % communication
+ print "Total preparation time: %f" % preparation
+ print "Total communication time: %f" % communication
return _
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk