TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24789 23
Title: UltrafastSecp256k1 — Zero-dependency C++20 secp256k1 with ASM backends, CUDA/ROCm, and 9 platform targets

After 3+ years of development, I'm sharing **UltrafastSecp256k1** — a complete secp256k1 implementation in modern C++20 with zero external dependencies.

**What makes it different:**

* **Zero dependencies** — SHA-256, SHA-512, Keccak-256, RIPEMD-160, Base58, Bech32 all implemented from scratch
* **Multi-backend assembly** — x64 MASM/GAS (BMI2/ADX), ARM64 (MUL/UMULH), RISC-V (RV64GC)
* **SIMD** — AVX2/AVX-512 batch operations, Montgomery batch inverse
* **GPU** — CUDA (4.63M kG/s), OpenCL (3.39M kG/s), ROCm/HIP
* **Constant-time** — Separate `secp256k1::ct` namespace, Montgomery ladder, no flag switching
* **Hot path contract** — Zero heap allocations, explicit buffers, fixed-size POD, in-place mutation
* **9 platforms** — x64, ARM64, RISC-V, ESP32, STM32, WASM, iOS, Android, CUDA/ROCm

**Protocol coverage:**
ECDSA (RFC 6979, low-S, recovery), Schnorr (BIP-340), MuSig2, FROST, Adaptor sigs, Pedersen commitments, Taproot, BIP-32/44, Silent Payments (BIP-352), ECDH, multi-scalar multiplication, batch verification, 27+ coin address generation.

**Design philosophy:**


**Algorithm > Architecture > Optimization > Hardware**

**Memory traffic > Arithmetic**

**Correctness is absolute; performance is earned**

Everything is `constexpr`\-friendly where possible. No exceptions, no RTTI, no virtual calls in compute paths.

200+ tests, fuzz harnesses, known vector verification.

Happy to answer questions about the architecture, assembly backends, or GPU implementation.

https://redd.it/1r5c9pe
@r_cpp
Reddit From the cpp community on Reddit: [ Removed by moderator ] Posted by Available-Young251 - 3 votes and 1 comment
More from @r_cpp
  1. Oct 8, 2026Profiles for simplicity and guarantees - Bjarne Stroustrup - CppCon 2026 https://youtu.be/…
  2. Oct 8, 2026How to Fix autoconf-style Configuration Probing https://build2.org/blog/fix-autoconf.xhtml…
  3. Oct 8, 2026owl – a header-only C++23 HTTP framework where route patterns and handler extractors are c…
  4. Oct 8, 2026Removed by Reddit Removed by Reddit on account of violating the [content policy. ] https:/…
  5. Oct 8, 2026Is there a way to search across all P and N papers throughout standardization history? It…
  6. Oct 8, 2026CppCast Episode 412 : Safety and Interoperability with Rust and C++ https://cppcast.com/sa…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →