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
The ff_derive derived PrimeField implementation fails to derive a sqrt function for primes p = 5 (mod 8) and p = 9 (mod 16), resulting in a compile-time error for these cases. According to the introduction of IACR Preprint 2012/685 (the cited reference for the algorithms used for the p = 3 (mod 4) and p = 1 (mod 16) cases), efficient algorithms do exist for computing square roots over these primes; however, these algorithms are not currently implemented here.
In Issue #33, this limitation is noted explicitly, so it may be that the desired use cases for this library don't require full coverage of odd primes. I just wanted to check whether this is an intentional omission for maintainability, or if it's simply a feature that hasn't been added yet. If it's the latter and maintainers are interested, I might be able to assemble a pull request.
The text was updated successfully, but these errors were encountered:
This is just a feature no one has requested before. If someone wants to provide square root helpers for the uncovered cases, I'd be happy to review a PR. #93 adds helper methods for Tonelli-Shanks and for a generic sqrt_ratio; we could also have similar helper methods for other primes, and then use them in ff_derive.
The
ff_derive
derivedPrimeField
implementation fails to derive a sqrt function for primesp = 5 (mod 8)
andp = 9 (mod 16)
, resulting in a compile-time error for these cases. According to the introduction of IACR Preprint 2012/685 (the cited reference for the algorithms used for thep = 3 (mod 4)
andp = 1 (mod 16)
cases), efficient algorithms do exist for computing square roots over these primes; however, these algorithms are not currently implemented here.In Issue #33, this limitation is noted explicitly, so it may be that the desired use cases for this library don't require full coverage of odd primes. I just wanted to check whether this is an intentional omission for maintainability, or if it's simply a feature that hasn't been added yet. If it's the latter and maintainers are interested, I might be able to assemble a pull request.
The text was updated successfully, but these errors were encountered: