Select secret witness bits via subtle - #98
Merged
Conversation
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. |
burdges
reviewed
Aug 14, 2026
| .zip(bits) | ||
| .scan(F::zero(), |state, (&a, &bit)| { | ||
| let sum = *state + a; | ||
| *state = F::select(bit, &sum, state); |
Collaborator
There was a problem hiding this comment.
ahh okay so here there is extra work, but this seems tiny compared to the full proof cost.
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.
Context https://github.com/paritytech/srlabs_findings/issues/709#issuecomment-5278512026