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.

33 lines
554 B

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