Skip to content
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

Support operations over small field elements #225

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Pratyush
Copy link
Member

@Pratyush Pratyush commented Mar 8, 2021

Description

Support specialized field operations for field elements having small magnitude.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@ValarDragon ValarDragon self-requested a review March 10, 2021 17:46
@jon-chuang
Copy link
Contributor

jon-chuang commented Mar 11, 2021

I suppose this is meant to work even if NONRESIDUE is composed both of SmallFieldValue::Full and SmallFieldValue::Small?

I suppose also that one can rewrite the original traits to be based on SmallFieldValue::Full? Seems there's lot's of unecessary boilerplate/repeat code.

For convenience, I link #212 where much of the motivation for this PR can be revisited.

match (self, other) {
(Small(f1), Small(f2)) => f1
.checked_add(f2)
.expect("cannot multiply these small numbers")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add, not multiply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants