How shrec/ultrafastsecp256k1 works
UltrafastSecp256k1 is a multi-backend secp256k1 cryptography engine, exposed through language bindings and compatibility APIs. The principal workflow is an application request entering a binding or shim, reaching the CPU cryptographic operations, and returning a result; GPU verification is an optional backend path. The repository also presents reproducible audit evidence as a product capability. Several subsystem links are documented in the README, but many implementation files were not sampled, so uncertain calls are omitted rather than inferred.
Main entry points: ultrafast_secp256k1.cpp C API · point.hpp Point arithmetic · ecdsa.hpp ECDSA · shim_context.cpp secp256k1 shim
Components 21
Integration surfaces
- C API
bindings/c_api/ultrafast_secp256k1.cpp - Language bindings
bindings - secp256k1 shim
compat/libsecp256k1_shim/src/shim_context.cpp - libbitcoin bridge
compat/libbitcoin_bridge/src/ufsecp_libbitcoin.cpp
CPU cryptography
- Field arithmetic
src/cpu/include/secp256k1/field.hpp - Scalar arithmetic
src/cpu/include/secp256k1/scalar.hpp - Point arithmetic
src/cpu/include/secp256k1/point.hpp - Constant-time points
src/cpu/include/secp256k1/ct/point.hpp - Constant-time signing
src/cpu/include/secp256k1/ct/sign.hpp - ECDSA
src/cpu/include/secp256k1/ecdsa.hpp - Schnorr
src/cpu/include/secp256k1/schnorr.hpp - Batch verification
src/cpu/include/secp256k1/batch_verify.hpp - Signature recovery
src/cpu/include/secp256k1/recovery.hpp - SHA-256
src/cpu/include/secp256k1/sha256.hpp - Taproot
src/cpu/include/secp256k1/taproot.hpp - Secure erasure
src/cpu/include/secp256k1/detail/secure_erase.hpp
GPU acceleration
- GPU verify dispatch
src/gpu/src/gpu_engine_hook.cpp - GPU backends
src/gpu/include/gpu_backend.hpp
Audit evidence
- Audit runner
audit/unified_audit_runner.cpp - Audit evidence
audit
Other components
- Application
Connections 34
- Application → C API: calls
README.md - Application → Language bindings: integrates through
README.md - Application → secp256k1 shim: may use
README.md - Application → libbitcoin bridge: may integrate through
README.md - C API → Scalar arithmetic: uses
bindings/c_api/ultrafast_secp256k1.cpp - C API → Point arithmetic: uses
bindings/c_api/ultrafast_secp256k1.cpp - C API → Field arithmetic: uses
bindings/c_api/ultrafast_secp256k1.cpp - C API → ECDSA: uses
bindings/c_api/ultrafast_secp256k1.cpp - C API → Schnorr: uses
bindings/c_api/ultrafast_secp256k1.cpp - C API → Signature recovery: uses
bindings/c_api/ultrafast_secp256k1.cpp - C API → SHA-256: uses
bindings/c_api/ultrafast_secp256k1.cpp - C API → Taproot: uses
bindings/c_api/ultrafast_secp256k1.cpp - Point arithmetic → Field arithmetic: uses
src/cpu/include/secp256k1/point.hpp - Point arithmetic → Scalar arithmetic: uses
src/cpu/include/secp256k1/point.hpp - ECDSA → Scalar arithmetic: uses
src/cpu/include/secp256k1/ecdsa.hpp - ECDSA → Point arithmetic: uses
src/cpu/include/secp256k1/ecdsa.hpp - Schnorr → Scalar arithmetic: uses
src/cpu/include/secp256k1/schnorr.hpp - Schnorr → Point arithmetic: uses
src/cpu/include/secp256k1/schnorr.hpp - Batch verification → ECDSA: uses
src/cpu/include/secp256k1/batch_verify.hpp - Batch verification → Schnorr: uses
src/cpu/include/secp256k1/batch_verify.hpp - Signature recovery → ECDSA: uses
src/cpu/include/secp256k1/recovery.hpp - Signature recovery → Point arithmetic: uses
src/cpu/include/secp256k1/recovery.hpp - Taproot → Point arithmetic: uses
src/cpu/include/secp256k1/taproot.hpp - Constant-time signing → Constant-time points: uses
src/cpu/include/secp256k1/ct/sign.hpp - Constant-time signing → ECDSA: provides signing
src/cpu/include/secp256k1/ct/sign.hpp - Constant-time points → Point arithmetic: uses
src/cpu/include/secp256k1/ct/point.hpp - GPU verify dispatch → Batch verification: registers hook for
src/gpu/src/gpu_engine_hook.cpp - GPU verify dispatch → GPU backends: dispatches to
src/gpu/src/gpu_engine_hook.cpp - GPU verify dispatch → Batch verification: falls back to CPU
src/gpu/src/gpu_engine_hook.cpp - secp256k1 shim → Scalar arithmetic: uses
compat/libsecp256k1_shim/src/shim_context.cpp - secp256k1 shim → Point arithmetic: uses
compat/libsecp256k1_shim/src/shim_context.cpp - secp256k1 shim → Constant-time points: uses
compat/libsecp256k1_shim/src/shim_context.cpp - secp256k1 shim → Constant-time signing: uses
compat/libsecp256k1_shim/src/shim_context.cpp - Audit runner → Audit evidence: produces