[viff-devel] Division

2009-02-18 Thread Atle Mauland
Hi! I'm experimenting with the RSA problem in VIFF, so i need to have 2  
primes (p and q) plus d (the inverse) secret shared.

I have a couple of question regarding implemented functions in VIFF:

Is there any way to do shared division / modulus in VIFF?

What's the best way of getting a shared random bit / value?

I talked to my supervisor, Tord, and we are wondering if there is any  
bit-decomposition function implemented?


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


Re: [viff-devel] Division

2009-02-23 Thread Atle Mauland

On Wed, 18 Feb 2009 18:13:00 +0100, Martin Geisler  wrote:


"Atle Mauland"  writes:

Hi Atle!


Hi! I'm experimenting with the RSA problem in VIFF, so i need to have
2 primes (p and q) plus d (the inverse) secret shared.


Ohh, cool!


I have a couple of question regarding implemented functions in VIFF:

Is there any way to do shared division / modulus in VIFF?


We have this example program which Sigurd knows more about:

  http://hg.viff.dk/viff/file/tip/apps/divide.py


Have any of you guys tried to include this file into the runtime.py file  
by overriding the __div__ operator? My attempt was obviously a fiasco :P


If the overriding of __div__ does not work, any suggestion of how I could  
get my application to perform shared division with divide.py in  
cooperation with VIFF?





What's the best way of getting a shared random bit / value?


That would be prss_share_random(field, binary=True):

  http://viff.dk/doc/passive.html#viff.passive.PassiveRuntime.prss_share_random


I talked to my supervisor, Tord, and we are wondering if there is any
bit-decomposition function implemented?


Not directly, but maybe as part of the comparison protocols -- Tomas?




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


Re: [viff-devel] Division

2009-02-27 Thread Atle Mauland

On Wed, 18 Feb 2009 18:13:00 +0100, Martin Geisler  wrote:


"Atle Mauland"  writes:

Hi Atle!


Hi! I'm experimenting with the RSA problem in VIFF, so i need to have
2 primes (p and q) plus d (the inverse) secret shared.


Ohh, cool!


I have a couple of question regarding implemented functions in VIFF:

Is there any way to do shared division / modulus in VIFF?


We have this example program which Sigurd knows more about:

  http://hg.viff.dk/viff/file/tip/apps/divide.py


What's the best way of getting a shared random bit / value?


That would be prss_share_random(field, binary=True):


I have written my code like this just to try this function:

bit1 = runtime.prss_share_random(Zp, True)
bit2 = runtime.prss_share_random(Zp, True)
bit3 = runtime.prss_share_random(Zp, True)

but every time I always get 0 (zero) as the answer for all bits... What do  
I do wrong?




  http://viff.dk/doc/passive.html#viff.passive.PassiveRuntime.prss_share_random


I talked to my supervisor, Tord, and we are wondering if there is any
bit-decomposition function implemented?


Not directly, but maybe as part of the comparison protocols -- Tomas?




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


Re: [viff-devel] Division

2009-02-27 Thread Atle Mauland
Hehe, my bad, it just happend to be that the random seed in the  
generate-config-files yielded zero for the 3 first random generations, i  
ran the config again and now i get "more random" numbers :D


On Fri, 27 Feb 2009 14:32:21 +0100, Atle Mauland   
wrote:


On Wed, 18 Feb 2009 18:13:00 +0100, Martin Geisler   
wrote:



"Atle Mauland"  writes:

Hi Atle!


Hi! I'm experimenting with the RSA problem in VIFF, so i need to have
2 primes (p and q) plus d (the inverse) secret shared.


Ohh, cool!


I have a couple of question regarding implemented functions in VIFF:

Is there any way to do shared division / modulus in VIFF?


We have this example program which Sigurd knows more about:

  http://hg.viff.dk/viff/file/tip/apps/divide.py


What's the best way of getting a shared random bit / value?


That would be prss_share_random(field, binary=True):


I have written my code like this just to try this function:

bit1 = runtime.prss_share_random(Zp, True)
 bit2 = runtime.prss_share_random(Zp, True)
 bit3 = runtime.prss_share_random(Zp, True)

but every time I always get 0 (zero) as the answer for all bits... What  
do I do wrong?




  http://viff.dk/doc/passive.html#viff.passive.PassiveRuntime.prss_share_random


I talked to my supervisor, Tord, and we are wondering if there is any
bit-decomposition function implemented?


Not directly, but maybe as part of the comparison protocols -- Tomas?




___
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 value of Zp

2009-03-24 Thread Atle Mauland

Hi all!

Is there any way of getting the value of the Zp-variable as an integer? I  
need to calculate some values mod p...


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


Re: [viff-devel] The value of Zp

2009-03-26 Thread Atle Mauland

On Thu, 26 Mar 2009 00:24:00 +0100, Martin Geisler  wrote:


"Atle Mauland"  writes:


Hi all!

Is there any way of getting the value of the Zp-variable as an
integer? I need to calculate some values mod p...


You can access the modulus attribute:


from viff.field import GF
Zp = GF(131)
Zp.modulus

131


Thx all for answers, I was looking for the modulus attribute :)

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


[viff-devel] RSA

2009-05-20 Thread Atle Mauland

Hi friends of VIFF!

I have implemented an algorithm for generating shared RSA keys with 3  
players in VIFF. The algorithm can generate keys of arbitrary length (only  
tested up to 2048-bit because of the time required for large keys). The  
average time for generating a 1024-bit key is approximately 25 minutes  
(with all players performing the protocol on my own laptop).


I don't know how you guys normally benchmark these protocols, but I have  
implemented code for benchmarking both the key generation and the  
decryption in the same file as the main code, but as I said, the  
benchmarks have only been conducted on a single computer, due to the lack  
of two more :P


To try out the code, alter the variables at the start of the __init__  
function in the class Protocol as you like and simply run the program!


- Atle

RSA_viffdevel.py
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] RSA

2009-05-20 Thread Atle Mauland
Oh, I forgot to say, player 3 is the one doing trial decryption and  
benchmark, so only the PRIVATE VARIABLES are useful for player 1 and 2.  
Player 3 is therefore the only one that has any correct decryptions :)


On Wed, 20 May 2009 16:30:33 +0200, Atle Mauland   
wrote:



Hi friends of VIFF!

I have implemented an algorithm for generating shared RSA keys with 3
players in VIFF. The algorithm can generate keys of arbitrary length  
(only

tested up to 2048-bit because of the time required for large keys). The
average time for generating a 1024-bit key is approximately 25 minutes
(with all players performing the protocol on my own laptop).

I don't know how you guys normally benchmark these protocols, but I have
implemented code for benchmarking both the key generation and the
decryption in the same file as the main code, but as I said, the
benchmarks have only been conducted on a single computer, due to the lack
of two more :P

To try out the code, alter the variables at the start of the __init__
function in the class Protocol as you like and simply run the program!

- Atle



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