http://hg.viff.dk/viff/rev/87f37eb25159
changeset: 1132:87f37eb25159
user: Marcel Keller <[email protected]>
date: Thu Feb 12 20:05:39 2009 +0100
summary: Avoid unnecessary communication in invert_by_masking().
diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
viff/aes.py | 9 +++++++--
diffs (26 lines):
diff -r 50056a810951 -r 87f37eb25159 viff/aes.py
--- a/viff/aes.py Fri Jan 30 14:50:47 2009 +0100
+++ b/viff/aes.py Thu Feb 12 20:05:39 2009 +0100
@@ -23,7 +23,7 @@
import time
from viff.field import GF256
-from viff.runtime import Share
+from viff.runtime import Share, gather_shares
from viff.matrix import Matrix
@@ -131,7 +131,12 @@
c.callback(~c_opened)
get_masked_byte(0, None, c, r, byte)
- return c * r - b
+
+ # necessary to avoid communication in multiplication
+ # was: return c * r - b
+ result = gather_shares([c, r, b])
+ result.addCallback(lambda (c, r, b): c * r - b)
+ return result
def invert_by_exponentiation(byte):
byte_2 = byte * byte
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk