-
Notifications
You must be signed in to change notification settings - Fork 27
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
Update Groth16Verifier.sol: fix snarkjs public signals check bug #333
base: main
Are you sure you want to change the base?
Conversation
Fix snarkjs public signals check bug. see iden3/snarkjs#518
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide more detail showing this is indeed a bug, and not a required check. If I understand correctly, the impact here of this extra check is extra gas usage. The impact of removing the check when it's required is critical soundness failure.
hi @nategraf, according to the risc0 stark_verify.circom file, there are only 5 output signals ( public witness ) passed to the Groth16 verifier, therefore only first 5 elements should be checked before ecPairing check. The line deleted is meant to check the non-existing 6th element of the array parameter, which obviously is to access to the uninitialized memory since the array itself only contains 5 elements as shown in the code. |
This makes sense to me: |
Looks like this is almost certainly correct. Thanks @andrewcoder666 for bringing this! I'm going to do a bit more due diligence before merging this. |
Fix snarkjs public signals check bug.
see iden3/snarkjs#518