Perform final reduction of Horner poly evaluation - #593
Closed
sug0 wants to merge 1 commit into
Closed
Conversation
Gets rid of modular arithmetic in additions, which stays within the bounds of the field modulus.
armfazh
self-requested a review
March 31, 2026 20:51
Contributor
|
I measured and the time difference is a small percentage on my machine. Also note that adding without performing modular reduction (i.e., lazy reduction) may reveal some information about the coefficients in the case the number of words of @sug0 thanks for the proposed change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Amendment to #590
Gets rid of modular arithmetic in additions, which stays within the bounds of the ring modulus, saving a few CPU cycles. The operations are const time on a best-effort basis... Switching from
math/bigto a library with Montgomery reductions is actually the better approach here.