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.

54 lines
1.3 KiB

5 years ago
5 years ago
5 years ago
5 years ago
  1. template Internal() {
  2. signal input in1;
  3. signal input in2[2];
  4. signal input in3[3][2];
  5. signal output out1;
  6. signal output out2[2];
  7. signal output out3[3][2];
  8. out1 <== in1;
  9. out2[0] <== in2[0];
  10. out2[1] <== in2[1];
  11. out3[0][0] <== in3[0][0];
  12. out3[0][1] <== in3[0][1];
  13. out3[1][0] <== in3[1][0];
  14. out3[1][1] <== in3[1][1];
  15. out3[2][0] <== in3[2][0];
  16. out3[2][1] <== in3[2][1];
  17. }
  18. template InOut() {
  19. signal input in1;
  20. signal input in2[2];
  21. signal input in3[3][2];
  22. signal output out1;
  23. signal output out2[2];
  24. signal output out3[3][2];
  25. component internal = Internal();
  26. internal.in1 <== in1;
  27. internal.in2[0] <== in2[0];
  28. internal.in2[1] <== in2[1];
  29. internal.in3[0][0] <== in3[0][0];
  30. internal.in3[0][1] <== in3[0][1];
  31. internal.in3[1][0] <== in3[1][0];
  32. internal.in3[1][1] <== in3[1][1];
  33. internal.in3[2][0] <== in3[2][0];
  34. internal.in3[2][1] <== in3[2][1];
  35. internal.out1 ==> out1;
  36. internal.out2[0] ==> out2[0];
  37. internal.out2[1] ==> out2[1];
  38. internal.out3[0][0] ==> out3[0][0];
  39. internal.out3[0][1] ==> out3[0][1];
  40. internal.out3[1][0] ==> out3[1][0];
  41. internal.out3[1][1] ==> out3[1][1];
  42. internal.out3[2][0] ==> out3[2][0];
  43. internal.out3[2][1] ==> out3[2][1];
  44. }
  45. component main = InOut();