[viff-devel] How to convert field elements to integers?

Tord Ingolf Reistad tordr at stud.ntnu.no
Thu Jan 22 07:01:25 PST 2009


Hello,

I have a simple question: After completing a VIFF program I have opened 
the shares and gotten the results, but the results are field elements 
(probably elements of class GFElement), how do I turn them back into 
integers?

The documentation says nothing about how to turn them back into 
integers, which should be essencial if I am going to use these shares in 
other applications. There seems to be some code __repr__ in GFElements, 
but I cannot see how I can use it.

As an additional problem, the integers should not be integers in the set 
form 0 to p-1, but integers from -(p-1)/2 to +(p-1)/2. How should one do 
that efficiently?

Tord




More information about the viff-devel mailing list