Skip to content

Use 64 bit coefficients for primes from 2^31 on - #395

Open
ederc wants to merge 1 commit into
algebraic-solving:masterfrom
ederc:ff-2-31-2-32
Open

ederc wants to merge 1 commit into
algebraic-solving:masterfrom
ederc:ff-2-31-2-32

Conversation

@ederc

@ederc ederc commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

This PR fixes the prime field gap of 2^31 <= p <= 2^32, which is now mapped on the 52 bit inferface.

Now F4 supports all prime fields for p < 2 ^52.

This PR was prepared with the assistance of generative AI
the changes were reviewed and tested as described above.

Primes between 2^31 and 2^32 were handled by the 32 bit linear algebra,
whose intermediate products do not fit for such primes, so msolve
rejected them. neogb now switches to 64 bit coefficients already at
2^31, which closes the gap: msolve accepts every characteristic below
2^52 and computes Groebner bases for those of at least 2^31, as it
already did above 2^32. Coefficients for these primes are passed as
int64_t; the 32 bit interfaces validate_input_data() and export_nf()
reject them. Signatures are restricted to primes below 2^31.

Add the test kat6-32 over the largest prime below 2^32, checked against
the Groebner basis over the rationals mapped to this field, and update
the stated limits in the README and the tutorial.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mohabsafey
mohabsafey self-requested a review November 9, 2026 07:28
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.

1 participant