arnaucube
arnaucube/circomlibPublic Self-hosted repository
Negative numbers and fix in comparator
Jordi Baylina jordi@baylina.cat
Mon, 16 Mar 2020 20:41:11 +0100
commit

273ab7966526a7be7821d18e96c49acc4973a087

parent

cf6d1f0bb16b141891ed52aef890661b32653a0c

3 files changed, 4 insertions(+), 8 deletions(-)

jump to
M circuits/compconstant.circom → circuits/compconstant.circom

@@ -46,12 +46,11 @@ cmsb = (ct >> (i*2+1)) & 1;

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;
M circuits/pointbits.circom → circuits/pointbits.circom

@@ -61,7 +61,7 @@ t = t*c;

r = r*b; } - if (r > ((-1) >> 1)) { + if (r < 0 ) { r = -r; }
M test/smtprocessor.js → test/smtprocessor.js

@@ -104,8 +104,6 @@

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 @@ await testUpdate(tree1, 8, 888, circuit);

await testUpdate(tree1, 9, 999, circuit); await testUpdate(tree1, 32, 323232, circuit); }); - });