diff --git a/circuits/compconstant.circom b/circuits/compconstant.circom index 96a6f1b..e7fb3f0 100644 --- a/circuits/compconstant.circom +++ b/circuits/compconstant.circom @@ -46,12 +46,11 @@ template CompConstant(ct) { slsb = in[i*2]; smsb = in[i*2+1]; - - if ((cmsb==0)&(clsb==0)) { + if ((cmsb==0)&&(clsb==0)) { parts[i] <== -b*smsb*slsb + b*smsb + b*slsb; - } else if ((cmsb==0)&(clsb==1)) { + } else if ((cmsb==0)&&(clsb==1)) { parts[i] <== a*smsb*slsb - a*slsb + b*smsb - a*smsb + a; - } else if ((cmsb==1)&(clsb==0)) { + } else if ((cmsb==1)&&(clsb==0)) { parts[i] <== b*smsb*slsb - a*smsb + a; } else { parts[i] <== -a*smsb*slsb + a; diff --git a/circuits/pointbits.circom b/circuits/pointbits.circom index ec4d2e7..9084a8e 100644 --- a/circuits/pointbits.circom +++ b/circuits/pointbits.circom @@ -61,7 +61,7 @@ function sqrt(n) { r = r*b; } - if (r > ((-1) >> 1)) { + if (r < 0 ) { r = -r; } diff --git a/test/smtprocessor.js b/test/smtprocessor.js index 8b418e5..8467073 100644 --- a/test/smtprocessor.js +++ b/test/smtprocessor.js @@ -104,8 +104,6 @@ describe("SMT Processor test", function () { await testInsert(tree, key, value, circuit); }); - - it("Should remove an element", async () => { await testDelete(tree, 111, circuit); await testDelete(tree, 333, circuit); @@ -207,5 +205,4 @@ describe("SMT Processor test", function () { await testUpdate(tree1, 9, 999, circuit); await testUpdate(tree1, 32, 323232, circuit); }); - });