arnaucube
arnaucube/circomlibPublic Self-hosted repository
fixed Multiplexer name and usage of old syntax
Ehud Ben-Reuven udi@benreuven.com
Sat, 23 Feb 2019 19:46:15 -0500
commit

39bb71678591922f2ff0aeda66fdd4e578b09d64

parent

77928872169b7179c9eee545afe0a972d15b1e64

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; - -