-
Notifications
You must be signed in to change notification settings - Fork 18
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
ensure constraints in Circom circuits are generated correctly #92
Comments
Thanks for catching this @yushihang you are correct, assert does not generate constraints and should only be used to catch compilation errors and quick checks for dev purposes. |
Recording the steps to reproduce the problem:
input.json:
{
"inputValues": ["1", "2"],
"outputValues": ["1", "2"]
}
hack_input.json:
{
"inputValues": ["1", "2"],
"outputValues": ["11", "22"]
}
Appendix: check-sum.circom:
template CheckSum(numInputs, numOutputs) {
signal input inputValues[numInputs];
signal input outputValues[numOutputs];
|
While studying Zeto’s open-source code, I have learned a lot from it, and I want to thank you for sharing the codes and youtube videos.
I have a question regarding the template CheckSum():
zeto/zkp/circuits/lib/check-sum.circom
Lines 31 to 45 in aa3c1fd
From the circom code, it seems that the checksum() does not add any constraints to the input signals, but instead uses
assert()
for validation.In the Circom documentation (https://docs.circom.io/circom-language/code-quality/code-assertion/), it mentions that assert is effective during the compilation and witness generation stages, but it does not explicitly state whether
assert()
applies during the verification stage.In my understanding, during the verification phase, the verifier has access to the QAP and the associated proof information. If assertions are not converted into r1cs, would they not be effective during the verification phase?
Therefore, I am a bit unsure if this approach is sufficiently secure.
Once again, thank you for your help.
The text was updated successfully, but these errors were encountered: