Skip to content

Accelerate BN254 CRT reconstruction and export - #178

Merged
odraccir1 merged 2 commits into
masterfrom
ra/crt_export
Oct 20, 2026
Merged

odraccir1 merged 2 commits into
masterfrom
ra/crt_export

Conversation

@odraccir1

@odraccir1 odraccir1 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Reduce the cost of converting small-prime FFT results back into BN254 coefficients through fused normalization and certified direct Montgomery reconstruction.

• Fold CRT cofactor inverses into the cached inverse-transform normalization, removing a modular multiplication per residue.
• Accumulate precomputed Montgomery export weights and use an integer interval certificate to prove both the centering correction and the coefficient bound.
• Export certified results through one Montgomery reduction. Ambiguous cases retain exact wide reconstruction and the existing bound checks.
• Apply the optimized path to ordinary, prepared, cyclic, and fused matrix products.
• Fix register exhaustion in the x86 Montgomery reducer by addressing its constants through one shared pointer, supporting default-visibility macOS builds in Release and Debug.

Native x86 benchmarks at degree 2048, using one core and medians of three measured trials, show 9.2–9.8× faster CRT reconstruction/export. Complete operations measured in clean production builds improve by 1.57–2.53×.

@odraccir1 odraccir1 changed the title fuse normalization and implmemnt certified direct Montgomery reconstruction Accelerate BN254 CRT reconstruction and export Oct 20, 2026
@odraccir1
odraccir1 requested a review from spaceships October 20, 2026 17:53
@odraccir1
odraccir1 merged commit 6c6e819 into master Oct 20, 2026
2 checks passed
@odraccir1
odraccir1 deleted the ra/crt_export branch October 20, 2026 17:54
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