gdanezis/bplib

Unexpected behaviour for negative ZP element

Closed this issue · 2 comments

GuthL commented

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

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.

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