Changed build tag from `//go:build cgo && darwin` to `//go:build gpu && darwin`
so that CGO code requiring luxcpp/crypto is only compiled when explicitly
building with the gpu tag.
This allows the pure Go implementation (using zeebo/blake3) to be used
by default without requiring native library dependencies.
Provides hash primitives needed by luxfi/ids and other packages:
- ComputeHash256/ComputeHash160 for crypto hashes
- PubkeyBytesToAddress for Bitcoin-style address derivation
- Checksum for CB58 encoding
Add Metal GPU acceleration for Verkle tree witness operations:
- CommitToPoly: GPU polynomial commitment via MSM
- BatchCommitToPoly: Parallel batch commitments
- VerifyProof: GPU IPA proof verification
- BatchVerifyProofs: Parallel proof verification
Links to luxcpp/crypto metal_ipa for Apple Silicon.
Pure Go fallback when CGO disabled.
Add Metal GPU acceleration for Verkle tree operations:
- MSM (multi-scalar multiplication) on Banderwagon curve
- Batch MSM for parallel proof verification
- Pedersen commitments with GPU acceleration
- VerkleCommitNode for 256-width tree nodes
Includes pure Go fallback for CGO_ENABLED=0 builds.
Links to luxcpp/crypto metal_ipa implementation.
- Rename crypto/pqcrypto directory to crypto/pq
- Update pure Go fallbacks with correct API signatures
- Use standard cgo/!cgo build tags instead of custom tags
- Change CGO files to use luxgpu tag (opt-in)
- Change pure Go files to use !luxgpu tag (default)
- Fix relative paths to luxcpp/crypto headers
This allows CGO=0 and CGO=1 builds to work without requiring
the full GPU libraries to be installed.
Add stub implementations for GPU packages that return
false for Available() when GPU libraries are not present.
This allows building with CGO_ENABLED=0 or CGO_ENABLED=1
without requiring Metal/CUDA libraries.
- bls/gpu/gpu_stub.go
- hash/blake3/gpu/gpu_stub.go
- hash/poseidon2/gpu/gpu_stub.go
- pqcrypto/*/gpu/gpu_stub.go (mldsa, mlkem, slhdsa)
- Replace XOR placeholder aggregation with real bls_aggregate_signatures
- Fix BLSAggregatePublicKeys to use bls_aggregate_public_keys
- Fix BLSBatchVerify with proper CGO pointer pinning (Go 1.21+)
- Implement BLSBatchSign using parallel worker pool
- Fix MLDSAKeygen/Sign/Verify signatures to match C API
- Fix ThresholdContext.Keygen buffer sizing (maxShareSize=256)
- Add runtime.Pinner to all functions passing pointer arrays to C
- Fix codeToError to use CRYPTO_* constants
- All GPU crypto tests pass
- Remove hashing/ directory (duplicate of hash/)
- Update imports in cb58, secp256k1 to use crypto/hash
- Follows Go stdlib naming convention (hash vs hashing)
The hash package is the canonical implementation.
The hashing package now re-exports from hash for backwards compatibility.
New code should import github.com/luxfi/crypto/hash directly.
Add domain separation tags (DST) to BLS proof of possession signing and
verification to prevent cross-protocol attacks:
- dstSignature for standard BLS signatures
- dstPoP for proof of possession
This ensures signatures cannot be replayed across different contexts.
- CGO_ENABLED=1: Auto-detects Metal (macOS) / CUDA (Linux) / CPU fallback
- CGO_ENABLED=0: Pure Go stubs (no C dependencies)
- Bundled include/gpu_crypto.h header (no external deps for build)
- Runtime GPU detection via gpu_available() and gpu_backend_name()
- Placeholder implementations for BLS, ML-DSA, hashing
- Threshold signatures stub (ErrNotSupported)
Build: go build ./...
Test: go test ./...
The gpu package requires C++ headers that only exist locally.
Using 'cgo' build tag caused CI failures when CGO was enabled but
headers weren't present.
Now uses 'luxgpu' custom build tag:
- Default: stub implementation (no dependencies)
- With -tags luxgpu: full CGO acceleration
Build locally with GPU: go build -tags luxgpu ./...
The Go proxy still serves v1.16.1 which has wrong module path
(github.com/ethereum/go-ethereum instead of github.com/luxfi/geth).
Add exclude directive to prevent this version from being selected.
The TestBytes function returns true when all bytes are zero (point at infinity).
The condition was inverted, causing non-zero points to be treated as infinity.
- Remove cache/ and utils/ directories (originally copied from luxfi/node)
- Update secp256k1 imports to use github.com/luxfi/cache/lru
- Update sig_fuzz_test.go to use local crypto/hashing instead of node/utils
- Clean up go.mod: remove unused node/geth dependencies
- crypto package is now fully standalone
- Add crypto/common imports instead of geth/common for type independence
- Add HexToAddress wrapper function for address parsing
- Fix secp256k1 fuzz tests to check IsOnCurve before CompressPubkey
- Fix bn256/gnark imports to use crypto/bitutil instead of standalone bitutil
- Remove unused secp256k1 import from crypto.go
- Fix mlkem test files to use correct API (GenerateKeyPair returns pub,priv,err)
- Fix mlkem constant names (MLKEM512SharedKeySize not SharedSecretSize)
- Restore crypto/common types as standalone (not aliases to geth/common)
- Update crypto.go and keccak.go to use crypto/common instead of geth/common
- Fix secp256k1 fuzz tests to use correct DecompressPubkey/CompressPubkey API
- Remove stale test files and go.work files
crypto package is now fully independent of geth (geth -> crypto, not reverse)
Zero is not a valid BLS12-381 scalar and should be rejected
when deserializing secret keys. This matches the expected
behavior tested in the node package.