Skip to content

Commit

Permalink
Merge pull request #152 from skalenetwork/feature/SKALE-4472-encrypt-…
Browse files Browse the repository at this point in the history
…message-with-aes

Feature/skale 4472 encrypt message with aes
  • Loading branch information
olehnikolaiev authored Aug 19, 2021
2 parents c7c5c84 + 0ea6740 commit 7e865a8
Show file tree
Hide file tree
Showing 18 changed files with 1,012 additions and 417 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
cd build
$NIGHTLY_BUILD_FLAGS ./bls_unit_test
$NIGHTLY_BUILD_FLAGS ./dkg_unit_test
$NIGHTLY_BUILD_FLAGS ./utils_unit_test
$NIGHTLY_BUILD_FLAGS ./bls_test
$NIGHTLY_BUILD_FLAGS ./threshold_encryption/te_unit_test
$NIGHTLY_BUILD_FLAGS ./threshold_encryption/te_test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
cd build
./bls_unit_test
./dkg_unit_test
./utils_unit_test
./bls_test
./threshold_encryption/te_unit_test
./threshold_encryption/te_test
Expand Down
34 changes: 21 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ list( APPEND CMAKE_MODULE_PATH ${LIBBLS_CMAKE_DIR} )

find_library( GMP_LIBRARY NAMES "gmp" PATHS "${DEPS_INSTALL_ROOT}/lib" )
find_library( GMPXX_LIBRARY NAMES "gmpxx" PATHS "${DEPS_INSTALL_ROOT}/lib" )
find_library( CRYPTOPP NAMES "crypto" PATHS "${DEPS_INSTALL_ROOT}/lib" )

set( HUNTER_ENABLED OFF )

Expand Down Expand Up @@ -134,70 +135,77 @@ set(BLS_INCLUDE_DIRS
)

target_include_directories(bls PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(bls PRIVATE ff ${GMPXX_LIBRARY} ${GMP_LIBRARY})
target_link_libraries(bls PRIVATE ff ${CRYPTOPP} ${GMPXX_LIBRARY} ${GMP_LIBRARY})

add_subdirectory(threshold_encryption)

add_executable(dkg_keygen tools/dkg_key_gen.cpp)
target_include_directories(dkg_keygen PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

target_link_libraries(dkg_keygen PRIVATE bls ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(dkg_keygen PRIVATE bls ${CRYPTOPP} 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})
target_link_libraries(dkg_glue PRIVATE bls ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(dkg_glue PRIVATE bls ${CRYPTOPP} 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})
target_link_libraries(sign_bls PRIVATE bls ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(sign_bls PRIVATE bls ${CRYPTOPP} 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})
target_link_libraries(hash_g1 PRIVATE bls ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(hash_g1 PRIVATE bls ${CRYPTOPP} 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})
target_link_libraries(bls_glue PRIVATE bls ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(bls_glue PRIVATE bls ${CRYPTOPP} 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})
target_link_libraries(verify_bls PRIVATE bls ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(verify_bls PRIVATE bls ${CRYPTOPP} 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})
target_link_libraries(generate_key_system PRIVATE bls ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(generate_key_system PRIVATE bls ${CRYPTOPP} 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})
target_link_libraries(bls_unit_test PRIVATE bls ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(bls_unit_test PRIVATE bls ${CRYPTOPP} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})

add_test(NAME bls_tests COMMAND bls_unit_test)

add_executable(dkg_unit_test test/unit_tests_dkg.cpp)
target_include_directories(dkg_unit_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(dkg_unit_test PRIVATE bls ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(dkg_unit_test PRIVATE bls ${CRYPTOPP} ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} ${BOOST_LIBS_4_BLS})

add_test(NAME dkg_tests COMMAND dkg_unit_test)

add_executable(bls_test test/test_bls.cpp)
target_include_directories(bls_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(bls_test PRIVATE bls ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(bls_test PRIVATE bls ${CRYPTOPP} ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} ${BOOST_LIBS_4_BLS})

add_test(NAME bls_test COMMAND bls_test)

add_executable(dkg_attack test/dkg_attack.cpp)
target_include_directories(dkg_attack PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(dkg_attack PRIVATE bls ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} ${BOOST_LIBS_4_BLS})
target_link_libraries(dkg_attack PRIVATE bls ${CRYPTOPP} ff ${GMP_LIBRARY} ${GMPXX_LIBRARY} ${BOOST_LIBS_4_BLS})

add_test(NAME dkg_attack COMMAND dkg_attack)

add_executable(utils_unit_test test/unit_tests_utils.cpp)
target_include_directories(utils_unit_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(utils_unit_test PRIVATE bls te ${CRYPTOPP} ff ${GMPXX_LIBRARY} ${GMP_LIBRARY} ${BOOST_LIBS_4_BLS})

add_test(NAME utils_tests COMMAND utils_unit_test)

add_custom_target(all_bls_tests
COMMAND ./bls_unit_test
COMMAND ./dkg_unit_test
COMMAND ./bls_test
COMMAND ./dkg_attack
COMMAND ./dkg_attack
COMMAND ./utils_unit_test
DEPENDS bls_unit_test dkg_unit_test
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Run all BLS and DKG tests"
Expand Down
2 changes: 1 addition & 1 deletion deps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ then
export KERNEL_BITS=64
./Configure darwin64-x86_64-cc -fPIC no-shared --prefix="$INSTALL_ROOT"
else
./config -fPIC no-shared --prefix="$INSTALL_ROOT" --openssldir="$INSTALL_ROOT"
./config -fPIC --prefix="$INSTALL_ROOT" --openssldir="$INSTALL_ROOT"
fi
else
./Configure linux-armv4 --prefix="$INSTALL_ROOT" "${ADDITIONAL_INCLUDES}" "${ADDITIONAL_LIBRARIES}" no-shared no-tests no-dso
Expand Down
Loading

0 comments on commit 7e865a8

Please sign in to comment.