Comments (11)
@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.
In general we haven't tested executables on Android (but should work as you describe), we are using compiled libraries.
Also I've just merged feature/arm-asm branch into main.
from witnesscalc.
I tried the latest changes and setting the USE_ASM flag, but the witness is still not correct.
I also tried generating a witness from the host, and it is not valid either.
from witnesscalc.
@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.
from witnesscalc.
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?
from witnesscalc.
@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?
from witnesscalc.
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.
from witnesscalc.
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.
from witnesscalc.
Hi @nasko25 , Did your issue resolve?
from witnesscalc.
Unfortunately, it is not yet resolved. Generating a witness with witnesscalc for the circuit linked above still results in an invalid proof.
However, I think I was able to isolate the issue further.
This circuit also generates an invalid witness:
pragma circom 2.0.0;
template Add2(n) {
signal input a[n];
signal input b[n];
signal output out[n];
log("add");
for (var k=0; k<n; k++) {
out[k] <== a[k] + b[k];
}
}
template Main() {
signal input a[2];
signal input b[2];
signal output out[2];
component add = Add2(2);
for (var i = 0; i < 2; i++) {
add.a[i] <== a[i];
add.b[i] <== b[i];
}
for (var j = 0; j < 2; j++) {
log("out[", j, "] = ", add.out[j]);
out[j] <== add.out[j];
}
}
component main = Main();
And I believe the source of the issue is an implementation of assert(expr)
somewhere withing witnesscalc that does not execute its parameter.
from witnesscalc.
@nasko25 try generating witnessccalc with this fix in circom compiler: https://github.com/iden3/circom/tree/fix-counter-decrease-in-assert
It should fix (at least for me it works with your code), but in general check that you don't have NDEBUG defined somewhere, which disables asserts, as asserts are used instead of exceptions in the code, which is not right way of exiting on failed condition checks.
from witnesscalc.
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.
from witnesscalc.
Related Issues (7)
- witness generation for a circuit
- Potential memory errors in Circom_Circuit* loadCircuit(const void *buffer, unsigned long buffer_size) HOT 1
- How are Circuits dat files generated, and how are some constants determined in the c++ code? HOT 2
- Memory allocated in struct Circom_Circuit / IODefPair / IODef may not be correctly released
- Argument types in fr_raw_generic.cpp seem to be rejected by gmp HOT 3
- Cannot determine how to define 32-bit word, bug? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from witnesscalc.