mirror of
https://github.com/logos-co/nomos-pocs.git
synced 2025-01-11 09:56:11 +00:00
fix membership checker with correct indexes
This commit is contained in:
parent
ca2ff45255
commit
cbb0359ad9
@ -207,8 +207,8 @@ template membership_checker(){
|
|||||||
hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf);
|
hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf);
|
||||||
|
|
||||||
for(var i=1; i<32; i++){
|
for(var i=1; i<32; i++){
|
||||||
hash[i].in[0] <== hash[i-1].out - index[31] * (hash[i-1].out - node[i]);
|
hash[i].in[0] <== hash[i-1].out - index[31-i] * (hash[i-1].out - node[i]);
|
||||||
hash[i].in[1] <== node[i] - index[31] * (node[i] - hash[i-1].out);
|
hash[i].in[1] <== node[i] - index[31-i] * (node[i] - hash[i-1].out);
|
||||||
}
|
}
|
||||||
|
|
||||||
root === hash[31].out;
|
root === hash[31].out;
|
||||||
|
@ -223,8 +223,8 @@ template membership_checker(){
|
|||||||
hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf);
|
hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf);
|
||||||
|
|
||||||
for(var i=1; i<32; i++){
|
for(var i=1; i<32; i++){
|
||||||
hash[i].in[0] <== hash[i-1].out - index[31] * (hash[i-1].out - node[i]);
|
hash[i].in[0] <== hash[i-1].out - index[31-i] * (hash[i-1].out - node[i]);
|
||||||
hash[i].in[1] <== node[i] - index[31] * (node[i] - hash[i-1].out);
|
hash[i].in[1] <== node[i] - index[31-i] * (node[i] - hash[i-1].out);
|
||||||
}
|
}
|
||||||
|
|
||||||
root === hash[31].out;
|
root === hash[31].out;
|
||||||
|
@ -207,8 +207,8 @@ template membership_checker(){
|
|||||||
hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf);
|
hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf);
|
||||||
|
|
||||||
for(var i=1; i<32; i++){
|
for(var i=1; i<32; i++){
|
||||||
hash[i].in[0] <== hash[i-1].out - index[31] * (hash[i-1].out - node[i]);
|
hash[i].in[0] <== hash[i-1].out - index[31-i] * (hash[i-1].out - node[i]);
|
||||||
hash[i].in[1] <== node[i] - index[31] * (node[i] - hash[i-1].out);
|
hash[i].in[1] <== node[i] - index[31-i] * (node[i] - hash[i-1].out);
|
||||||
}
|
}
|
||||||
|
|
||||||
root === hash[31].out;
|
root === hash[31].out;
|
||||||
|
@ -224,8 +224,8 @@ template membership_checker(){
|
|||||||
hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf);
|
hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf);
|
||||||
|
|
||||||
for(var i=1; i<32; i++){
|
for(var i=1; i<32; i++){
|
||||||
hash[i].in[0] <== hash[i-1].out - index[31] * (hash[i-1].out - node[i]);
|
hash[i].in[0] <== hash[i-1].out - index[31-i] * (hash[i-1].out - node[i]);
|
||||||
hash[i].in[1] <== node[i] - index[31] * (node[i] - hash[i-1].out);
|
hash[i].in[1] <== node[i] - index[31-i] * (node[i] - hash[i-1].out);
|
||||||
}
|
}
|
||||||
|
|
||||||
//root === hash[31].out;
|
//root === hash[31].out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user