Giter VIP home page Giter VIP logo

Comments (11)

OBrezhniev avatar OBrezhniev commented on August 16, 2024

@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.

nasko25 avatar nasko25 commented on August 16, 2024

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.

OBrezhniev avatar OBrezhniev commented on August 16, 2024

@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.

nasko25 avatar nasko25 commented on August 16, 2024

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.

nasko25 avatar nasko25 commented on August 16, 2024

@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.

nasko25 avatar nasko25 commented on August 16, 2024

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.

nasko25 avatar nasko25 commented on August 16, 2024

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.

sanketsaagar avatar sanketsaagar commented on August 16, 2024

Hi @nasko25 , Did your issue resolve?

from witnesscalc.

nasko25 avatar nasko25 commented on August 16, 2024

Hi @sanketsaagar

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.

OBrezhniev avatar OBrezhniev commented on August 16, 2024

@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.

nasko25 avatar nasko25 commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.