[viff-devel] [PATCH 03 of 12] Implementation of the open command
Martin Geisler
mg at lazybytes.net
Fri Jun 19 08:48:55 PDT 2009
Janus Dam Nielsen <janus.nielsen at alexandra.dk> writes:
> + @increment_pc
> + def open(self, share, receivers=None, threshold=None):
> + """Share reconstruction.
> +
> + Every parti broadcasts a share pair (x_{i}^{'}, rho_{x,i}^{'}).
Typo: "parti" -> "party". Also, the prime (') should not be put as a
superscript in LaTeX.
> +
> + The parties compute the sums x^{'}, rho_{x}^{'} and
> + check Com_{ck}(x^{'},rho_{x}^{'} = C_{x}.
> +
> + If yes, output x = x^{'}, else output x = _|_.
Heh, I though it was only in Haskell that they write the bottom symbol
like that... :-) You really mean "else return :const:`None`", right?
> + """
> + assert isinstance(share, Share)
> + # all players receive result by default
> + if receivers is None:
> + receivers = self.players.keys()
> + assert threshold is None
> + threshold = self.num_players - 1
> +
> + def recombine_value(shares, Cx):
> + x = share.field(0)
> + rho1 = share.field(0)
> + rho2 = share.field(0)
Due to automagic coercion you can actually initialize the values to 0.
> + for xi, (rhoi1, rhoi2), c in shares:
> + x += xi
> + rho1 += rhoi1
> + rho2 += rhoi2
> + assert c is None, "A commitment is found."
> + return self.check_commitment(x, (rho1, rho2), Cx)
--
Martin Geisler
VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.viff.dk/pipermail/viff-devel-viff.dk/attachments/20090619/f30f22f2/attachment.pgp>
More information about the viff-devel
mailing list