mirror of
https://github.com/arnaucube/circom-compat.git
synced 2026-01-09 23:41:33 +01:00
feat: benchmarks (#3)
* add benchmark * chore: add complex circuit * feat: enable parallel / asm * bench: use pre-calculated matrices/constraints * chore: bump ethers-rs * chore: fmt * feat: add benches for differently sized circuits (#6) * feat: update bench circuit * feat: add benches for many sizes * fix: adjust bench parameters * fix: remove sym * chore: fmt * fix: point to correct commit of groth16 * fix: update function names to upstream * fix: update function names to upstream Co-authored-by: Kobi Gurkan <kobigurk@gmail.com>
This commit is contained in:
committed by
GitHub
parent
11e6d04f3b
commit
bb0f5429fc
21
test-vectors/complex-circuit/complex-circuit.circom.template
Normal file
21
test-vectors/complex-circuit/complex-circuit.circom.template
Normal file
@@ -0,0 +1,21 @@
|
||||
template ManyConstraints(NUM_VARIABLES, NUM_CONSTRAINTS) {
|
||||
signal private input a;
|
||||
signal output c;
|
||||
|
||||
assert(NUM_VARIABLES <= NUM_CONSTRAINTS)
|
||||
|
||||
signal b[NUM_VARIABLES];
|
||||
|
||||
b[0] <== a*a;
|
||||
var i;
|
||||
for (i = 1; i < NUM_VARIABLES; i++) {
|
||||
b[i] <== b[i-1]*b[i-1];
|
||||
}
|
||||
i = i-1;
|
||||
for (var j = NUM_VARIABLES; j < NUM_CONSTRAINTS; j++) {
|
||||
b[i] === b[i-1]*b[i-1];
|
||||
}
|
||||
c <== b[i];
|
||||
}
|
||||
|
||||
component main = ManyConstraints(NUM_VARIABLES_TEMPLATE, NUM_CONSTRAINTS_TEMPLATE);
|
||||
Reference in New Issue
Block a user