- 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.
- bls.go: pure Go implementation using cloudflare/circl (!cgo)
- bls_cgo.go: CGO-optimized implementation using supranational/blst (cgo)
- types.go: shared constants and errors
- Simplified bls12381 build tags (cgo vs !cgo)
- Removed duplicate implementations (bls_new.go, internal.go)
- Fixed tests to work with both implementations
- Track samples in sliding window of size minSamples
- Return nil ETA until sufficient samples collected
- Reject bogus samples (time warp, no progress)
- Calculate rate from window edges for accurate ETA
- Add VerifySignature method to ML-DSA and SLH-DSA public keys
- Keep Verify method for crypto.Signer compatibility
- Add documentation clarifying opts parameter is ignored
- cggmp21: CGGMP21 threshold ECDSA protocol implementation
- mpc: Multi-party computation account management
- aggregated: Signature aggregation managers for BLS, Corona, CGGMP21
- corona: Linkable ring signature implementation
These packages were previously in node/crypto and are now properly
located in the dedicated crypto repository.
Refactored PrivateKey unmarshaling to properly handle both JSON and text
formats:
1. Created shared unmarshalText() helper for core unmarshaling logic
2. Fixed UnmarshalJSON to strip quotes then call helper
3. Fixed UnmarshalText to call helper directly without quote stripping
4. Added 6 new tests covering:
- Direct text unmarshaling (no quotes)
- JSON unmarshaling (with quotes)
- Invalid prefix handling
- Null value handling
All tests pass (19/19).
Add length validation to reject secret keys that aren't exactly 32 bytes.
CIRCL's UnmarshalBinary accepts variable-length inputs, so we add this
check to ensure strict validation matching BLST's behavior.
Enhance SignatureFromBytes validation to reject signatures where all
bytes are identical (e.g., all 0xFF, all 0x00). This prevents obviously
invalid signatures from being accepted during deserialization.
With the CIRCL migration, Signature is just a []byte wrapper, so we add
this sanity check to catch malformed data early, matching the stricter
validation behavior from the previous BLST implementation.
- Fix 18 missing if conditions in ipa/bandersnatch/fr/element_test.go
- Fix missing if condition in ipa/bandersnatch/multiexp_test.go
- Fix missing if condition in slhdsa/optimization_test.go
- Fix ML-DSA nil pointer panic by adding default SignerOpts
- Fix ML-DSA test to properly validate randomized signing behavior
All syntax errors resolved. All ML-DSA tests passing.
Resolves panic in TestAllCryptoImplementations/ML-DSA/ML-DSA-44.