-
Notifications
You must be signed in to change notification settings - Fork 22
chore: check if this is the first vote or mask #946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5712cf0
test: add masking test
ctrlc03 6992d79
chore: debugging
ctrlc03 1117c9b
chore: test fail merkle root
ctrlc03 51f6fa4
test: ecdsa + merkle root
ctrlc03 53489f2
fix: merkle proof error with index
ctrlc03 cf4e869
chore: cleanup
ctrlc03 d0826ca
chore: prettier
ctrlc03 8870af8
feat(circuit): check if this is the first value in the slot
ctrlc03 c13456e
chore: add missing license
ctrlc03 7107288
chore: revert returning bool in check_coefficients_zero
ctrlc03 e205b12
fix: ensure we check each coefficient to not be zero in check_coeffic…
ctrlc03 67f9ff4
chore: cleanup
ctrlc03 cf977a2
chore: check sum only if not first vote
ctrlc03 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // SPDX-License-Identifier: LGPL-3.0-only | ||
| // | ||
| // This file is provided WITHOUT ANY WARRANTY; | ||
| // without even the implied warranty of MERCHANTABILITY | ||
| // or FITNESS FOR A PARTICULAR PURPOSE. | ||
|
|
||
| export function normalizeCoefficient(coeff: string): string { | ||
| if (coeff.startsWith('0x')) { | ||
| return BigInt(coeff).toString(); | ||
| } | ||
| return coeff.toString(); | ||
| } | ||
|
|
||
| export function compareCoefficientsArrays(arr1: any[], arr2: any[]): boolean { | ||
| if (arr1.length !== arr2.length) return false; | ||
|
|
||
| for (let i = 0; i < arr1.length; i++) { | ||
| if (!arr1[i] || !arr2[i]) return false; | ||
|
|
||
| const coeff1 = arr1[i].coefficients; | ||
| const coeff2 = arr2[i].coefficients; | ||
|
|
||
| if (!coeff1 || !coeff2) return false; | ||
| if (coeff1.length !== coeff2.length) return false; | ||
|
|
||
| for (let k = 0; k < coeff1.length; k++) { | ||
| const normalized1 = normalizeCoefficient(coeff1[k]); | ||
| const normalized2 = normalizeCoefficient(coeff2[k]); | ||
|
|
||
| if (normalized1 !== normalized2) return false; | ||
| } | ||
| } | ||
|
|
||
| return true; | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.