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.

21 lines
472 B

  1. template ManyConstraints(NUM_VARIABLES, NUM_CONSTRAINTS) {
  2. signal private input a;
  3. signal output c;
  4. assert(NUM_VARIABLES <= NUM_CONSTRAINTS)
  5. signal b[NUM_VARIABLES];
  6. b[0] <== a*a;
  7. var i;
  8. for (i = 1; i < NUM_VARIABLES; i++) {
  9. b[i] <== b[i-1]*b[i-1];
  10. }
  11. i = i-1;
  12. for (var j = NUM_VARIABLES; j < NUM_CONSTRAINTS; j++) {
  13. b[i] === b[i-1]*b[i-1];
  14. }
  15. c <== b[i];
  16. }
  17. component main = ManyConstraints(10000, 10000);