Skip to content

Support only u64 sized primes for SmallFp#1088

Open
z-tech wants to merge 1 commit intomasterfrom
z-tech/u64-sized-primes-only-for-smallfp
Open

Support only u64 sized primes for SmallFp#1088
z-tech wants to merge 1 commit intomasterfrom
z-tech/u64-sized-primes-only-for-smallfp

Conversation

@z-tech
Copy link
Copy Markdown
Contributor

@z-tech z-tech commented Mar 30, 2026

Though arithmetic of primes 64-128 bits showed some potential at the outset, I don't think the numbers back up supporting this increased complexity especially when the optimizations here can most likely be applied directly to the Fp implementation.

We also have the define_field! macro that chooses the appropriate representation for the user.

Advantages:

  • less code to optimize and maintain
  • simpler to read and indeed some of the code like multiplication was already kind of duplicated
  • we can safely hardcode this lingering const N "number of limbs" to 1, which is kind of a win in itself
  • the target primes nowadays are <= u64 anyway

Disadvantages:

  • would have been nice to remove before putting in main
  • is there a performance win? (I think less so now)

closes: #1089


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

@z-tech z-tech changed the title support only u64 sized primes for smallfp Support only u64 sized primes for SmallFp Mar 30, 2026
@z-tech z-tech marked this pull request as ready for review March 30, 2026 16:16
@z-tech z-tech requested review from a team as code owners March 30, 2026 16:16
@z-tech z-tech requested review from Pratyush, mmagician and weikengchen and removed request for a team March 30, 2026 16:16
@z-tech
Copy link
Copy Markdown
Contributor Author

z-tech commented Mar 30, 2026

@benbencik

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.

Support only <= 64 bit primes in SmallFp

1 participant