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.

41 lines
710 B

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