Skip to content

quotient ring exponentiation - #137

Merged
odraccir1 merged 2 commits into
masterfrom
ra/poly_factorization_7
Aug 19, 2026
Merged

quotient ring exponentiation#137
odraccir1 merged 2 commits into
masterfrom
ra/poly_factorization_7

Conversation

@odraccir1

@odraccir1 odraccir1 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Add quotient-ring arithmetic needed by polynomial factorization:

  • Add mulmod and squaremod in a dedicated modular-arithmetic header.
  • Add binary powmod with large-integer exponent support.
  • Support reusable precomputed divisor contexts and output aliasing.
  • Add generic prime- and extension-field order calculation.

Compared with FLINT, powmod is approximately 6–9× slower, while large squaremod reaches roughly 12×. This is wider than the previously measured 3–5× polynomial-multiplication gap. The gap widens because every modular multiplication performs a full product plus two nominal low products during preinverse reduction. The current mixed-radix backend implements those low products using complete FFT convolutions and then discards unwanted coefficients. FLINT instead uses specialized truncated and middle-product algorithms.

So again the most obvious path to closing the gap is to implement

  • A performant large-integer polynomial backend.
  • Kronecker packing/unpacking for Fq/Fq12.
  • Specialized full, truncated, and middle products.

Related to #114

@odraccir1
odraccir1 requested a review from spaceships August 19, 2026 17:12
@odraccir1
odraccir1 merged commit daafef5 into master Aug 19, 2026
2 checks passed
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.

2 participants