/rev/3a87b4d84eb6
changeset: 1342:3a87b4d84eb6
user: Marcel Keller <[email protected]>
date: Tue Oct 27 20:46:38 2009 +0100
summary: active: Transferred optimizations from PassiveRuntime.
diffstat:
viff/active.py | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diffs (29 lines):
diff -r 31a1534f6b77 -r 3a87b4d84eb6 viff/active.py
--- a/viff/active.py Tue Oct 27 20:45:20 2009 +0100
+++ b/viff/active.py Tue Oct 27 20:46:38 2009 +0100
@@ -474,19 +474,15 @@
Preprocessing: 1 multiplication triple.
Communication: 2 openings.
"""
- assert isinstance(share_x, Share) or isinstance(share_y, Share), \
- "At least one of share_x and share_y must be a Share."
+ assert isinstance(share_x, Share), \
+ "share_x must be a Share."
- if not isinstance(share_x, Share):
- # Then share_y must be a Share => local multiplication. We
- # clone first to avoid changing share_y.
- result = share_y.clone()
- result.addCallback(lambda y: share_x * y)
- return result
if not isinstance(share_y, Share):
- # Likewise when share_y is a constant.
+ # Local multiplication. share_x always is a Share by
+ # operator overloading in Share. We clone share_x first
+ # to avoid changing it.
result = share_x.clone()
- result.addCallback(lambda x: x * share_y)
+ result.addCallback(lambda x: share_y * x)
return result
# At this point both share_x and share_y must be Share
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk