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.

50 lines
631 B

6 years ago
  1. /*
  2. include "sha256_2.jaz";
  3. component main = SHA256_2();
  4. */
  5. /*
  6. include "constants.jaz"
  7. template A() {
  8. signal input in;
  9. component h0;
  10. h0 = K(8);
  11. var lc = 0;
  12. var e = 1;
  13. for (var i=0; i<32; i++) {
  14. lc = lc + e*h0.out[i];
  15. e *= 2;
  16. }
  17. lc === in;
  18. }
  19. component main = A();
  20. */
  21. include "bitify.jaz"
  22. template A() {
  23. signal input in;
  24. signal output out;
  25. component n2b;
  26. component b2n;
  27. n2b = Num2Bits(216);
  28. b2n = Bits2Num(216);
  29. n2b.in <== in;
  30. for (var i=0; i<216; i++) {
  31. b2n.in[i] <== n2b.out[i];
  32. }
  33. out <== b2n.out;
  34. }
  35. component main = A();