Sparse Merkle tree working

This commit is contained in:
Jordi Baylina
2018-12-15 09:15:58 +01:00
parent 09f36d1e4d
commit 6d6558370f
7 changed files with 29 additions and 85588 deletions

View File

@@ -46,13 +46,6 @@ template SMTVerifier(nLevels) {
for (var i=0; i<nLevels; i++) smtLevIns.siblings[i] <== siblings[i];
smtLevIns.enabled <== 1;
component xors[nLevels];
for (var i=0; i<nLevels; i++) {
xors[i] = XOR();
xors[i].a <== n2bOld.out[i];
xors[i].b <== n2bNew.out[i];
}
component sm[nLevels];
for (var i=0; i<nLevels; i++) {
sm[i] = SMTVerifierSM();
@@ -70,11 +63,10 @@ template SMTVerifier(nLevels) {
sm[i].prev_na <== sm[i-1].st_na;
}
sm[i].is0 <== isOld0;
sm[i].xor <== xors[i].out;
sm[i].fnc <== fnc;
sm[i].levIns <== smtLevIns.levIns[i];
}
// sm[nLevels-1].st_na === 1;
sm[nLevels-1].st_na === 1;
component levels[nLevels];
for (var i=nLevels-1; i != -1; i--) {