-
Notifications
You must be signed in to change notification settings - Fork 6
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
Invalid witness generated on Android #4
Comments
@nasko25 We have applied bug fixes from circom 9 days ago. You can test if this fixes your issue. Also check if USE_ASM flag in cmake changes result. |
I tried the latest changes and setting the USE_ASM flag, but the witness is still not correct. |
@nasko25 we will update this witness calc to support cpp files generated by the latest circom in about a week, maybe it will fix your issue. |
Thanks, I will wait for the update. I already tried several previous releases of circom to generate a cpp file (most notably v2.0.7 and v2.0.5), and none of them produced a correct witness. Do you think there is a specific version of circom which might generate cpp files that should work? |
@OBrezhniev I tried the latest changes on an x86_64 host machine and the witness is still not correct. Is there anything else I can try? |
I tried the feature/update-authV2 branch with a cpp file from the latest circom, but the proof calculated with the generated witness file is still not valid. Circom's witness calculator still calculates a correct witness. I also tried a different circuit with these versions of witnesscalc, circom, and snarkjs and it produced a valid proof. So something goes wrong only for the circuit I linked above. |
I also noticed that the logs in this circuit are not printed when generating a witness with witnesscalc. But if I add a log to the very beginning of this circuit (in the main component) it is printed. So something with the use of multiple components probably goes wrong. |
Hi @nasko25 , Did your issue resolve? |
Unfortunately, it is not yet resolved. Generating a witness with witnesscalc for the circuit linked above still results in an invalid proof.
And I believe the source of the issue is an implementation of |
@nasko25 try generating witnessccalc with this fix in circom compiler: https://github.com/iden3/circom/tree/fix-counter-decrease-in-assert |
Thank you. This version of circom fixes the issue. I did check whether NDEBUG was defined anywhere while I was debugging it, but I could not find a manual definition anywhere, so I assumed it was automatically enabled in the cmake/compiler's release mode. |
Hello,
I am trying to generate a witness of the following circuit on android.
I am using the feature/arm-asm branch, and in order to compile it I change the code in the src/auth.cpp file:
Then, I execute
and I copy the generated
package_android/bin/auth
executable together with the .dat file generated from circom (poc_cpp/poc.dat
) asauth.dat
to a physical android device.Please let me know if I am doing something incorrectly up to now.
Then, if I execute
./auth poc.json w.wtns
on android, it calculates a witness, but when I try to verify a proof, generated from this witness file, the proof is not valid.I viewed the w.wtns file, and it looks like it is mostly empty to me.
Please, let me know if I have made a mistake somewhere, or this is a bug in the witness calculator.
It is probably worth mentioning that this specific circuit did not work for the circom generated c++ witness calculator up until very recently, but there the witness generation crashed without generating a witness file, while witnesscalc generates an invalid witness file.
The text was updated successfully, but these errors were encountered: