Janus Dam Nielsen <[EMAIL PROTECTED]> writes:

> Does it make sense to run all unit tests with the same configuations
> of players and thresholds. That is, for all protocols p, is p
> executed with x players and threshold t is p welldefined?

Well, no, not in general. If you write a protocol for seven people
Shamir sharing would look like this in VIFF:

  a, b, c, d, e, f, g = rt.shamir_share(range(1, 8), input)

and that breaks down (I guess quite spectacularly...) when you run it
with fewer than seven players.

I think Thomas wants us to write protocols that are generic in the
sense that they don't assume a particular number of players. So the
above line becomes:

  shares = rt.shamir_share(range(1, len(rt.players)+1), input)

If the next step is to add all inputs, then this is easily changed
from

  sum = a + b + c + d + e + f + g

to

  import operator
  sum = reduce(operator.add, shares)

which works any number of shares.

So it is only carefully written protocols that can be adapted like
that. Examples could be:

* Find the minimum input, the median input, the sum, or the average.

* Sort the inputs (using a simple bubble-sort or similar). The Yao
  millionaires example already sorts three elements via three
  comparisons.

-- 
Martin Geisler
_______________________________________________
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk

Reply via email to