[viff-devel] Value overflow in Toft07

2010-07-06 Thread Lars Krapf

Hello VIFF-team

I would like to suggest the following patch to viff/comparison.py:
159c159
 l = int(self.options.security_parameter + 
math.log(dst_field.modulus, 2))

---
 l = self.options.security_parameter + 
math.log(dst_field.modulus, 2)


otherwise the l in the next line:
 
this_mask = rand.randint(0, (2**l) -1)


is a float, and we get 34, Value out of Range exceptions for big l.

Best greetings
Lars Krapf

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


Re: [viff-devel] Value overflow in Toft07

2010-07-06 Thread Marcel Keller

Dear Lars,

thanks for pointing it out. It is now fixed in the official repository.

Best regards,
Marcel


Lars Krapf wrote:

Hello VIFF-team

I would like to suggest the following patch to viff/comparison.py:
159c159
 l = int(self.options.security_parameter + 
math.log(dst_field.modulus, 2))

---
  l = self.options.security_parameter + 
math.log(dst_field.modulus, 2)


otherwise the l in the next line:
 this_mask = rand.randint(0, (2**l) -1)

is a float, and we get 34, Value out of Range exceptions for big l.

Best greetings
Lars Krapf

___
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