[viff-devel] Importing shares into VIFF

2009-03-25 Thread Håvard Vegge

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


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