0xPARC / zkrepl

An online playground for zero knowledge circuits
https://zkrepl.dev/
GNU General Public License v3.0
143 stars 23 forks source link

FIx witness processing on hover #1

Closed nalinbhardwaj closed 2 years ago

nalinbhardwaj commented 2 years ago

Looks like the witness file omits witnesses if they are only used in intermediate processing and the 2nd part of the line is actually the correct part we're looking for. Test circuit for fix:

pragma circom 2.0.3;

include "circomlib/poseidon.circom";
//include "https://github.com/0xPARC/circom-secp256k1/blob/master/circuits/bigint.circom";

template Example () {
    signal input a;
    signal input b;
    signal input c;
    signal d;

    d <== a * b;

    c === d;

    assert(a > 2);

    component hash = Poseidon(2);
    hash.inputs[0] <== a;
    hash.inputs[1] <== b;

    log(hash.out);
}

component main { public [ a ] } = Example();

/* INPUT = {
    "a": "5",
    "b": "77",
    "c": "385"
} */