You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
570 B

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