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.

31 lines
580 B

  1. include "../../circuits/bitify.circom"
  2. include "../../circuits/binsum.circom"
  3. template A() {
  4. signal private input a;
  5. signal input b;
  6. signal output out;
  7. var i;
  8. component n2ba = Num2Bits(32);
  9. component n2bb = Num2Bits(32);
  10. component sum = BinSum(32,2);
  11. component b2n = Bits2Num(32);
  12. n2ba.in <== a;
  13. n2bb.in <== b;
  14. for (i=0; i<32; i++) {
  15. sum.in[0][i] <== n2ba.out[i];
  16. sum.in[1][i] <== n2bb.out[i];
  17. }
  18. for (i=0; i<32; i++) {
  19. b2n.in[i] <== sum.out[i];
  20. }
  21. out <== b2n.out;
  22. }
  23. component main = A();