Skip to content

Integration

vano edited this page Feb 22, 2026 · 2 revisions

Integration

CMake (add_subdirectory)

The simplest way to integrate:

# In your CMakeLists.txt
add_subdirectory(external/UltrafastSecp256k1)
target_link_libraries(your_target PRIVATE UltrafastSecp256k1::cpu)

Or with FetchContent:

include(FetchContent)
FetchContent_Declare(
  UltrafastSecp256k1
  GIT_REPOSITORY https://github.com/shrec/Secp256K1fast.git
  GIT_TAG v3.3.0
)
FetchContent_MakeAvailable(UltrafastSecp256k1)
target_link_libraries(your_target PRIVATE UltrafastSecp256k1::cpu)

CMake (find_package)

After installing:

cmake --install build --prefix /usr/local
find_package(UltrafastSecp256k1 3.3.0 REQUIRED)
target_link_libraries(your_target PRIVATE UltrafastSecp256k1::cpu)

vcpkg

// vcpkg.json
{
  "dependencies": ["ultrafastsecp256k1"]
}

Conan

# conanfile.txt
[requires]
ultrafastsecp256k1/3.3.0

Header-Only Usage

The CPU core is header-only. You can copy cpu/include/ to your project:

your_project/
├── third_party/
│   └── UltrafastSecp256k1/
│       ├── UltrafastSecp256k1.hpp
│       ├── field.hpp
│       └── ...
└── src/
    └── main.cpp
target_include_directories(your_target PRIVATE third_party/UltrafastSecp256k1)

Compiler Requirements

Feature Minimum
C++ Standard C++20
GCC 12+
Clang 15+
MSVC 19.30+ (VS 2022)
AppleClang 15+

See Also

Clone this wiki locally