Skip to content
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

Add verifier #12

Merged
merged 6 commits into from
Feb 23, 2024
Merged

Add verifier #12

merged 6 commits into from
Feb 23, 2024

Conversation

nixw4
Copy link
Collaborator

@nixw4 nixw4 commented Feb 5, 2024

No description provided.

#endif

//Error codes returned by the functions.
#define VERIFIER_VALID_PROOF 0x0
Copy link
Collaborator

Choose a reason for hiding this comment

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

As it is a C header without C++ namespacing, I would add GROTH16_ prefix to these constant. But as counterpart PROOF_ error codes do not have this prefix, may be such naming is OK too 🤷

@olomix olomix requested a review from OBrezhniev February 6, 2024 09:25
Copy link
Collaborator

@olomix olomix left a comment

Choose a reason for hiding this comment

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

It doesn't work properly.
We have a test case where we generate proof using cmd prover, then validate this proof with snarkjs.

I've also generated a proof on my laptop. Tried to validate it at got the OK result

package_macos_arm64/bin/verifier proof.json public.json testdata/verification_key.json
Result: Valid proof

Then I modified the public.json file, rerun the command

$ package_macos_arm64/bin/verifier proof.json public.json testdata/verification_key.json
Result: Valid proof

and still got an OK result. While the snarkjs is returning error on modified public.json.

…uts.

Add unit tests for functions groth16_public_size_for_zkey_file and groth16_public_size_for_zkey_buf. Also enable ctest functionality that would enable us to write unit tests for different parts and run them as part for the cmake pipeline.
@olomix olomix merged commit 9fa3f0b into main Feb 23, 2024
4 checks passed
@olomix olomix deleted the verify branch February 23, 2024 08:15
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.

3 participants