/* SMTVerifier is a component to verify inclusion/exclusion of an element in the tree fnc: 0 -> VERIFY INCLUSION 1 -> VERIFY NOT INCLUSION */ include "../gates.circom"; include "../bitify.circom"; include "../comparators.circom"; include "../switcher.circom"; include "smtlevins.circom"; include "smtverifierlevel.circom"; include "smtverifiersm.circom"; include "smthash.circom"; template SMTVerifier(nLevels) { signal input root; signal input siblings[nLevels]; signal input oldKey; signal input oldValue; signal input isOld0; signal input key; signal input value; signal input fnc; component hash1Old = SMTHash1(); hash1Old.key <== oldKey; hash1Old.value <== oldValue; component hash1New = SMTHash1(); hash1New.key <== key; hash1New.value <== value; component n2bOld = Num2Bits_strict(); component n2bNew = Num2Bits_strict(); n2bOld.in <== oldKey; n2bNew.in <== key; component smtLevIns = SMTLevIns(nLevels); for (var i=0; i