You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
531 B

5 years ago
  1. include "../../circuits/mux1.circom";
  2. include "../../circuits/bitify.circom";
  3. template Constants() {
  4. var i;
  5. signal output out[2];
  6. out[0] <== 37;
  7. out[1] <== 47;
  8. }
  9. template Main() {
  10. var i;
  11. signal private input selector;
  12. signal output out;
  13. component mux = Mux1();
  14. component n2b = Num2Bits(1);
  15. component cst = Constants();
  16. selector ==> n2b.in;
  17. n2b.out[0] ==> mux.s;
  18. for (i=0; i<2; i++) {
  19. cst.out[i] ==> mux.c[i];
  20. }
  21. mux.out ==> out;
  22. }
  23. component main = Main();