arnaucube
arnaucube/circomlibPublic Self-hosted repository
Merge pull request #5 from udibr/multiplexer

fixed Multiplexer name and usage of old syntax
Jordi Baylina jordi@baylina.cat
Sat, 11 May 2019 21:04:17 +0200
commit

d91afa804ace6481f4468eebc0bf55229771e24c

parent

1da1f5886fdd703a02088b4dc95b58b0245ee3a8

1 files changed, 8 insertions(+), 7 deletions(-)

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

@@ -90,12 +90,17 @@ success * (success -1) === 0;

} -template Multiplexor(wIn, nIn) { +template Multiplexer(wIn, nIn) { signal input inp[nIn][wIn]; signal input sel; signal output out[wIn]; - component Decoder(nIn) dec; - component EscalarProduct(nIn) ep[wIn]; + component dec = Decoder(nIn); + component ep[wIn]; + + for (var k=0; k<wIn; k++) { + ep[k] = EscalarProduct(nIn); + } + sel ==> dec.inp; for (var j=0; j<wIn; j++) { for (var k=0; k<nIn; k++) {

@@ -106,7 +111,3 @@ ep[j].out ==> out[j];

} dec.success === 1; } - -component Multiplexor(8,3) main; - -