Mikkel Krøigård <[EMAIL PROTECTED]> writes:

>> Tomas is right, of course. For the passive case, using the first
>> 2t+1 players always works, and for the active case, we do not use
>> the local-multiply-and-reshare method anyway.
>
> The thing is, I always just assumed that we always used the same set
> of shares, and it is kind of easy to miss if you just read quickly
> through it - it says what you expect. I guess that's why we all
> missed it until now.

When I wrote the code (we're talking about this method in Runtime:

    @increment_pc
    def _recombine(self, shares, threshold):
        """Shamir recombine a list of deferred (id,share) pairs."""
        assert len(shares) > threshold

        def filter_good_shares(results):
            # Filter results, which is a list of (success, share)
            # pairs.
            return [result[1] for result in results
                    if result is not None and result[0]][:threshold+1]

The list comprehension above will return the t+1 first shares to
arrive.

        result = ShareList(shares, threshold+1)
        result.addCallback(filter_good_shares)
        result.addCallback(shamir.recombine)
        return result

) I figured that it would be okay to recombine any subset of site t+1
shares... which is normally true, except for the multiplication
protocol. Ups! :-)

Changing the protocol so that only a designated subset of the players
broadcast their shares ought to make it a bit faster too (in addition
to correct).

> The unit tests should not be hardcoded to n=3, t=1 as they are now,
> because that's why we never found the problem in the first place. I
> can rewrite the unit tests to the general setting. It needs to be
> done.

That is why I committed a bunch of tests last night -- you can see the
failed tests here:

  
http://buildbot.viff.dk/builders/linux-py2.4/builds/30/steps/trial/logs/problems

As we know by now, * and <= fails when n != 3t + 1.

My idea is that we should have unit tests which target one thing only:
The tests using BinaryOperatorTestCase targets coercion between plain
integers, field elements, and Share objects. The tests in
test_thresholds.py target different thresholds.

We can also have some bigger tests which tests multiple things, and
the application tests in test_apps are examples of this. I would like
to see more such application tests -- they will help us avoid breaking
our example applications without noticing (as has happened before).

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.
_______________________________________________
viff-devel mailing list (http://viff.dk/)
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk

Reply via email to