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.

42 lines
1.2 KiB

  1. #!/bin/sh
  2. compile_and_ts_and_witness() {
  3. echo $(date +"%T") "circom circuit.circom --r1cs --wasm --sym"
  4. itime="$(date -u +%s)"
  5. circom circuit.circom --r1cs --wasm --sym
  6. ftime="$(date -u +%s)"
  7. echo " ($(($(date -u +%s)-$itime))s)"
  8. echo $(date +"%T") "snarkjs info -r circuit.r1cs"
  9. snarkjs info -r circuit.r1cs
  10. echo $(date +"%T") "snarkjs setup"
  11. itime="$(date -u +%s)"
  12. snarkjs setup
  13. echo " ($(($(date -u +%s)-$itime))s)"
  14. echo $(date +"%T") "trusted setup generated"
  15. sed -i 's/null/["0","0","0"]/g' proving_key.json
  16. echo "calculating witness"
  17. snarkjs calculatewitness --wasm circuit.wasm --input inputs.json --witness witness.json
  18. echo $(date +"%T") "snarkjs generateverifier"
  19. itime="$(date -u +%s)"
  20. snarkjs generateverifier
  21. echo " ($(($(date -u +%s)-$itime))s)"
  22. echo $(date +"%T") "generateverifier generated"
  23. }
  24. echo "compile & trustesetup for circuit1k"
  25. cd circuit1k
  26. compile_and_ts_and_witness
  27. echo "compile & trustesetup for circuit5k"
  28. cd ../circuit5k
  29. compile_and_ts_and_witness
  30. # echo "compile & trustesetup for circuit10k"
  31. # cd ../circuit10k
  32. # compile_and_ts_and_witness
  33. # echo "compile & trustesetup for circuit20k"
  34. # cd ../circuit20k
  35. # compile_and_ts_and_witness