diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2b59da..451533c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,12 +73,143 @@ jobs: - name: Compile arithmetics example run: make -C ${ZKLLVM_BUILD:-build} arithmetics_cpp_example - - name: Build arithmetics circuit file and assignment table run: assigner -b build/src/arithmetics_cpp_example.ll -i zkLLVM/examples/inputs/arithmetics.inp --circuit arithmetics_cpp_example.crct --assignment-table arithmetics_cpp_example.tbl -e pallas - - name: Generate arithmetics proof run: proof-generator-single-threaded --circuit="arithmetics_cpp_example.crct" --assignment-table="arithmetics_cpp_example.tbl" --proof="arithmetics_cpp_example.bin" + - name: Compile ed25519_field_add example + run: make -C ${ZKLLVM_BUILD:-build} ed25519_field_add + - name: Build ed25519_field_add circuit file and assignment table + run: assigner -b build/src/ed25519_field_add.ll -i zkLLVM/examples/inputs/ed25519_field_add.inp --circuit ed25519_field_add.crct --assignment-table ed25519_field_add.tbl -e pallas + - name: Generate ed25519_field_add proof + run: proof-generator-single-threaded --circuit="ed25519_field_add.crct" --assignment-table="ed25519_field_add.tbl" --proof="ed25519_field_add.bin" + + - name: Compile ed25519_curve_add example + run: make -C ${ZKLLVM_BUILD:-build} ed25519_curve_add + - name: Build ed25519_curve_add circuit file and assignment table + run: assigner -b build/src/ed25519_curve_add.ll -i zkLLVM/examples/inputs/ed25519_curve_add.inp --circuit ed25519_curve_add.crct --assignment-table ed25519_curve_add.tbl -e pallas + - name: Generate ed25519_curve_add proof + run: proof-generator-single-threaded --circuit="ed25519_curve_add.crct" --assignment-table="ed25519_curve_add.tbl" --proof="ed25519_curve_add.bin" + + - name: Compile sha2_256 example + run: make -C ${ZKLLVM_BUILD:-build} sha2_256 + - name: Build sha2_256 circuit file and assignment table + run: assigner -b build/src/sha2_256.ll -i zkLLVM/examples/inputs/sha2_256.inp --circuit sha2_256.crct --assignment-table sha2_256.tbl -e pallas + - name: Generate sha2_256 proof + run: proof-generator-single-threaded --circuit="sha2_256.crct" --assignment-table="sha2_256.tbl" --proof="sha2_256.bin" + + - name: Compile merkle_poseidon_1prover example + run: make -C ${ZKLLVM_BUILD:-build} merkle_poseidon_1prover + - name: Build merkle_poseidon_1prover circuit file and assignment table + run: assigner -b build/src/merkle_poseidon_1prover.ll -i zkLLVM/examples/inputs/merkle_poseidon_1prover_public.inp -p zkLLVM/examples/inputs/merkle_poseidon_1prover_private.inp --circuit merkle_poseidon_1prover.crct --assignment-table merkle_poseidon_1prover.tbl -e pallas + - name: Generate merkle_poseidon_1prover proof + run: proof-generator-single-threaded --circuit="merkle_poseidon_1prover.crct" --assignment-table="merkle_poseidon_1prover.tbl" --proof="merkle_poseidon_1prover.bin" + + - name: Compile private_input_array example + run: make -C ${ZKLLVM_BUILD:-build} private_input_array + - name: Build private_input_array circuit file and assignment table + run: assigner -b build/src/private_input_array.ll -i zkLLVM/examples/inputs/private_input_array_public.inp -p zkLLVM/examples/inputs/private_input_array_private.inp --circuit private_input_array.crct --assignment-table private_input_array.tbl -e pallas + - name: Generate private_input_array proof + run: proof-generator-single-threaded --circuit="private_input_array.crct" --assignment-table="private_input_array.tbl" --proof="private_input_array.bin" + + - name: Compile poseidon example + run: make -C ${ZKLLVM_BUILD:-build} poseidon + - name: Build poseidon circuit file and assignment table + run: assigner -b build/src/poseidon.ll -i zkLLVM/examples/inputs/poseidon.inp --circuit poseidon.crct --assignment-table poseidon.tbl -e pallas + - name: Generate poseidon proof + run: proof-generator-single-threaded --circuit="poseidon.crct" --assignment-table="poseidon.tbl" --proof="poseidon.bin" + + - name: Compile placeholder_verifier example + run: make -C ${ZKLLVM_BUILD:-build} placeholder_verifier + - name: Build placeholder_verifier circuit file and assignment table + run: assigner -b build/src/placeholder_verifier.ll -i zkLLVM/examples/inputs/placeholder_verifier.inp --circuit placeholder_verifier.crct --assignment-table placeholder_verifier.tbl -e pallas + - name: Generate placeholder_verifier proof + run: proof-generator-single-threaded --circuit="placeholder_verifier.crct" --assignment-table="placeholder_verifier.tbl" --proof="placeholder_verifier.bin" + + - name: Compile bit_operations_shift_right example + run: make -C ${ZKLLVM_BUILD:-build} bit_operations_shift_right + - name: Build bit_operations_shift_right circuit file and assignment table + run: assigner -b build/src/bit_operations_shift_right.ll -i zkLLVM/examples/inputs/bit_operations/shift_right.inp --circuit bit_operations_shift_right.crct --assignment-table bit_operations_shift_right.tbl -e pallas + - name: Generate bit_operations_shift_right proof + run: proof-generator-single-threaded --circuit="bit_operations_shift_right.crct" --assignment-table="bit_operations_shift_right.tbl" --proof="bit_operations_shift_right.bin" + + - name: Compile bit_operations_bit_decomposition example + run: make -C ${ZKLLVM_BUILD:-build} bit_operations_bit_decomposition + - name: Build bit_operations_bit_decomposition circuit file and assignment table + run: assigner -b build/src/bit_operations_bit_decomposition.ll -i zkLLVM/examples/inputs/bit_operations/bit_decomposition.inp --circuit bit_operations_bit_decomposition.crct --assignment-table bit_operations_bit_decomposition.tbl -e pallas + - name: Generate bit_operations_bit_decomposition proof + run: proof-generator-single-threaded --circuit="bit_operations_bit_decomposition.crct" --assignment-table="bit_operations_bit_decomposition.tbl" --proof="bit_operations_bit_decomposition.bin" + + - name: Compile bit_operations_uint_division example + run: make -C ${ZKLLVM_BUILD:-build} bit_operations_uint_division + - name: Build bit_operations_uint_division circuit file and assignment table + run: assigner -b build/src/bit_operations_uint_division.ll -i zkLLVM/examples/inputs/bit_operations/uint_division.inp --circuit bit_operations_uint_division.crct --assignment-table bit_operations_uint_division.tbl -e pallas + - name: Generate bit_operations_uint_division proof + run: proof-generator-single-threaded --circuit="bit_operations_uint_division.crct" --assignment-table="bit_operations_uint_division.tbl" --proof="bit_operations_uint_division.bin" + + - name: Compile bit_operations_uint_remainder example + run: make -C ${ZKLLVM_BUILD:-build} bit_operations_uint_remainder + - name: Build bit_operations_uint_remainder circuit file and assignment table + run: assigner -b build/src/bit_operations_uint_remainder.ll -i zkLLVM/examples/inputs/bit_operations/uint_remainder.inp --circuit bit_operations_uint_remainder.crct --assignment-table bit_operations_uint_remainder.tbl -e pallas + - name: Generate bit_operations_uint_remainder proof + run: proof-generator-single-threaded --circuit="bit_operations_uint_remainder.crct" --assignment-table="bit_operations_uint_remainder.tbl" --proof="bit_operations_uint_remainder.bin" + + - name: Compile compare_lequal example + run: make -C ${ZKLLVM_BUILD:-build} compare_lequal + - name: Build compare_lequal circuit file and assignment table + run: assigner -b build/src/compare_lequal.ll -i zkLLVM/examples/inputs/compare/lequal.inp --circuit compare_lequal.crct --assignment-table compare_lequal.tbl -e pallas + - name: Generate compare_lequal proof + run: proof-generator-single-threaded --circuit="compare_lequal.crct" --assignment-table="compare_lequal.tbl" --proof="compare_lequal.bin" + + - name: Compile compare_neq example + run: make -C ${ZKLLVM_BUILD:-build} compare_neq + - name: Build compare_neq circuit file and assignment table + run: assigner -b build/src/compare_neq.ll -i zkLLVM/examples/inputs/compare/neq.inp --circuit compare_neq.crct --assignment-table compare_neq.tbl -e pallas + - name: Generate compare_neq proof + run: proof-generator-single-threaded --circuit="compare_neq.crct" --assignment-table="compare_neq.tbl" --proof="compare_neq.bin" + + - name: Compile compare_eq example + run: make -C ${ZKLLVM_BUILD:-build} compare_eq + - name: Build compare_eq circuit file and assignment table + run: assigner -b build/src/compare_eq.ll -i zkLLVM/examples/inputs/compare/eq.inp --circuit compare_eq.crct --assignment-table compare_eq.tbl -e pallas + - name: Generate compare_eq proof + run: proof-generator-single-threaded --circuit="compare_eq.crct" --assignment-table="compare_eq.tbl" --proof="compare_eq.bin" + + - name: Compile validate_merkle_path_sha2_256 example + run: make -C ${ZKLLVM_BUILD:-build} validate_merkle_path_sha2_256 + - name: Build validate_merkle_path_sha2_256 circuit file and assignment table + run: assigner -b build/src/validate_merkle_path_sha2_256.ll -i zkLLVM/examples/inputs/validate_merkle_path_sha2_256.inp --circuit validate_merkle_path_sha2_256.crct --assignment-table validate_merkle_path_sha2_256.tbl -e pallas + - name: Generate validate_merkle_path_sha2_256 proof + run: proof-generator-single-threaded --circuit="validate_merkle_path_sha2_256.crct" --assignment-table="validate_merkle_path_sha2_256.tbl" --proof="validate_merkle_path_sha2_256.bin" + + - name: Compile eddsa_signature_verification example + run: make -C ${ZKLLVM_BUILD:-build} eddsa_signature_verification + - name: Build eddsa_signature_verification circuit file and assignment table + run: assigner -b build/src/eddsa_signature_verification.ll -i zkLLVM/examples/inputs/eddsa_signature_verification.inp --circuit eddsa_signature_verification.crct --assignment-table eddsa_signature_verification.tbl -e pallas + - name: Generate eddsa_signature_verification proof + run: proof-generator-single-threaded --circuit="eddsa_signature_verification.crct" --assignment-table="eddsa_signature_verification.tbl" --proof="eddsa_signature_verification.bin" + + - name: Compile balances_tree example + run: make -C ${ZKLLVM_BUILD:-build} balances_tree + - name: Build balances_tree circuit file and assignment table + run: assigner -b build/src/balances_tree.ll -i zkLLVM/examples/inputs/balances_tree_public.inp -p zkLLVM/examples/inputs/balances_tree_private.inp --circuit balances_tree.crct --assignment-table balances_tree.tbl -e pallas + - name: Generate balances_tree proof + run: proof-generator-single-threaded --circuit="balances_tree.crct" --assignment-table="balances_tree.tbl" --proof="balances_tree.bin" + + - name: Compile sha2_512 example + run: make -C ${ZKLLVM_BUILD:-build} sha2_512 + - name: Build sha2_512 circuit file and assignment table + run: assigner -b build/src/sha2_512.ll -i zkLLVM/examples/inputs/sha2_512.inp --circuit sha2_512.crct --assignment-table sha2_512.tbl -e pallas + - name: Generate sha2_512 proof + run: proof-generator-single-threaded --circuit="sha2_512.crct" --assignment-table="sha2_512.tbl" --proof="sha2_512.bin" + + - name: Compile pallas_curve_examples_pallas_curve_add example + run: make -C ${ZKLLVM_BUILD:-build} pallas_curve_examples_pallas_curve_add + - name: Build pallas_curve_examples_pallas_curve_add circuit file and assignment table + run: assigner -b build/src/pallas_curve_examples_pallas_curve_add.ll -i zkLLVM/examples/inputs/pallas_curve_examples/pallas_curve_add.inp --circuit pallas_curve_examples_pallas_curve_add.crct --assignment-table pallas_curve_examples_pallas_curve_add.tbl -e pallas + - name: Generate pallas_curve_examples_pallas_curve_add proof + run: proof-generator-single-threaded --circuit="pallas_curve_examples_pallas_curve_add.crct" --assignment-table="pallas_curve_examples_pallas_curve_add.tbl" --proof="pallas_curve_examples_pallas_curve_add.bin" + # - name: Build circuit parameters for EVM verifier endpoint # run: scripts/run.sh --verbose --docker build_circuit_params diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e00078..316011d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,4 +47,21 @@ if(CI_RUN) add_example(ed25519_curve_add SOURCES "../zkLLVM/examples/cpp/ed25519_curve_add.cpp") add_example(sha2_256 SOURCES "../zkLLVM/examples/cpp/sha2_256.cpp") add_example(merkle_poseidon_1prover SOURCES "../zkLLVM/examples/cpp/merkle_poseidon_1prover.cpp") + add_example(private_input_array SOURCES "../zkLLVM/examples/cpp/private_input_array.cpp") + add_example(poseidon SOURCES "../zkLLVM/examples/cpp/poseidon.cpp") + add_example(placeholder_verifier SOURCES "../zkLLVM/examples/cpp/placeholder_verifier.cpp") + add_example(merkle_poseidon_21prover_3layers SOURCES "../zkLLVM/examples/cpp/merkle_poseidon_21prover_3layers.cpp") + add_example(bit_operations_shift_right SOURCES "../zkLLVM/examples/cpp/bit_operations/shift_right.cpp") + add_example(bit_operations_bit_decomposition SOURCES "../zkLLVM/examples/cpp/bit_operations/bit_decomposition.cpp") + add_example(bit_operations_uint_division SOURCES "../zkLLVM/examples/cpp/bit_operations/uint_division.cpp") + add_example(bit_operations_uint_remainder SOURCES "../zkLLVM/examples/cpp/bit_operations/uint_remainder.cpp") + add_example(compare_lequal SOURCES "../zkLLVM/examples/cpp/compare/lequal.cpp") + add_example(compare_neq SOURCES "../zkLLVM/examples/cpp/compare/neq.cpp") + add_example(compare_eq SOURCES "../zkLLVM/examples/cpp/compare/eq.cpp") + add_example(validate_merkle_path_sha2_256 SOURCES "../zkLLVM/examples/cpp/validate_merkle_path_sha2_256.cpp") + add_example(eddsa_signature_verification SOURCES "../zkLLVM/examples/cpp/eddsa_signature_verification.cpp") + add_example(balances_tree SOURCES "../zkLLVM/examples/cpp/balances_tree.cpp") + add_example(sha2_512 SOURCES "../zkLLVM/examples/cpp/sha2_512.cpp") + add_example(pallas_curve_examples_pallas_curve_add SOURCES "../zkLLVM/examples/cpp/pallas_curve_examples/pallas_curve_add.cpp") + endif()