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.

27 lines
751 B

  1. include "../../node_modules/circomlib/circuits/comparators.circom";
  2. include "../../node_modules/circomlib/circuits/poseidon.circom";
  3. include "../../node_modules/circomlib/circuits/smt/smtverifier.circom";
  4. template SMTVerifierTest(nLevels) {
  5. signal input key;
  6. signal input value;
  7. signal input fnc;
  8. signal private input oldKey;
  9. signal private input oldValue;
  10. signal private input isOld0;
  11. signal private input siblings[nLevels];
  12. signal input root;
  13. component smtV = SMTVerifier(nLevels);
  14. smtV.enabled <== 1;
  15. smtV.fnc <== fnc;
  16. smtV.root <== root;
  17. for (var i=0; i<nLevels; i++) {
  18. smtV.siblings[i] <== siblings[i];
  19. }
  20. smtV.oldKey <== oldKey;
  21. smtV.oldValue <== oldValue;
  22. smtV.isOld0 <== isOld0;
  23. smtV.key <== key;
  24. smtV.value <== value;
  25. }