Open this in zkREPL →
This file can be included into other zkREPLs with include "gist:4da9258b43fd3d2002567a6039eec68f";
Open this in zkREPL →
This file can be included into other zkREPLs with include "gist:4da9258b43fd3d2002567a6039eec68f";
pragma circom 2.0.3; | |
template Main() { | |
signal input a; | |
signal input b; | |
signal output c; | |
c <-- a + b; | |
// Constraints | |
c === a + b; | |
} | |
component main { public [ x2 ] } = Main(); | |
/* INPUT = { | |
"x1": "5", | |
"x2": "4", | |
"x3": "2", | |
"x4": "7" | |
} */ |
pragma circom 2.1.2; | |
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 output c; | |
var unused = 4; | |
c <== a * b; | |
assert(a > 2); | |
component hash = Poseidon(2); | |
hash.inputs[0] <== a; | |
hash.inputs[1] <== b; | |
log("hash", hash.out); | |
} | |
component main { public [ a ] } = Example(); | |
/* INPUT = { | |
"a": "5", | |
"b": "77" | |
} */ |