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.

37 lines
631 B

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