Speed up prepared commitment blinding and evaluation - #271
Merged
ValarDragon merged 2 commits intoAug 31, 2026
Conversation
ValarDragon
force-pushed
the
agent/prepared-noorbits-prover-pr-20260830
branch
from
August 29, 2026 23:56
5a7b249 to
a9ac24b
Compare
ValarDragon
force-pushed
the
agent/prepared-fixed-blind-overlap-pr-20260830
branch
2 times, most recently
from
August 30, 2026 00:00
d7aabbc to
dc63b19
Compare
ValarDragon
force-pushed
the
agent/prepared-noorbits-prover-pr-20260830
branch
from
August 30, 2026 00:00
a9ac24b to
cda5a62
Compare
ValarDragon
force-pushed
the
agent/prepared-fixed-blind-overlap-pr-20260830
branch
from
August 30, 2026 00:25
dc63b19 to
a31edd9
Compare
ValarDragon
force-pushed
the
agent/prepared-noorbits-prover-pr-20260830
branch
2 times, most recently
from
August 30, 2026 00:35
da0124f to
89e4f1c
Compare
ValarDragon
force-pushed
the
agent/prepared-fixed-blind-overlap-pr-20260830
branch
from
August 30, 2026 00:35
a31edd9 to
f200edc
Compare
This was referenced Aug 30, 2026
ValarDragon
force-pushed
the
agent/prepared-noorbits-prover-pr-20260830
branch
from
August 30, 2026 23:16
89e4f1c to
94d6438
Compare
ValarDragon
force-pushed
the
agent/prepared-fixed-blind-overlap-pr-20260830
branch
from
August 30, 2026 23:16
f200edc to
3936dc2
Compare
ValarDragon
force-pushed
the
agent/prepared-noorbits-prover-pr-20260830
branch
from
August 30, 2026 23:31
94d6438 to
f84d5e5
Compare
ValarDragon
force-pushed
the
agent/prepared-fixed-blind-overlap-pr-20260830
branch
from
August 30, 2026 23:31
3936dc2 to
5586f94
Compare
ValarDragon
force-pushed
the
agent/prepared-noorbits-prover-pr-20260830
branch
from
August 30, 2026 23:33
f84d5e5 to
2967c9d
Compare
ValarDragon
force-pushed
the
agent/prepared-fixed-blind-overlap-pr-20260830
branch
2 times, most recently
from
August 30, 2026 23:44
874ebbd to
b5549b6
Compare
ValarDragon
force-pushed
the
agent/prepared-noorbits-prover-pr-20260830
branch
from
August 30, 2026 23:44
2967c9d to
2b389c0
Compare
Base automatically changed from
agent/prepared-noorbits-prover-pr-20260830
to
main
August 31, 2026 10:56
ValarDragon
force-pushed
the
agent/prepared-fixed-blind-overlap-pr-20260830
branch
from
August 31, 2026 11:06
b5549b6 to
f8ed058
Compare
ValarDragon
marked this pull request as ready for review
August 31, 2026 11:06
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
This reduces the remaining per-commitment overhead after the default
no-orbits prepared tables are armed.
The first commit adds a private byte-window fixed-base table for the blinding
generator. Prepared coefficient and Lagrange commitments keep the polynomial
borrowed, evaluate the prepared polynomial MSM with no extra term, and add the
blind from this table.
The second commit overlaps the prepared polynomial evaluation with blind
evaluation through the existing multicore join. The two changes remain
separate commits for review, but are proposed together because the overlap
delta is too small for an independent PR. Each commit carries its matching
changelog state.
Correctness and side channels
PrimeField::Repris treated as opaque. A probe chooses a candidate byteorder, and every multiplication decodes the actual representation and requires
it to equal the input scalar. Unsupported byte order or representation-length
mismatch falls back to native multiplication.
The multiplication is variable-time in the blind scalar: it skips zero digits
and uses digit-indexed lookups. Halo2's prover MSM paths already accept
variable-time evaluation of secret inputs.
Tests cover Pallas and Vesta; random scalars; zero, one, minus one, and the
probe; radix/window boundaries through the top partial window; unsupported byte
order; representation-length mismatch; cache sharing; serialization; atomic
decline; and panic retry.
Performance
Benchmarked production revisions (the final PR differs only by restacking and
the numbered changelog fragment):
5a7b2492382385dd0683535aef376ca64bafcc58ca26c90615c34d075c76a3b74c71fa28ca4faecf6cc4ce30c613b0bbd7699c8dd58f6d9246e1d64aThe live current-main commits are
b0a780ffor the fixed table andb5549b6for the PR head.
The four-action Orchard prover ran on
mac-os-1(Apple M4, arm64), Rust1.97.1, with ten Rayon/Orchard threads. Each comparison used drift-bracketed
control/candidate rounds:
The isolated sub-deltas are within Criterion's noise threshold; the direct
combined comparison is directionally stable and matches the earlier combined
stack result (-0.844%). This is why the two commits are one PR.
For a 32-byte Pasta scalar representation, the table retains exactly 8,160
affine points, or 522,240 bytes (0.498 MiB). On the benchmarked M4 the full
default no-orbits preparation moves from about 34 ms and 24.8 MiB to about
36 ms and 25.3 MiB. The overlap commit adds no persistent allocation.
API changes
None. All new types, constants, cache fields, and helpers are private.
Validation
zakura-halo2-proofsdefault and all-feature library suites.zakura-orchardlibrary suite.cargo +1.91.0 fmt --all --check.Stack
This draft is stacked on #270, which is rebased directly onto
main@9e415b9after #272 merged.