mirror of
https://github.com/luxfi/accel.git
synced 2026-10-30 17:03:45 +00:00
Phase-1 wire-up for the canonical secp256k1 path:
* crypto_secp256k1.go package doc + Phase-1 surface notes
* crypto_secp256k1_cgo.go CGO bindings to luxcpp/crypto/secp256k1
(built with -tags=lux_crypto_native)
* crypto_secp256k1_stub.go Default build returns ErrCryptoNativeUnavailable
* crypto_secp256k1_native_test.go Go-side test exercising the cgo path
Build:
go build ./... # default, no native lib needed
go build -tags=lux_crypto_native ./... # links liblux_crypto_secp256k1
go test -tags=lux_crypto_native ./... # runs native tests
The CGO binding links statically against
luxcpp/crypto/build-canonical/secp256k1/libsecp256k1_cpu.a (path is configurable
via the standard cgo LDFLAGS chain). The C ABI is stable per
include/lux/crypto/secp256k1.h.
Subsequent agents wire bls12381, mldsa, mlkem, etc. through the same pattern.
20 lines
857 B
Go
20 lines
857 B
Go
// Copyright (C) 2024-2026, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
// Package accel exposes the canonical CPU + GPU paths into luxcpp/crypto.
|
|
//
|
|
// luxcpp/crypto is the single source of truth for native cryptographic
|
|
// implementations across the Lux/Hanzo/Zoo ecosystem. Go callers use this
|
|
// package; it CGO-routes to the lux_crypto_<alg> static libraries.
|
|
//
|
|
// Phase 1: secp256k1 (ecrecover, address derivation). Future phases add
|
|
// bls12381, mldsa, mlkem, slhdsa, corona, frost, cggmp21, sha256,
|
|
// blake2b, blake3, kzg, hpke, ipa, lamport, ecies, etc.
|
|
//
|
|
// Build matrix:
|
|
// * `go build` (no tag) -> CPU-only, requires CGO + libluxcrypto
|
|
// * `go build -tags accel_metal` -> Metal GPU path (Apple)
|
|
// * `go build -tags accel_cuda` -> CUDA GPU path (Linux, future)
|
|
|
|
package accel
|