Canonical native cryptographic primitives for the Lux / Hanzo / Zoo ecosystem. CPU + GPU implementations live here and only here.
- CPU: portable C++17 / C++20, no third-party crypto libraries
- GPU: CUDA, Metal, WGSL kernels with byte-equal CPU↔GPU output
- C ABI:
include/lux/crypto/<alg>.h, callable from Go (cgo) and Rust (bindgen / lux-crypto-sys)
The Go entry point is github.com/luxfi/crypto; the GPU device router
is github.com/luxfi/accel.
Phase 1 (current): secp256k1, keccak. See MIGRATION.md
for the full per-algorithm migration plan and status.
mkdir -p build && cd build
cmake -DCRYPTO_ENABLE_METAL=ON ..
cmake --build . -j$(nproc)
ctest --output-on-failurekeccak_test : 3/3 canonical Ethereum vectors
secp256k1_test : RFC 6979 §A.2.5 + 64 round-trip + edge + batch
secp256k1_gpu_test : CPU vs Metal byte-equal across 32 signatures
- No vendoring. First-party only. See
MIGRATION.mdfor forbidden includes. - No stubs. A new algorithm enters this tree only when its tests prove byte-equality against canonical reference vectors.
- One source of truth. Other ecosystem repos import this; nothing else implements crypto.
BSD-3-Clause-Eco. See LICENSE.