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.

33 lines
606 B

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