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
Sigurd

On Thu, Apr 8, 2010 at 11:34 PM, Marcel Keller mkel...@cs.au.dk 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
 parameter.

 Best regards,
 Marcel



fermatequality
Description: Binary data
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] viff 0.7.1 question

2009-10-21 Thread Sigurd Torkel Meldgaard
 Hi,

 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 generate-config-files.py, 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: http://viff.dk/doc/install.html#installing-from-source
for instructions on how to get it there.

On Tue, Oct 20, 2009 at 2:27 PM, Angel Redoble angel_redo...@yahoo.com wrote:

 Im using ubuntu 9.04.

 Thanks a lot.

 Angel
 ___
 viff-devel mailing list (http://viff.dk/)
 viff-devel@viff.dk
 http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Sigurd
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] Commit messages

2009-10-19 Thread Sigurd Torkel Meldgaard
On Mon, Oct 19, 2009 at 2:14 PM, Janus Dam Nielsen
janus.niel...@alexandra.dk 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:

  http://hg.viff.dk/viff/

 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: http://viff.dk/.
 ___
 viff-devel mailing list (http://viff.dk/)
 viff-devel@viff.dk
 http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk

 
 Janus Dam Nielsen
 Research and Innovationspecialist, PhD.
 CENTRE FOR IT-SECURITY
 THE ALEXANDRA INSTITUTE LTD.
 T +45 42 22 93 56
 e janus.niel...@alexandra.dk
 W alexandra.dk
 

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


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


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 hava...@stud.ntnu.no wrote:
 Hello!

 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
 saying:
 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 (http://viff.dk/)
 viff-devel@viff.dk
 http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk

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


[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:

http://www.reddit.com/r/programming/comments/7lute/ask_proggit_what_is_the_best_simulator_for_p2p/
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


[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 benchmark.py --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 selectreactor.py:93(doSelect)
173360/866802.5240.0009.8540.000 defer.py:314(_runCallbacks)
90013   1.0700.0001.3150.000 field.py:371(__mul__)
  307   0.9710.0035.6750.018 basic.py:321(dataReceived)
6   0.7720.0000.9040.000 runtime.py:579(_expect_data)
16668   0.5550.0002.1890.000 shamir.py:30(share)
203364/933640.5180.0006.1410.000 defer.py:172(addCallbacks)
   260039   0.4780.0000.4780.000 field.py:339(__init__)
33340   0.3600.0000.8330.000 runtime.py:311(sendData)
20004   0.3480.0001.8110.000 runtime.py:189(__init__)
8   0.3370.0004.6550.000 runtime.py:272(stringReceived)
113350/433500.2970.0005.4900.000 defer.py:189(addCallback)
80004   0.2970.0000.4080.000 field.py:342(__add__)
6   0.2700.0001.3980.000 runtime.py:613(_expect_share)
70021/46678 0.2530.0004.3540.000 
defer.py:291(_startRunCallbacks)
1   0.2260.0000.6050.000 shamir.py:96(recombine)
33342   0.2040.0000.2900.000 abstract.py:161(write)
1   0.1870.0004.7900.000 passive.py:163(share_recombine)
70021/46678 0.1800.0004.4770.000 defer.py:233(callback)
70010   0.1740.0000.3630.000 runtime.py:66(__init__)
2   0.1670.0001.6700.000 passive.py:389(shamir_share)
80006/70004 0.1670.0001.3370.000 runtime.py:213(_callback_fired)
30002   0.1530.0007.9910.000 runtime.py:358(inc_pc_wrapper)
23336   0.1440.0000.1440.000 random.py:217(_randbelow)
23336   0.1420.0000.2860.000 random.py:147(randrange)
30006   0.1390.0001.8010.000 
runtime.py:597(_exchange_shares)
33342   0.1330.0000.4730.000 basic.py:338(sendString)
1   0.0880.0886.5056.505 benchmark.py:247(run_test)
1   0.0800.0006.1670.001 passive.py:138(mul)
1   0.0730.0732.2342.234 benchmark.py:197(begin)
20004   0.0660.0002.0600.000 runtime.py:221(gather_shares)
70020   0.0590.0000.0590.000 defer.py:166(__init__)
33346   0.0590.0000.0860.000 abstract.py:264(startWriting)
1   0.0580.0004.8490.000 
runtime.py:559(callback_wrapper)
6   0.0580.0000.1110.000 runtime.py:615(lambda)
1   0.0520.0005.1660.001 
runtime.py:539(schedule_callback)
33342   0.0510.0000.0510.000 struct.py:54(pack)
33628   0.0490.0000.0490.000 struct.py:77(unpack)
33340   0.0470.0000.8810.000 runtime.py:315(sendShare)
23336   0.0390.0000.3250.000 random.py:211(randint)
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk