-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Process verification keys to perform online verification #1760
Merged
Conversation
This file contains 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
utACK |
1 similar comment
utACK |
☔ The latest upstream changes (presumably #1399) made this pull request unmergeable. Please resolve the merge conflicts. |
utACK |
@ebfull Please rebase. Thanks. |
72e1c06
to
78df9f0
Compare
Rebased @bitcartel. |
@zkbot try |
☀️ Test successful - zcash |
Don't |
ACK |
@zkbot r+ |
📌 Commit 78df9f0 has been approved by |
zkbot
pushed a commit
that referenced
this pull request
Nov 15, 2016
Process verification keys to perform online verification Checking proofs involves some arithmetic with pairings using components of the proof and the verification key. If you already have some curve points, like those in the verification key, you can amortize the cost of some of the more expensive arithmetic. This PR adopts libsnark's precomputation of G2 elements in the verification key. We *currently* call `r1cs_ppzksnark_verifier_strong_IC`: ```c++ template<typename ppT> bool r1cs_ppzksnark_verifier_strong_IC(const r1cs_ppzksnark_verification_key<ppT> &vk, const r1cs_ppzksnark_primary_input<ppT> &primary_input, const r1cs_ppzksnark_proof<ppT> &proof) { enter_block("Call to r1cs_ppzksnark_verifier_strong_IC"); r1cs_ppzksnark_processed_verification_key<ppT> pvk = r1cs_ppzksnark_verifier_process_vk<ppT>(vk); bool result = r1cs_ppzksnark_online_verifier_strong_IC<ppT>(pvk, primary_input, proof); leave_block("Call to r1cs_ppzksnark_verifier_strong_IC"); return result; } ``` Notice that this merely performs precomputation of the verification key, and then calls `r1cs_ppzksnark_online_verifier_strong_IC`. This PR merely performs the precomputation during verification key initialization, and calls that function directly.
☀️ Test successful - zcash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-circuit
Area: zk-SNARK circuits
I-performance
Problems and improvements with respect to performance
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.
Checking proofs involves some arithmetic with pairings using components of the proof and the verification key. If you already have some curve points, like those in the verification key, you can amortize the cost of some of the more expensive arithmetic.
This PR adopts libsnark's precomputation of G2 elements in the verification key.
We currently call
r1cs_ppzksnark_verifier_strong_IC
:Notice that this merely performs precomputation of the verification key, and then calls
r1cs_ppzksnark_online_verifier_strong_IC
. This PR merely performs the precomputation during verification key initialization, and calls that function directly.