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.

28 lines
900 B

  1. include "../../node_modules/circomlib/circuits/comparators.circom";
  2. include "../../node_modules/circomlib/circuits/poseidon.circom";
  3. include "../../node_modules/circomlib/circuits/smt/smtprocessor.circom";
  4. template SMTProcessorTest(nLevels) {
  5. signal input newKey;
  6. signal input newValue;
  7. signal private input oldKey;
  8. signal private input oldValue;
  9. signal private input isOld0;
  10. signal private input siblings[nLevels];
  11. signal input oldRoot;
  12. signal input newRoot;
  13. component smtProcessor = SMTProcessor(nLevels);
  14. smtProcessor.oldRoot <== oldRoot;
  15. smtProcessor.newRoot <== newRoot;
  16. for (var i=0; i<nLevels; i++) {
  17. smtProcessor.siblings[i] <== siblings[i];
  18. }
  19. smtProcessor.oldKey <== oldKey;
  20. smtProcessor.oldValue <== oldValue;
  21. smtProcessor.isOld0 <== isOld0;
  22. smtProcessor.newKey <== newKey;
  23. smtProcessor.newValue <== newValue;
  24. smtProcessor.fnc[0] <== 1;
  25. smtProcessor.fnc[1] <== 0;
  26. }