-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bernstein-Yang modular inversion algorithm #372
Conversation
Imported from: privacy-scaling-explorations/halo2curves#83 Original code is Apache 2.0+MIT. Attribution has been added to the top of the module.
Hmm, re: 32-bit support, I was attempting to go off of what section 12.3 of https://gcd.cr.yp.to/safegcd-20190413.pdf had to say regarding the number of bits/iterations, but it seems something else is amiss |
e9a6b9f
to
e17f681
Compare
Going to back out attempts at 32-bit support. The paper alludes to a That does leave the issue of how to assemble a |
e17f681
to
b78e966
Compare
ec0a2b2
to
a4dd489
Compare
Since we need to convert big integers from a saturated representation to an unsaturated 62-bit representation (and back) to perform Bernstein-Yang anyway, I changed the conversion functions to operate over That seems like enough to make the proptests pass on both 32-bit and 64-bit platforms. I haven't fully integrated it into the various modular inverse functions yet, but this is enough to get started. |
Note: I do intend to encapsulate this and get it out of the public API |
Adapted from: privacy-scaling-explorations/halo2curves#83
Original code is Apache 2.0+MIT. Attribution has been added to the top of the module.
See also: #227
cc @dignifiedquire @fjarri @mratsim