diff --git a/proof_of_leadership/leadership_anemoi.circom b/proof_of_leadership/leadership_anemoi.circom index 247c54a..e39e6e7 100644 --- a/proof_of_leadership/leadership_anemoi.circom +++ b/proof_of_leadership/leadership_anemoi.circom @@ -207,8 +207,8 @@ template membership_checker(){ hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf); 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[1] <== node[i] - index[31] * (node[i] - hash[i-1].out); + 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-i] * (node[i] - hash[i-1].out); } root === hash[31].out; diff --git a/proof_of_leadership/leadership_anemoi_sha.circom b/proof_of_leadership/leadership_anemoi_sha.circom index 31dae49..ed04d75 100644 --- a/proof_of_leadership/leadership_anemoi_sha.circom +++ b/proof_of_leadership/leadership_anemoi_sha.circom @@ -223,8 +223,8 @@ template membership_checker(){ hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf); 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[1] <== node[i] - index[31] * (node[i] - hash[i-1].out); + 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-i] * (node[i] - hash[i-1].out); } root === hash[31].out; diff --git a/proof_of_leadership/leadership_poseidon.circom b/proof_of_leadership/leadership_poseidon.circom index d142254..411c015 100644 --- a/proof_of_leadership/leadership_poseidon.circom +++ b/proof_of_leadership/leadership_poseidon.circom @@ -207,8 +207,8 @@ template membership_checker(){ hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf); 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[1] <== node[i] - index[31] * (node[i] - hash[i-1].out); + 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-i] * (node[i] - hash[i-1].out); } root === hash[31].out; diff --git a/proof_of_leadership/leadership_poseidon_sha.circom b/proof_of_leadership/leadership_poseidon_sha.circom index 1f6e709..b6ea34b 100644 --- a/proof_of_leadership/leadership_poseidon_sha.circom +++ b/proof_of_leadership/leadership_poseidon_sha.circom @@ -224,8 +224,8 @@ template membership_checker(){ hash[0].in[1] <== node[0] - index[31] * (node[0] - leaf); 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[1] <== node[i] - index[31] * (node[i] - hash[i-1].out); + 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-i] * (node[i] - hash[i-1].out); } //root === hash[31].out;