mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-04-26 01:49:25 -04:00
rename multiplexor
This commit is contained in:
parent
e6a4208b52
commit
c0e81f2a37
@ -15,7 +15,7 @@ template HashLeftRight() {
|
|||||||
|
|
||||||
// if s == 0 returns [in[0], in[1]]
|
// if s == 0 returns [in[0], in[1]]
|
||||||
// if s == 1 returns [in[1], in[0]]
|
// if s == 1 returns [in[1], in[0]]
|
||||||
template Mux() {
|
template DualMux() {
|
||||||
signal input in[2];
|
signal input in[2];
|
||||||
signal input s;
|
signal input s;
|
||||||
signal output out[2];
|
signal output out[2];
|
||||||
@ -36,7 +36,7 @@ template MerkleTree(levels) {
|
|||||||
component hashers[levels];
|
component hashers[levels];
|
||||||
|
|
||||||
for (var i = 0; i < levels; i++) {
|
for (var i = 0; i < levels; i++) {
|
||||||
selectors[i] = Mux();
|
selectors[i] = DualMux();
|
||||||
selectors[i].in[0] <== i == 0 ? leaf : hashers[i - 1].hash;
|
selectors[i].in[0] <== i == 0 ? leaf : hashers[i - 1].hash;
|
||||||
selectors[i].in[1] <== pathElements[i];
|
selectors[i].in[1] <== pathElements[i];
|
||||||
selectors[i].s <== pathIndices[i];
|
selectors[i].s <== pathIndices[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user