Skip to content

Select secret witness bits via subtle - #98

Merged
davxy merged 1 commit into
masterfrom
davxy/subtle-cond-select
Aug 14, 2026
Merged

Select secret witness bits via subtle#98
davxy merged 1 commit into
masterfrom
davxy/subtle-cond-select

Conversation

@davxy

@davxy davxy commented Aug 14, 2026

Copy link
Copy Markdown
Member

@burdges

burdges commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

To my knowledge this looks fine, certainly it's seems as good as the previous version, and possible gets us CVE warnings if rustc breaks anything.

I've not dug into how the lower level prover really works with everything, so ideally I'd discuss this with @swasilyev in detail, but that applied to the previous version. It's fine.

As I said before, I doubt this matters much based upon how this gets used, but unless I've missed something it doesn't look like you're triggering extra scalar mults here or before, so the runtime cost should be low I guess.

.zip(bits)
.scan(F::zero(), |state, (&a, &bit)| {
let sum = *state + a;
*state = F::select(bit, &sum, state);

@burdges burdges Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh okay so here there is extra work, but this seems tiny compared to the full proof cost.

@davxy
davxy merged commit 59f65b7 into master Aug 14, 2026
7 checks passed
@davxy
davxy deleted the davxy/subtle-cond-select branch August 14, 2026 10:58
@davxy
davxy restored the davxy/subtle-cond-select branch August 14, 2026 11:00
@davxy
davxy deleted the davxy/subtle-cond-select branch August 14, 2026 11:57
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.

2 participants