arnaucube
arnaucube/circomlibPublic Self-hosted repository
circomlib/test/rawsmt3.circom
test/rawsmt3.circomRaw
 1
 2include "../circuits/smt/smtverifier.circom";
 3template SMT(nLevels) {
 4  signal input root;
 5  signal input mtp[nLevels];
 6  signal input hi;
 7  signal input hv;
 8
 9  component smtClaimExists = SMTVerifier(nLevels);
10  smtClaimExists.enabled <== 1;
11  smtClaimExists.fnc <== 0;
12  smtClaimExists.root <== root;
13  for (var i=0; i<nLevels; i++) {
14      smtClaimExists.siblings[i] <==  mtp[i];
15  }
16  smtClaimExists.oldKey <== 0;
17  smtClaimExists.oldValue <== 0;
18  smtClaimExists.isOld0 <== 0;
19
20  smtClaimExists.key <== hi;
21  smtClaimExists.value <== hv;
22}
23component main = SMT(4);