add nItems var, fixes CVF-30
This commit is contained in:
parent
73b9369abc
commit
e8954ec6ce
@ -4,11 +4,12 @@ include "./MerkleTreeUpdater.circom";
|
|||||||
include "./Utils.circom";
|
include "./Utils.circom";
|
||||||
|
|
||||||
template TreeLayer(height) {
|
template TreeLayer(height) {
|
||||||
signal input ins[1 << (height + 1)];
|
var nItems = 1 << height;
|
||||||
signal output outs[1 << height];
|
signal input ins[nItems * 2];
|
||||||
|
signal output outs[nItems];
|
||||||
|
|
||||||
component hash[1 << height];
|
component hash[nItems];
|
||||||
for(var i = 0; i < (1 << height); i++) {
|
for(var i = 0; i < nItems; i++) {
|
||||||
hash[i] = HashLeftRight();
|
hash[i] = HashLeftRight();
|
||||||
hash[i].left <== ins[i * 2];
|
hash[i].left <== ins[i * 2];
|
||||||
hash[i].right <== ins[i * 2 + 1];
|
hash[i].right <== ins[i * 2 + 1];
|
||||||
|
Loading…
Reference in New Issue
Block a user