Repository navigation
perf(arkworks): cyclotomic GT exponentiation and shared-squaring GT multi-exponentiation - #36
Merged
Merged
Conversation
…ulti-exponentiation ArkGT scaling now uses PairingOutput's cyclotomic exponentiation instead of generic Fq12::pow. PairingCurve gains gt_msm; the BN254 backend implements it as an interleaved width-5 wNAF multi-exponentiation sharing one cyclotomic squaring chain, and the verifier's multi-term GT updates (process_round C/D1/D2, verify_final RHS in both modes) use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 tasks done
# Conflicts: # CHANGELOG.md
This was referenced Nov 2, 2026
moodlezoup
pushed a commit
to a16z/jolt
that referenced
this pull request
Nov 2, 2026
* chore(deps): bump dory-pcs to 0.5.0 Picks up atomic first-writer-wins setup files (a16z/dory#34), the prepared-point cache prefix check (a16z/dory#35) and cyclotomic GT exponentiation in the verifier (a16z/dory#36). Refreshes the two scheme.rs comments that described the old dory behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(fuzz): bump dory-pcs to 0.5.0 in fuzz lockfiles Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
moodlezoup
added a commit
to a16z/jolt
that referenced
this pull request
Nov 2, 2026
Main bumped dory-pcs to the 0.5.0 release (#2236), which includes a16z/dory#36. Take main's version dependency and lockfiles in place of this branch's git-rev pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moodlezoup
added a commit
to a16z/jolt
that referenced
this pull request
Nov 3, 2026
…2174) Point dory-pcs at a16z/dory#36, pinned by git rev until a dory-pcs release includes it. ArkGT scaling there uses cyclotomic exponentiation, and the Dory verifier's multi-term GT updates use the new PairingCurve::gt_msm, which shares one cyclotomic squaring chain across all terms. DoryScheme::combine uses gt_msm for the commitment combination, and Bn254GT::scalar_mul/msm use cyclotomic_exp instead of Fq12::pow. Cyclotomic arithmetic is valid only in the cyclotomic subgroup, so remove Bn254GT's unchecked From<Fq12>, which had no callers. Every Bn254GT is now a pairing output, a product of them, or subgroup-checked on deserialization. Single-threaded verification of fib at 2^16 drops from 1.222B to 0.483B instructions retired (Callgrind, -60%). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ArkGTscaling (Group::scale,ArkFr * ArkGT) now goes throughPairingOutput's scalar multiplication, which is arkworks' NAFcyclotomic_expwith Granger–Scott squaring, instead of the genericFq12::pow.PairingCurve::gt_msm. New trait method computingΣ kᵢ·tᵢin GT. The default implementation scales each term. The BN254 backend overrides it with an interleaved width-5 wNAF multi-exponentiation: all terms share one chain of ~254 cyclotomic squarings, each base gets an 8-entry table of odd powers, and negative digits use conjugation. Withparallel, inputs with more than 8 terms split into per-thread chains.process_roundusesgt_msmfor C, D₁ and D₂ (4, 3 and 3 terms). Theverify_finalright-hand side uses it too: 4 terms in transparent mode, 9 in ZK mode, whered²·(A − c₂·D₂_init)is expanded into two terms.Group results are unchanged, so proofs are byte-identical.
Soundness
Cyclotomic squaring, and conjugation as the inverse, are valid only in the cyclotomic subgroup of Fq12, which contains GT. Every
ArkGTthe verifier exponentiates is one of:ArkGTdeserialization subgroup-checks (fix: enforce GT subgroup membership in ArkGT deserialization #22).Impact
Measured as instructions retired under Callgrind, in Jolt's single-threaded verifier (fib, trace length 2^16), counting only
DoryScheme::verify:DoryScheme::verifyFq12::pow)gt_msm)Per-operation cost with full 254-bit scalars (Callgrind):
Fq12::powcyclotomic_expgt_msm, 3 termsgt_msm, 4 termsgt_msm, 41 termsTesting
gt_msm_matches_naivecomparesgt_msmagainst per-termscalefor 3, 5 and 40 terms; 40 terms exercises the parallel split. The inputs include an identity base, a zero scalar and a −1 scalar, and an empty-input case.cargo fmt --check;-D warningsfor transparent, zk and--no-default-features;cargo docwith-D warnings;zk_statistical.🤖 Generated with Claude Code