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.

25 lines
524 B

6 years ago
  1. include "gates.jaz";
  2. include "rotate.jaz";
  3. template Sigma(ra, rb, rc) {
  4. signal input in;
  5. signal output out;
  6. component xor3 = Xor3(32);
  7. component rota = RotR(32, ra);
  8. component rotb = RotR(32, rb);
  9. component rotc = RotR(32, rc);
  10. for (var k=0; k<32; k++) {
  11. rota.in[k] <== in[k];
  12. rotb.in[k] <== in[k];
  13. rotc.in[k] <== in[k];
  14. xor3.a[k] <== rota.out[k];
  15. xor3.b[k] <== rotb.out[k];
  16. xor3.c[k] <== rotc.out[k];
  17. out[k] <== xor3.out[k];
  18. }
  19. }