Re: [viff-devel] Equality protocol : error

2010-04-08 Thread Sigurd Torkel Meldgaard
I know this is talking around the problem but:

For very small moduli like yours, another protocol for equality is
actually simpler, better (no risk of failing) and faster (I guess):

raise (a-b) to n-1 (with square and multiply), and if this difference
was 0 you will get 0, otherwise you will get 1 (good old fermat), this
result can be subtracted from 1, to turn the bit correctly.

I actually coded this once, but for some reason I never got to put it into Viff

I have attached a patch you can try to apply (use hg qimport
fermatequality, hg qpush), and play with for now.

I will try to look into the real bug later.

The best

On Thu, Apr 8, 2010 at 11:34 PM, Marcel Keller wrote:
 Hi Jonathan,

 I can't reproduce the error here. Can you send me your config files? The
 error might be triggered by certain random numbers, which depend on the PRSS
 keys. By the way, the error message is about the same every time something
 goes wrong in a callback. This is because VIFF does not define errbacks. To
 get a little bit more meaningful output, you can use the --deferred-debug

 Best regards,

Description: Binary data
viff-devel mailing list (

Re: [viff-devel] viff 0.7.1 question

2009-10-21 Thread Sigurd Torkel Meldgaard

 I hope this question is not a bother to you.

No, not at all

 I was trying to test viff-0.7.1, as I executed, I 
 got the error ¨ImportError: No module named viff.config¨. Im not sure how to 
 fix this problem.

Most likely viff is not yet on your PYTHONPATH

Please read:
for instructions on how to get it there.

On Tue, Oct 20, 2009 at 2:27 PM, Angel Redoble wrote:

 Im using ubuntu 9.04.

 Thanks a lot.

 viff-devel mailing list (

viff-devel mailing list (

Re: [viff-devel] Commit messages

2009-10-19 Thread Sigurd Torkel Meldgaard
On Mon, Oct 19, 2009 at 2:14 PM, Janus Dam Nielsen wrote:
 I like it.
 On 19/10/2009, at 13.55, Martin Geisler wrote:

Me too, and it should be documented by a line or two in the developer
guide-lines, so it can be looked up.

 Hi guys,

 I made a bunch of cleanup commits two days ago, and for those I used a
 new style for the commit messages:

  topic: summary (max 68 characters)

  bigger description

 You can see it here:

 I think it makes it easier to quickly see if a commit is related to the
 AES code, the Orlandi runtime, etc.

 Please let me know if you like it or not and if you think we should
 switch to this style from now on.

 Martin Geisler

 VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
 SMPC (Secure Multiparty Computation) to Python. See:
 viff-devel mailing list (

 Janus Dam Nielsen
 Research and Innovationspecialist, PhD.
 T +45 42 22 93 56

 viff-devel mailing list (

viff-devel mailing list (

Re: [viff-devel] Importing shares into VIFF

2009-03-25 Thread Sigurd Torkel Meldgaard
The simple_share_value needs to be converted to a field-element
(reduced modulo P)

m = Share(runtime, Zp, Zp(simple_share_value))

Should work

- Sigurd

On Wed, Mar 25, 2009 at 1:55 PM, Håvard Vegge wrote:

 In my quest for using VIFF in a web application scenario, I have created
 three simple shares (positive integers) and stored them in a database. How
 do I import these shares into VIFF?

 m = Share(runtime, Zp, simple_share_value)

 I tried something like the code above, by I get a lot of errors, part of it
 self.sendData(program_counter, share, share.value)
 exceptions.AttributeError: 'long' object has no attribute 'value'

 So, what is wrong and how do I fix it?
 I've kind of solved it by using some of Tord's ninja tricks, but I think
 what I'm trying to do really is quite simple.

 Best regards, Håvard
 viff-devel mailing list (

viff-devel mailing list (

[viff-devel] The best simulator for P2P-protocols

2008-12-27 Thread Sigurd Torkel Meldgaard
I just saw this on reddit - we might like to look into some of the
mentioned tools:
viff-devel mailing list (

[viff-devel] Benchmarks on a mac

2008-12-10 Thread Sigurd Torkel Meldgaard
Here is a transcript of my profiling run.

I disabled ssl, because I had some trouble with the keys, hope that
does not matter too much.

sigurdmeldgaard$ python --profile --no-ssl -c 1 player-1.ini
Seeding random generator with random seed 9520
Using field elements (65 bit modulus)
I am player 1, will mul 1 numbers
Using the base runtime: viff.passive.PassiveRuntime.
Not using SSL
Listening on port 9000
Will connect to Player 2: camel13:9001
Will connect to Player 3: camel14:9002
 Starting reactor ###
Starting reactor with profiling
Need no preprocessing
Runtime ready, generating shares
Synchronizing test start.
Starting test in 3
Starting test in 2
Starting test in 1
Starting test now

Started parallel test

Total time used: 21.186 sec
Time per parallel test operation: 2 ms
Synchronizing shutdown...  done.
Closing connections...  done.
Stopping reactor...  done.
Loading profiling statistics... done.

 2176272 function calls (1852904 primitive calls) in 33.202 CPU seconds

   Ordered by: internal time, call count
   List reduced from 207 to 40 due to restriction 40

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  366   20.9230.057   26.6800.073
90013   1.0700.0001.3150.000
  307   0.9710.0035.6750.018
6   0.7720.0000.9040.000
16668   0.5550.0002.1890.000
   260039   0.4780.0000.4780.000
33340   0.3600.0000.8330.000
20004   0.3480.0001.8110.000
8   0.3370.0004.6550.000
80004   0.2970.0000.4080.000
6   0.2700.0001.3980.000
70021/46678 0.2530.0004.3540.000
1   0.2260.0000.6050.000
33342   0.2040.0000.2900.000
1   0.1870.0004.7900.000
70021/46678 0.1800.0004.4770.000
70010   0.1740.0000.3630.000
2   0.1670.0001.6700.000
80006/70004 0.1670.0001.3370.000
30002   0.1530.0007.9910.000
23336   0.1440.0000.1440.000
23336   0.1420.0000.2860.000
30006   0.1390.0001.8010.000
33342   0.1330.0000.4730.000
1   0.0880.0886.5056.505
1   0.0800.0006.1670.001
1   0.0730.0732.2342.234
20004   0.0660.0002.0600.000
70020   0.0590.0000.0590.000
33346   0.0590.0000.0860.000
1   0.0580.0004.8490.000
6   0.0580.0000.1110.000
1   0.0520.0005.1660.001
33342   0.0510.0000.0510.000
33628   0.0490.0000.0490.000
33340   0.0470.0000.8810.000
23336   0.0390.0000.3250.000
viff-devel mailing list (