Skip to content

Accelerate BN254 input coefficient conversion - #179

Merged
odraccir1 merged 2 commits into
masterfrom
ra/input_coefficient_conversion
Oct 21, 2026
Merged

odraccir1 merged 2 commits into
masterfrom
ra/input_coefficient_conversion

Conversation

@odraccir1

@odraccir1 odraccir1 commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Replace generic integer conversion and bit export with specialized Montgomery decoding and fixed 52-bit chunk extraction on 64-bit-limb backends. Reuse Crypto3’s existing field helpers while preserving canonical coefficient values and the 32-bit-limb fallback.

Extend boundary tests to cover the stored Montgomery representation. Add a compile-only regression test ensuring the 32-bit fallback does not instantiate the 64-bit helper.

Measured x86 input-conversion CPU time, using medians of seven trials after two warmups:

Fp12 coefficients: Before, After, Speedup
2,048: 5.01 ms, 1.22 ms, 4.10×
14,938: 40.63 ms, 11.45 ms, 3.55×

These measurements cover input conversion only.

@odraccir1
odraccir1 requested a review from spaceships October 21, 2026 19:49
@odraccir1
odraccir1 merged commit d22c05f into master Oct 21, 2026
2 checks passed
@odraccir1
odraccir1 deleted the ra/input_coefficient_conversion branch October 21, 2026 19:53
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