/rev/46ffe8878fbf
changeset: 1351:46ffe8878fbf
user: Janus Dam Nielsen <[email protected]>
date: Tue Oct 27 20:42:45 2009 +0100
summary: Orlandi:Replace sharelist with gather_share.
diffstat:
viff/orlandi.py | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
diffs (30 lines):
diff -r 43d0f2a811e1 -r 46ffe8878fbf viff/orlandi.py
--- a/viff/orlandi.py Tue Oct 27 20:24:26 2009 +0100
+++ b/viff/orlandi.py Tue Oct 27 20:42:45 2009 +0100
@@ -131,21 +131,13 @@
rhoi1 = self._expect_share(peer_id, field)
rhoi2 = self._expect_share(peer_id, field)
self._expect_data(peer_id, TEXT, Cx)
- sls = ShareList([xi, rhoi1, rhoi2, Cx])
+ sls = gather_shares([xi, rhoi1, rhoi2, Cx])
def combine(ls):
- expected_num = 4;
- if len(ls) is not expected_num:
- raise OrlandiException("Cannot share number, trying to create
a share,"
- " expected %s components got %s."
- % (expected_num, len(ls)))
- s1, xi = ls[0]
- s2, rhoi1 = ls[1]
- s3, rhoi2 = ls[2]
- s4, Cx = ls[3]
+ xi = ls[0]
+ rhoi1 = ls[1]
+ rhoi2 = ls[2]
+ Cx = ls[3]
Cxx = commitment.deserialize(Cx)
- if not (s1 and s2 and s3 and s4):
- raise OrlandiException("Cannot share number, trying to create
share,"
- " but a component did arrive properly.")
return OrlandiShare(self, field, xi, (rhoi1, rhoi2), Cxx)
sls.addCallbacks(combine, self.error_handler)
return sls
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk