gdanezis / bplib

A bilinear pairing library for petlib
35 stars 13 forks source link

Unexpected behaviour for negative ZP element #6

Closed GuthL closed 6 years ago

GuthL commented 6 years ago

Hi, first thanks for this library. I found it to be very interesting and easy to use (although I'm not full expert in Pairing-based) I'm implementing the BBS signature and found out that negative ZP elements returns negative number. This breaks the equality of bilinearity operation, aka e(-k.P,Q) != e(P,Q)(-k) If I do, j = -k % o, then e(j.P,Q) == e(P,Q)j

gdanezis commented 6 years ago

Hi. Many thanks for the bug report, which I have confirmed. I have now pushed a new version of the library in the git repository, along with a test (test_negative) to check for the linearity even with negative scalars. Hope this works for you. I will wait for the CI to finish and push to pypi.

gdanezis commented 6 years ago

It is now uploaded as version 0.0.5. Thanks for your help -- and keep the bug reports coming!