[viff-devel] FW: Bug in ViFF
Hoogh, S.J.A. de
S.J.A.d.Hoogh at tue.nl
Sun Oct 5 13:30:36 PDT 2008
Hi Martin,
Sorry for my sloppyness, I just didn't change the comments. My changed code doesn't derive an ordening it is just supposed to output (and maybe not in the most efficient way) the richest millionair.
Tomas and I looked at the code and we've come to the conclusion that this piece of the code doesn't reveal the bug, but the printed outputs of the opened shares of mi_gt_mj for 0<i<j<6. These should be booleans, but are not 0,1 valued when t is unequal to floor(n/2) and n odd. If n is even then no t seems to work.
Hopefully this clears things up,
Sincerely,
Sebastiaan
________________________________
Van: Martin Geisler [mailto:mg at daimi.au.dk]
Verzonden: vr 3-10-2008 9:36
Aan: Hoogh, S.J.A. de
CC: viff-devel at viff.dk
Onderwerp: Re: FW: Bug in ViFF
"Hoogh, S.J.A. de" <S.J.A.d.Hoogh at tue.nl> writes:
Hi Sebastiaan
I've looked at your code, and I don't understand the final part, the
one which is supposed to calculate the sorted order of the
millionaires:
# We can establish the correct order of Millionaires 2 and 3.
comparison = [5]
if m1_gt_m2 and m1_gt_m3 and m1_gt_m4 and m1_gt_m5:
comparison = [1]
elif not m1_gt_m2 and m2_gt_m3 and m2_gt_m4 and m2_gt_m5:
comparison = [2]
elif not m1_gt_m3 and not m2_gt_m3 and m3_gt_m4 and m3_gt_m5:
comparison = [3]
elif not m1_gt_m4 and not m2_gt_m4 and not m3_gt_m4 and m4_gt_m5:
comparison = [4]
The original code is here:
http://hg.viff.dk/viff/file/153c24a4a6c5/apps/millionaires.py#l115
and it works by ordering the numbers 1, 2, 3 by hand in the comparison
list: it first checks to see if 2 and 3 should be ordered [3, 2] or
[2, 3] and it then puts the number 1 into this list in the right spot.
The final output is thus something like this:
I am Millionaire 1 and I am worth 193 millions.
From poorest to richest:
Millionaire 3
Millionaire 2
Millionaire 1 (193 millions)
and I can understand why you don't get this output with your code.
--
Martin Geisler
VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.
More information about the viff-devel
mailing list