UltrafastSecp256k1/docs
2026-03-25 14:36:36 +00:00
..
adoption chore(release): bump to v3.4.0 2026-03-23 13:57:24 +00:00
archive release: v3.19.0 -- RISC-V CT hardening, L1 I-cache opt, bench diagnostics 2026-03-04 21:18:59 +04:00
reports Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
wiki Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
ABI_VERSIONING.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
AI_AUDIT_PROTOCOL.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
AI_REVIEW_EVENTS.json Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
API_REFERENCE.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
ARCHITECTURE.md release: merge dev to main for release preparation (#147) 2026-03-16 03:40:00 +04:00
ARM64_AUDIT_BENCHMARK.md Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
ARM64_GAPS_ANALYSIS.md Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
ASSURANCE_CLAIMS.json Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
ASSURANCE_LEDGER.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
AUDIT_GUIDE.md docs: document 78 exploit PoC tests across 14 attack categories in all docs and SEO 2026-03-24 14:27:28 +00:00
AUDIT_INFRA_TODO.md audit: complete audit infrastructure TODO (P0+P1+P2) (#148) 2026-03-16 05:24:11 +04:00
AUDIT_MANIFEST.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
AUDIT_READINESS_REPORT_v1.md audit: complete audit infrastructure TODO (P0+P1+P2) (#148) 2026-03-16 05:24:11 +04:00
AUDIT_SCOPE.md feat(audit): integrate GPU C ABI tests into unified runner (P.1-P.2) 2026-03-23 13:45:57 +00:00
AUDIT_TRACEABILITY.md fix(audit): cover 8 zero-coverage ABI functions + deep batch verify (I.1-I.5) 2026-03-23 13:28:40 +00:00
BACKEND_ASSURANCE_MATRIX.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
BACKEND_PARITY.md docs: add 5 ZK/BIP-324 GPU batch ops to all docs 2026-03-24 16:43:52 +00:00
BENCHMARK_BIP324_GPU.md fix: resolve 5 CI failures 2026-03-22 10:51:34 +00:00
BENCHMARK_METHODOLOGY.md v3.20.0: GLV window optimization, refactoring, CI acceleration (#115) 2026-03-08 16:46:24 +04:00
BENCHMARK_POLICY.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
BENCHMARK_ZK.md release: merge dev to main for release preparation (#147) 2026-03-16 03:40:00 +04:00
BENCHMARKING.md release: UltrafastSecp256k1 v3.22.0 (#176) 2026-03-20 04:23:19 +04:00
BENCHMARKS.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
BINDINGS_ABI_COMPAT.md Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
BINDINGS_ERROR_MODEL.md feat: v3.16.0 -- BIP-340 strict, OpenSSF hardening, FROST RFC 9591, audit infrastructure (#77) 2026-03-01 17:09:31 +04:00
BINDINGS_EXAMPLES.md Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
BINDINGS_MEMORY_MODEL.md Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
BINDINGS_PACKAGING.md Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
BINDINGS_USAGE_STANDARD.md Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
BINDINGS.md Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
BUG_BOUNTY.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
BUILDING.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
CI_ENFORCEMENT.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
CODING_STANDARDS.md fix: schnorr parity, CFL hardening, MIT license (#48) 2026-02-27 19:45:10 +04:00
COMMUNITY_BENCHMARKS.md docs: add COMMUNITY_BENCHMARKS.md for community-submitted hardware results 2026-03-24 21:00:18 +00:00
COMPATIBILITY.md Harden ABI and finish bindings validation 2026-03-23 02:30:44 +00:00
CROSS_PLATFORM_TEST_MATRIX.md release: merge dev to main for release preparation (#147) 2026-03-16 03:40:00 +04:00
CRYPTO_INVARIANTS.md fix(precompute): correct cache validation and path separator (#118) 2026-03-08 19:14:45 +04:00
CT_EMPIRICAL_REPORT.md release: v3.19.0 -- RISC-V CT hardening, L1 I-cache opt, bench diagnostics 2026-03-04 21:18:59 +04:00
CT_VERIFICATION.md perf: batch ops 17-67x faster via all-affine fast path; pippenger touched-bucket + window tuning (#169) 2026-03-18 02:38:10 +04:00
DEPRECATION_POLICY.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
DIFFERENTIAL_TESTING.md release: merge dev to main for release preparation (#147) 2026-03-16 03:40:00 +04:00
ENGINEERING_WORKDOC.md wip: commit in-progress audit, CI, and docs changes before branch consolidation 2026-03-21 14:07:31 +00:00
ESP32_SETUP.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
EXPLOIT_BACKLOG.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
EXPLOIT_TEST_CATALOG.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
EXTERNAL_AUDIT_AUTOMATION.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
FAQ.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
FEATURE_ASSURANCE_LEDGER.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
FEATURE_MATURITY.md docs: add 5 ZK/BIP-324 GPU batch ops to all docs 2026-03-24 16:43:52 +00:00
FFI_HOSTILE_CALLER.md audit(docs): fix function names in FFI_HOSTILE_CALLER + update INTERNAL_AUDIT for v3.4 + fix graph coverage mappings 2026-03-23 17:25:39 +00:00
FORTRESS_ROADMAP.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
FROST_COMPLIANCE.md release: v3.19.0 -- RISC-V CT hardening, L1 I-cache opt, bench diagnostics 2026-03-04 21:18:59 +04:00
GPU_API_WORKDOC.md docs: sync GPU ABI and batch signing docs 2026-03-22 16:57:51 +00:00
GPU_BACKEND_EVIDENCE.json Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
GPU_VALIDATION_MATRIX.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
INCIDENT_RESPONSE.md release: v3.19.0 -- RISC-V CT hardening, L1 I-cache opt, bench diagnostics 2026-03-04 21:18:59 +04:00
INFRA_AMPLIFICATION_TODO.md infra: self-hosted GPU CI runner + workflow + release evidence 2026-03-15 23:16:17 +00:00
INTERNAL_AUDIT.md audit(docs): fix function names in FFI_HOSTILE_CALLER + update INTERNAL_AUDIT for v3.4 + fix graph coverage mappings 2026-03-23 17:25:39 +00:00
INVARIANTS.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
LOCAL_CI.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
LTS_POLICY.md release: merge dev to main for release preparation (#147) 2026-03-16 03:40:00 +04:00
NORMALIZATION_SPEC.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
NORMALIZATION.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
OPTIMIZATION_ANALYSIS.md release: v3.19.0 -- RISC-V CT hardening, L1 I-cache opt, bench diagnostics 2026-03-04 21:18:59 +04:00
OPTIMIZATION_ARCHITECTURE.md sync: consolidate dev + ESP32 bench hornet + benchmark data (#107) 2026-03-07 21:02:47 +04:00
OWNER_GRADE_AUDIT_TODO.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
PARSER_BOUNDARY_AUDIT.md release: merge dev to main for release preparation (#147) 2026-03-16 03:40:00 +04:00
PERFORMANCE_GUIDE.md Tighten audits and optimize batch/MSM hot paths 2026-03-23 14:11:02 +00:00
PERFORMANCE_REGRESSION.md v3.20.0: GLV window optimization, refactoring, CI acceleration (#115) 2026-03-08 16:46:24 +04:00
PRE_RELEASE_CHECKLIST.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
PROJECT_GRAPH_REASONING.md Tighten audits and optimize batch/MSM hot paths 2026-03-23 14:11:02 +00:00
README.md Tighten audits and optimize batch/MSM hot paths 2026-03-23 14:11:02 +00:00
RELEASE_PROCESS.md sync: consolidate dev + ESP32 bench hornet + benchmark data (#107) 2026-03-07 21:02:47 +04:00
RELEASE_VERIFICATION.md release: merge dev to main for release preparation (#147) 2026-03-16 03:40:00 +04:00
REPRODUCIBLE_BUILDS.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
SAFE_DEFAULTS.md audit: add AUDIT_COVERAGE.md + ASCII cleanup + CT fixes 2026-02-25 19:14:21 +04:00
SECRET_LIFECYCLE.md perf: batch ops 17-67x faster via all-affine fast path; pippenger touched-bucket + window tuning (#169) 2026-03-18 02:38:10 +04:00
SECURITY_CLAIMS.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
SELF_AUDIT_FAILURE_MATRIX.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
TEST_MATRIX.md Harden audit and fix Windows CUDA build 2026-03-25 14:36:36 +00:00
THREAD_SAFETY.md release: v3.19.0 -- RISC-V CT hardening, L1 I-cache opt, bench diagnostics 2026-03-04 21:18:59 +04:00
USER_GUIDE.md release: merge dev to main for release preparation (#147) 2026-03-16 03:40:00 +04:00

UltrafastSecp256k1 Documentation

Version 3.15.0 -- Cross-platform secp256k1 ECC library


Document Description
API Reference Complete CPU + CUDA + WASM function reference
Building Build instructions for all 10+ platforms
Benchmarks Performance data: CPU, GPU, embedded, mobile, including the 2026-03 x86, Android, CUDA, and OpenCL refresh
Bindings Validation Closure Final summary of the multi-language binding validation and docs sync pass
Bindings Release Notes Source Release-time source note for later changelog, release body, and announcement assembly
Bindings Announcement Draft Ready-to-post announcement draft for the completed binding validation matrix
ESP32 Setup ESP32-S3/PICO-D4 flashing & testing guide
RISC-V Optimizations RISC-V assembly & RVV details
Porting Guide Add new platforms, architectures, GPU backends
Project Graph Reasoning SQLite code graph, semantic tags, symbol reasoning, and optimization/audit workflows
scripts/query_graph.py tags Semantic tag inventory from the repository knowledge graph
scripts/query_graph.py symbol/optimize/risk Symbol-level crypto reasoning, gain/risk scoring, and optimization candidates

Security & Audit

Document Description
Audit Guide Start here -- Auditor navigation, checklist, reproduction commands
Architecture Technical architecture deep-dive for auditors
CT Verification Constant-time methodology, dudect, known limitations
Test Matrix Function -> test coverage map with gap analysis
Security Policy Vulnerability reporting, audit status, production readiness
Threat Model Layer-by-layer risk + attack surface analysis
Audit Report Internal audit: 641,194 checks, 8 suites, 0 failures
GPU Validation Matrix Backend parity, GPU ABI tests, and the canonical local GPU proof path

Adoption & Integration

Document Description
Integration Guide CMake FetchContent, add_subdirectory, vcpkg, migration from libsecp256k1
API Stability Header stability tiers: Stable / Provisional / Experimental
Backend Guide CPU, CUDA, ROCm, OpenCL, Metal, WASM, Android matrix
libsecp256k1 Shim Drop-in C API compatibility layer

External Docs

Document Description
CUDA / ROCm GPU CUDA + HIP/ROCm architecture, kernels, benchmarks
WebAssembly WASM build, JS/TS API, npm package
Contributing Development workflow, coding standards, PR process
Security Vulnerability reporting, security model
Changelog Version history

Getting Started

1. Build

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

2. Self-Test

ctest --test-dir build --output-on-failure

3. Use in Your Code

#include <secp256k1/field.hpp>
#include <secp256k1/point.hpp>
#include <secp256k1/scalar.hpp>
#include <secp256k1/ecdsa.hpp>
#include <secp256k1/schnorr.hpp>
#include <secp256k1/sha256.hpp>

using namespace secp256k1::fast;

int main() {
    // Key generation
    Scalar private_key = Scalar::from_hex(
        "E9873D79C6D87DC0FB6A5778633389F4453213303DA61F20BD67FC233AA33262"
    );
    Point public_key = Point::generator().scalar_mul(private_key);

    // ECDSA sign / verify
    std::array<uint8_t, 32> msg_hash = sha256::hash("hello", 5);
    auto [r, s] = ecdsa::sign(msg_hash, private_key);
    bool ok = ecdsa::verify(msg_hash, public_key, r, s);

    return ok ? 0 : 1;
}

Architecture Overview

UltrafastSecp256k1/
+-- cpu/                         # CPU library (C++20, header-only + compiled)
|   +-- include/secp256k1/       # Public headers
|   |   +-- field.hpp            #   Field element (mod p)
|   |   +-- scalar.hpp           #   Scalar (mod n)
|   |   +-- point.hpp            #   EC point operations
|   |   +-- ecdsa.hpp            #   ECDSA sign/verify (RFC 6979)
|   |   +-- schnorr.hpp          #   Schnorr BIP-340 sign/verify
|   |   +-- sha256.hpp           #   SHA-256 hash
|   |   +-- glv.hpp              #   GLV endomorphism
|   |   +-- precompute.hpp       #   Generator table
|   |   +-- ct/                  #   Constant-time variants
|   |   +-- types.hpp            #   Cross-backend POD types
|   +-- src/                     # Implementation + platform ASM
|   |   +-- field.cpp
|   |   +-- field_asm_x64.asm    #   x86-64 BMI2/ADX
|   |   +-- field_asm_riscv64.S  #   RISC-V RV64GC + RVV
|   |   +-- field_asm_arm64.cpp  #   ARM64 MUL/UMULH
|   |   +-- ecdsa.cpp
|   |   +-- schnorr.cpp
|   |   +-- ...
|   +-- tests/                   # CTest unit tests
|   +-- bench/                   # Benchmarks
|   +-- fuzz/                    # libFuzzer harnesses
|
+-- cuda/                        # CUDA + ROCm/HIP GPU library
|   +-- include/
|   |   +-- secp256k1.cuh        #   All device functions (field/point/scalar)
|   |   +-- ptx_math.cuh         #   PTX inline asm (with __int128 fallback)
|   |   +-- gpu_compat.h         #   CUDA <-> HIP API mapping
|   |   +-- batch_inversion.cuh  #   Montgomery trick batch inverse
|   |   +-- bloom.cuh            #   Device-side Bloom filter
|   |   +-- hash160.cuh          #   SHA-256 + RIPEMD-160
|   +-- app/                     #   Experimental search kernels
|   +-- src/                     #   Kernel wrappers, tests, benchmarks
|
+-- opencl/                      # OpenCL GPU library
|   +-- kernels/                 #   .cl kernel sources
|   +-- ...
|
+-- wasm/                        # WebAssembly (Emscripten)
|   +-- secp256k1_wasm.h         #   C API (11 functions)
|   +-- secp256k1_wasm.cpp       #   Implementation
|   +-- secp256k1.mjs            #   JS wrapper
|   +-- secp256k1.d.ts           #   TypeScript declarations
|   +-- package.json             #   npm: @ultrafastsecp256k1/wasm
|
+-- examples/
|   +-- basic_usage/             #   Desktop C++ example
|   +-- esp32_test/              #   ESP32-S3 / ESP32-PICO-D4
|   +-- stm32_test/              #   STM32F103ZET6 ARM Cortex-M3
|
+-- cmake/
|   +-- version.hpp.in           #   Auto-generated version header
|   +-- ios.toolchain.cmake      #   iOS cross-compilation toolchain
|
+-- scripts/
|   +-- build_wasm.sh            #   Emscripten WASM build
|   +-- build_xcframework.sh     #   iOS XCFramework build
|
+-- .github/workflows/
|   +-- ci.yml                   #   CI: Linux/Win/macOS/iOS/WASM/Android/ROCm
|   +-- docs.yml                 #   Doxygen -> GitHub Pages
|
+-- Package.swift                # Swift Package Manager
+-- UltrafastSecp256k1.podspec   # CocoaPods
+-- Doxyfile                     # Doxygen config
+-- CMakeLists.txt               # Top-level CMake (v3.0.0)

Supported Platforms

Platform Architecture Assembly Status
Linux x86-64 BMI2/ADX x86-64 ASM [OK] Production
Windows x86-64 BMI2/ADX x86-64 ASM [OK] Production
macOS x86-64 / ARM64 Native ARM64 ASM [OK] Production
RISC-V 64 RV64GC + RVV RISC-V ASM [OK] Production
Android ARM64 Cortex-A55/A76 ARM64 ASM [OK] Production
iOS 17+ Apple Silicon ARM64 ASM [OK] CI (testers wanted)
CUDA (sm_75+) PTX PTX inline [OK] Production path
ROCm / HIP GCN / RDNA Portable [..] Planned hardware validation
OpenCL 3.0 PTX PTX inline [OK] Broader backend, partial unified GPU C ABI (4/6)
WebAssembly Emscripten Portable C++ [OK] Production
ESP32-S3 Xtensa LX7 Portable C++ [OK] Tested
ESP32-PICO-D4 Xtensa LX6 Portable C++ [OK] Tested
STM32F103 Cortex-M3 ARM Thumb ASM [OK] Tested

License

MIT -- See LICENSE

Integration consulting available -- contact payysoon@gmail.com