You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started to dig deeper into the implementation and stumbled over a small issue with the magnitudes.
From field_10x26_impl.h, the function secp256k1_fe_verify
r &= (a->magnitude >= 0);
r &= (a->magnitude <= 32);
while in field_5x52_impl.h the function is
r &= (a->magnitude >= 0);
r &= (a->magnitude <= 2048);
This means that multiplying a number with the constant value 100 is totally fine on a 64-bit machine, but will lead to an error on 32-bit machines, which IMHO is bad. The two implementation should have the same external interface.
Finally, is there a good reason for the 2 * in the second line of secp256k1_fe_verify? Why is the magnitude given in multiple of 2's? Doesn't the code work with odd magnitudes? This also means that one cannot express that magnitude should be 1 without having a fully normalized number.
The text was updated successfully, but these errors were encountered:
Hello,
I started to dig deeper into the implementation and stumbled over a small issue with the magnitudes.
From
field_10x26_impl.h
, the functionsecp256k1_fe_verify
while in
field_5x52_impl.h
the function isThis means that multiplying a number with the constant value 100 is totally fine on a 64-bit machine, but will lead to an error on 32-bit machines, which IMHO is bad. The two implementation should have the same external interface.
Finally, is there a good reason for the
2 *
in the second line ofsecp256k1_fe_verify
? Why is the magnitude given in multiple of 2's? Doesn't the code work with odd magnitudes? This also means that one cannot express that magnitude should be 1 without having a fully normalized number.The text was updated successfully, but these errors were encountered: