-
Notifications
You must be signed in to change notification settings - Fork 73
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
Migrate mod_exp to BoringSSL, removing GMP requirement #1277
Comments
Unit tests could potentially be a separate PR. |
Issue moved from iteration to backlog. Per @spoonincode - this issue is dependent on #644. |
Wondering if Boost multiprecision could be used? |
https://www.boost.org/doc/libs/1_83_0/libs/multiprecision/doc/html/boost_multiprecision/perf/integer_performance.html |
Ha, that's right. Not quite as bad as your |
As part of the effort to remove system provided "mathy" dependencies that could unexpectedly change out from under us and affect protocol consensus, remove the sole remaining usage of libgmp: the
modexp
host function. This likely can be refactored to use boringssl fairly easily, and that then opens up the possibility for #1255 too since we can maintain a fork with the needed hooks.We need to be mindful to measure performance difference between the two; and pay special attention that boringssl has different optimization paths depending on the input parameters (this may mean we ought to create specialized benchmarks for such inputs).
We must add unit tests for all pertinent modexp test cases that are part of boringssl and ensure they are equivalent to the existing consensus rules. The output of boringssl/openssl's modexp has changed over time to rectify implementation defects and while the expectation is gmp's modexp is the same as boringssl at the current time, these unit tests exercise some fantastic corner cases. These unit tests should be added in a discrete PR, or at least pushed individually, for easy verification that the results are as expected on gmp.
The text was updated successfully, but these errors were encountered: