diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index adef325e..77522327 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,7 +8,7 @@ on: jobs: main_job: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 env: NIGHTLY_BUILD_FLAGS: "valgrind --leak-check=yes" @@ -20,10 +20,10 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true - name: Checkout uses: actions/checkout@v2 - - name: Set up Python 3.6 - uses: actions/setup-python@v1 - with: - python-version: 3.6 + # - name: Set up Python 3.6 + # uses: actions/setup-python@v1 + # with: + # python-version: 3.6 - name: Update apt run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test @@ -92,7 +92,7 @@ jobs: ./scripts/run_tools_test.sh linux_build_with_emscripten: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d0f50048..3489fb38 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ defaults: shell: bash jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: Extract repo name diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12933b1b..c1555ce7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ defaults: shell: bash jobs: linux_build_and_test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 steps: - name: Extract repo name @@ -180,7 +180,7 @@ jobs: ./dkg_attack linux_build_with_emscripten: - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 strategy: matrix: diff --git a/CMakeLists.txt b/CMakeLists.txt index 05a7091a..04650263 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ set( HUNTER_ENABLED OFF ) option(BUILD_TESTS "Build tests" ON) option(BUILD_WITH_FPIC "Build with -fPIC" OFF) +option(BUILD_UTILS "Build utils" ON) option( BLS_PROFILING "Build for profiling" OFF ) if( SKALED_PROFILING OR CONSENSUS_PROFILING ) @@ -179,63 +180,65 @@ target_link_libraries(bls PRIVATE ff ${CRYPTOPP_LIBRARY} ${GMPXX_LIBRARY} ${GMP_ add_subdirectory(threshold_encryption) -add_executable(dkg_keygen tools/dkg_key_gen.cpp) -target_include_directories(dkg_keygen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -if (EMSCRIPTEN) - target_compile_options(dkg_keygen PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) - set_target_properties(dkg_keygen PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") +if (BUILD_UTILS) + add_executable(dkg_keygen tools/dkg_key_gen.cpp) + target_include_directories(dkg_keygen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + if (EMSCRIPTEN) + target_compile_options(dkg_keygen PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) + set_target_properties(dkg_keygen PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") + endif() + + target_link_libraries(dkg_keygen PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) + + add_executable(dkg_glue tools/dkg_glue.cpp) + target_include_directories(dkg_glue PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + if (EMSCRIPTEN) + target_compile_options(dkg_glue PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) + set_target_properties(dkg_glue PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") + endif() + target_link_libraries(dkg_glue PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) + + add_executable(sign_bls tools/sign_bls.cpp) + target_include_directories(sign_bls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + if (EMSCRIPTEN) + target_compile_options(sign_bls PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) + set_target_properties(sign_bls PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") + endif() + target_link_libraries(sign_bls PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) + + add_executable(hash_g1 tools/hash_g1.cpp) + target_include_directories(hash_g1 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + if (EMSCRIPTEN) + target_compile_options(hash_g1 PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) + set_target_properties(hash_g1 PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") + endif() + target_link_libraries(hash_g1 PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) + + add_executable(bls_glue tools/bls_glue.cpp) + target_include_directories(bls_glue PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + if (EMSCRIPTEN) + target_compile_options(bls_glue PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) + set_target_properties(bls_glue PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") + endif() + target_link_libraries(bls_glue PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) + + add_executable(verify_bls tools/verify_bls.cpp) + target_include_directories(verify_bls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + if (EMSCRIPTEN) + target_compile_options(verify_bls PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) + set_target_properties(verify_bls PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") + endif() + target_link_libraries(verify_bls PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) + + add_executable(generate_key_system tools/generate_key_system.cpp) + target_include_directories(generate_key_system PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + if (EMSCRIPTEN) + target_compile_options(generate_key_system PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) + set_target_properties(generate_key_system PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") + endif() + target_link_libraries(generate_key_system PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) endif() -target_link_libraries(dkg_keygen PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) - -add_executable(dkg_glue tools/dkg_glue.cpp) -target_include_directories(dkg_glue PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -if (EMSCRIPTEN) - target_compile_options(dkg_glue PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) - set_target_properties(dkg_glue PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") -endif() -target_link_libraries(dkg_glue PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) - -add_executable(sign_bls tools/sign_bls.cpp) -target_include_directories(sign_bls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -if (EMSCRIPTEN) - target_compile_options(sign_bls PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) - set_target_properties(sign_bls PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") -endif() -target_link_libraries(sign_bls PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) - -add_executable(hash_g1 tools/hash_g1.cpp) -target_include_directories(hash_g1 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -if (EMSCRIPTEN) - target_compile_options(hash_g1 PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) - set_target_properties(hash_g1 PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") -endif() -target_link_libraries(hash_g1 PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) - -add_executable(bls_glue tools/bls_glue.cpp) -target_include_directories(bls_glue PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -if (EMSCRIPTEN) - target_compile_options(bls_glue PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) - set_target_properties(bls_glue PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") -endif() -target_link_libraries(bls_glue PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) - -add_executable(verify_bls tools/verify_bls.cpp) -target_include_directories(verify_bls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -if (EMSCRIPTEN) - target_compile_options(verify_bls PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) - set_target_properties(verify_bls PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") -endif() -target_link_libraries(verify_bls PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) - -add_executable(generate_key_system tools/generate_key_system.cpp) -target_include_directories(generate_key_system PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -if (EMSCRIPTEN) - target_compile_options(generate_key_system PRIVATE -s DISABLE_EXCEPTION_CATCHING=1) - set_target_properties(generate_key_system PROPERTIES LINK_FLAGS "-s DISABLE_EXCEPTION_CATCHING=1") -endif() -target_link_libraries(generate_key_system PRIVATE bls ${CRYPTOPP_LIBRARY} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS}) - if(BUILD_TESTS) add_executable(bls_unit_test test/unit_tests_bls.cpp) target_include_directories(bls_unit_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})