Comment on page
Installation
Adding crypto3 suite to your project
- 1.Generic.
- 2.Selective.
The suite is used as a header-only and is currently statically linked. Future versions will allow dynamic linking.
The suite is compatible with x86 and ARM architectures
The generic module can be added to your C++ project as follows
git submodule add https://github.com/NilFoundation/crypto3.git <dir>
The developer can select to include one or more modules to reduce the sources of resulting project and dependencies tree height. This, however, does require the developer to manually resolve all required dependencies and stay up-to-date regarding compatibility across modules.
Selective modules can be added to your project as follows:
git submodule add https://github.com/NilFoundation/crypto3-<lib>.git <dir>
To compile anything in crypto3, you need a directory containing the crypto3 sub-module directory in your
#include
path. Since all of the crypto3 header files have the .hpp
extension, and live in the crypto3\<lib>
sub-directory of the crypto3 root, your crypto3 include directives will look like#include <nil/crypto3/pubkey/algorithm/sign.hpp>
We recommend using CMake to provide paths/linker flags.
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/<submodule-directory>")
Linker commands
target_link_libraries(${PROJECT_TARGET} <crypto3_library>)
Example:
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/libs/crypto3")
target_link_libraries(${PROJECT_TARGET} crypto3::algebra)
Last modified 7mo ago