73 Commits
Author SHA1 Message Date
zeekay 8c8af9b545 chore: sync working tree
Commits 1 outstanding change(s) that were sitting uncommitted.
No build artifacts and no secrets in the changeset (both checked).
2026-07-26 10:13:06 -07:00
zeekayandlux 59fe62c06d chore(deps): bump geth v1.20.1 + luxfi deps — stack unification 2026-07-25 12:09:19 -07:00
zeekayandHanzo Dev 8e04abc877 fix(deps): repair vanished pins / go.sum drift ( age@latest) + build green
Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-06-30 13:59:56 -07:00
f94599dcee chore: bump luxfi/database v1.19.3 (#4)
Co-authored-by: zeekay <z@zeekay.io>
2026-06-25 15:24:37 -07:00
zeekay f680d39967 deps: update to latest real-semver, drop local replaces, fix breaks 2026-06-11 09:31:34 -07:00
zeekay 5c3821aa79 deps: update to latest real-semver, drop local replaces, fix breaks 2026-06-11 09:04:34 -07:00
Antje WorringandHanzo Dev 0fe370c77c hqc: decouple cgo build from native HQC lib (bump accel v1.2.4); fix HQC PQClean CI
Root cause of the never-passing 'HQC PQClean cgo e2e (NIST KAT
roundtrip)' job, in two layers:

1. The lux-build runner had no C compiler (gcc/cc/clang absent), so cgo
   aborted before any code ran. Fixed in prior commits by installing
   build-essential + selecting an available CC.

2. With a compiler present, the cgo build then failed on
   accel@v1.1.9/ops/code/code_cpu.go's '#include "lux/gpu/hqc.h"' and
   '-lluxgpu_hqc' — the native HQC library (built from luxfi/mlx) that
   is NOT present in CI (nor in most consumers). accel v1.1.9 gated that
   native path on '//go:build cgo', so every cgo build hard-required the
   native lib/header.

Fix: bump github.com/luxfi/accel v1.1.9 -> v1.2.4, which gates the
native path behind '-tags=lux_hqc_native' and otherwise returns
code.ErrNativeHQCUnavailable (documented: 'callers should fall back to
their own CPU KEM path'). crypto/hqc now honours that contract:

- gpu.go: batchEncapsulateGPU/batchDecapsulateGPU treat
  ErrNativeHQCUnavailable as 'declined' (return false,nil) so callers
  fall back to the per-item PQClean path. Secret buffers are zeroised on
  the decline path.
- gpu_cgo.go: GF2Polymul falls back to the pure-Go Karatsuba path on
  ErrNativeHQCUnavailable. Removed the duplicated vecNSize64 /
  redMaskForMode / GF2Add (now shared).
- gpu_polymul_purego.go (new, tag-neutral): the canonical pure-Go,
  PQClean-byte-identical GF(2)^N polymul (Karatsuba + reduce + base_mul),
  extracted from gpu_nocgo.go so BOTH builds share one implementation.
- gpu_nocgo.go: trimmed to the thin !cgo public wrappers over the shared
  helpers.
- randombytes_shim.c: split. Default (hqc_pqclean, no native) forwards
  randombytes -> hqcGoRandombytes only; the native seed-buffer dispatch
  (which references lux_hqc_randombytes / lux_hqc_seed_has_bytes from the
  native lib) moves to randombytes_shim_native.c, gated on lux_hqc_native.
  Previously the default build referenced those native-only symbols
  unconditionally, which would not link without the native lib.

NOT a crypto/KAT regression: the NIST KAT roundtrip (TestKAT_HQC128/192/
256), TestRoundTrip_AllModes, TestDeterminism, and the GF2 polymul
known-answer vectors all pass byte-for-byte. The GPU batch tests skip
gracefully when the native kernel is absent (their existing t.Skip path).

Verified: CGO_ENABLED=1 go test -tags=hqc_pqclean ./hqc/ passes from a
clean cache; cgo (with/without hqc_pqclean) and nocgo builds all green;
broader suite unchanged (only pre-existing pkg-config failures in cgo/
and hash/poseidon2 remain, unrelated).

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-06-07 00:19:52 -07:00
Hanzo AI 6a19335ada go.mod: bump go directive 1.26.3 → 1.26.4
Patch fix: crypto/x509, mime, net/textproto security fixes per Go 1.26.4 release notes (2026-06-02). Also compiler, runtime, go fix, crypto/fips140 bug fixes.
2026-06-06 21:51:18 -07:00
Hanzo AI 63f88615ca deps: bump luxfi/vm v1.2.0, sampler v1.1.0, staking v1.5.0 (relicense)
Picks up the 2026-06-06 relicensing:
- luxfi/vm v1.2.0 → Lux Ecosystem License v1.2 (was Lux Research v1.0).
  License-only retag of the extracted runtime; patent reservation
  preserved for runtime optimization surfaces, royalty-free for
  Descending Chains.
- luxfi/sampler v1.1.0 → BSD-3-Clause (was Lux Research v1.0).
  License restored to match the luxfi/node provenance (originally
  extracted from node/utils/sampler).
- luxfi/staking v1.5.0 → BSD-3-Clause (was Lux Research v1.0).
  License restored to match the luxfi/node provenance.

No code changes in this commit — go.mod/go.sum only.
2026-06-06 19:00:43 -07:00
Hanzo AI 5fbfa7041f go.mod: tidy floor (Wave 2G-Cascade)
Picks up precompile v0.5.37 and trims indirect deps no longer reachable.
2026-06-06 06:38:34 -07:00
Hanzo AI 479708ee22 deps: bump p2p v1.21.1, vm v1.1.10 (Wave 2G-Cascade) 2026-06-06 06:15:54 -07:00
Hanzo AI 4b3f96ab40 crypto: decomplect — remove eth* brand naming, name primitives after value
The user's call: "ethcrypto is not acceptable. It encodes the wrong
domain. The fact that Keccak/ECDSA are used for EVM address derivation
does not make the package Ethereum, and it definitely does not justify
an eth* alias inside a repo trying to purge ETH naming. decomplect"

Decomplecting (Rich Hickey: separate the value from the brand):

1. ecies/params.go: drop `ethcrypto "github.com/luxfi/crypto"` import
   alias. Replace with direct `"github.com/luxfi/crypto/secp256k1"`
   import — the file uses `S256()` (the secp256k1 curve), so it
   imports the curve provider directly. The "ethcrypto" alias was
   gratuitous branding; secp256k1 is a curve, not an Ethereum
   primitive.

2. secp256k1/keys.go: rename `EthAddress()` → `KeccakAddress()` on
   both PrivateKey and PublicKey. The derivation is "last 20 bytes of
   Keccak256(uncompressed_pubkey)"; that primitive predates and is
   consumed by every EVM chain (Lux C-Chain, Polygon, BSC, Partner EVM,
   Hanzo EVM, etc.). The "Eth" label braids the value with one brand.
   KeccakAddress names the VALUE; the docstring notes EVM-compatible
   chains consume it but no longer implies Ethereum-specificity.

   `EthAddress()` retained as a `// Deprecated:` alias delegating to
   KeccakAddress so downstream callers (node, cli, mpc) don't break
   in one wave. Linter will flag usages; downstream migrations land
   at their own pace.

3. Address() vs KeccakAddress(): the existing Address() returns the
   Lux native X-Chain / P-Chain format (SHA256+RIPEMD160 → ShortID).
   Both methods are now brand-neutral and describe the derivation,
   not the consumer.

The banderwagon test seed "eth_verkle_oct_2021" is left as-is — it
is an external constant from the Ethereum Foundation Verkle research,
not a Lux naming choice; renaming would break the KAT invariant.

Per CLAUDE.md x.x.x+1.
2026-05-22 21:15:18 -07:00
Hanzo AI 2dafeaa3df fix(go.mod): drop ../accel + ../gpu relative replaces — workspace provides them 2026-05-21 16:38:01 -07:00
Hanzo AI 7ae131e995 hqc: pure-Go bit-sliced GF(2)^N polymul + CGO single-shot path
Adds GPU/CPU split for HQC's hot inner-loop primitives:

  gpu_nocgo.go  Pure-Go bit-sliced Karatsuba mod (X^n - 1), byte-equal
                to PQClean's PQCLEAN_HQC{128,192,256}_CLEAN_vect_mul.
                Constant-time on secret operands (masked nibble table
                lookups; no data-dependent branches or indices).
                Modern Go compiler emits SIMD-friendly XOR loops on
                amd64 / arm64.

  gpu_cgo.go    Same surface, routed through luxfi/accel/hqc -> the
                C kernel in libluxgpu_hqc.a (also byte-equal to PQClean).

  gpu_kat_test.go         KAT cross-check across both builds — vectors
                          captured from the cgo path's PQClean kernel,
                          verified bit-identical from the pure-Go path
                          (100-iter checksum + single-vector KAT).
  gpu_polymul_test.go     Algebraic properties (commutativity, identity,
                          zero, distributivity, associativity fuzz x600).
  gpu_bench_test.go       Single-shot + batched benchmarks per mode.

Updated gpu.go to route the existing batchEncapsulateGPU /
batchDecapsulateGPU through accel/ops/code's batch surface (replaces
the old "not implemented" stubs). Updated randombytes_shim.c to be
the single canonical PQClean entropy bridge.

Determinism contract: validators reach consensus on HQC encapsulation
ciphertexts, so any byte-level divergence between the two paths is a
consensus fork. The KAT test pins this contract.

Test status (all three configs green):
  CGO_ENABLED=0 go test ./hqc/...                  18.1s
  CGO_ENABLED=1 go test ./hqc/...                  44.2s
  CGO_ENABLED=1 go test -tags=hqc_pqclean ./hqc/.. 5.5s

NIST KATs (HQC128/192/256 encap/decap byte-vectors): all PASS.

Bench numbers on Apple M1 Max (single-shot GF2 polymul, ns/op):
  HQC-128: pure-Go 2.03 ms / cgo 4.10 ms
  HQC-192: pure-Go 6.28 ms / cgo (n.m.)
  HQC-256: pure-Go 11.20 ms / cgo (n.m.)

The cgo path is currently slower than pure-Go because libluxgpu_hqc.a
ships from luxcpp/gpu/build with CMAKE_BUILD_TYPE empty (no -O3). With
the CMake build switched to Release, cgo will return to its expected
~30us / poly margin.

Wired via:
  crypto/hqc -> accel/hqc -> accel/ops/code -> luxcpp/gpu/libluxgpu_hqc
2026-05-21 13:34:58 -07:00
Hanzo AI 30d83a8793 go.mod: accel v1.0.7 → v1.1.0 (Comet SLHDSAVerifyBatch dispatch)
Lifts the floor on luxfi/accel so crypto/slhdsa/gpu.go can resolve
the new accel.LatticeOps.SLHDSAVerifyBatch method via the published
module instead of relying on go.work for local builds.
2026-05-15 17:43:48 -07:00
Hanzo AI 68cb31b1e3 rip: keccak_ziren.go + ProjectZKM/Ziren dep — never compiled into default builds
The file carried //go:build ziren so it only built under -tags ziren.
Nobody in the canonical Lux stack ships with that tag. But go mod
recorded the import as // indirect in every transitive consumer of
crypto, polluting ~100 go.mod files with a ZK-rollup-zkVM noise line.

Drop the file entirely. Ziren remains available to ZK-prover stacks
as a direct import — they don't need crypto's transitive vehicle.
2026-05-13 14:13:38 -07:00
Hanzo AI 12d6bdd409 crypto: drop inline ipa/ dir; depend on canonical github.com/luxfi/crypto/ipa
The inline ipa/ directory was a vendored copy of go-ipa that
collided with the separate luxfi/crypto/ipa module's import path —
any downstream that pulled both saw "ambiguous import" errors at
the bandersnatch / banderwagon / common/parallel packages.

Removed the inline tree and added `require github.com/luxfi/crypto/ipa
v1.2.4`. The verkle subpackage switches its banderwagon imports from
`luxfi/crypto/banderwagon` (local) to `luxfi/crypto/ipa/banderwagon`
(external) so its Point alias matches the type ipa.CreateMultiProof
and IPAConfig.Commit return. The local lux/crypto/banderwagon
package stays — its MultiExp/Precomp helpers remain available for
callers that want the Element-method shape; it just no longer
shares a struct identity with the verkle types.

Two pre-existing test failures in verkle (TestParseNodeEoA,
TestParseNodeSingleSlot) reproduce both with this change AND on the
pre-change tree — encoding-tag mismatch and projective-coord
hardcoding in the test's expected values. Not blocking; tracked
separately.
2026-05-13 11:35:28 -07:00
Hanzo AI 3ef98fa176 go.mod: bump go directive to 1.26.3 (security advisory) 2026-05-12 21:29:05 -07:00
Hanzo AI 60604dbc6e go.mod: drop phantom go-verkle require + stale ipa indirect
The github.com/ethereum/go-verkle string remained only in vendor-
attribution comments (verkle/ files were vendored, not imported);
keeping the phantom require with version 00010101000000-000000000000
made the module unbuildable standalone. luxfi/crypto/ipa v1.2.4 was
an outdated indirect referencing this module's own ipa/ subdir,
causing ambiguous-import on standalone builds.

Both removed; module now builds with GOWORK=off GOFLAGS=-mod=mod.
Vendor-attribution comments in verkle/*.go retained.
2026-04-29 00:21:10 -07:00
Hanzo AI caa6164b8b Merge bump-go-verkle-luxfi-2026-04-28 2026-04-28 09:36:52 -07:00
Hanzo AI a3dd3f991f ipa: fix stale banderwagon import path
Replace github.com/luxfi/crypto/ipa/banderwagon with the canonical
github.com/luxfi/crypto/banderwagon in ipa/batch.go and its test, plus
the verkle-ipa docs example and the rust spec_vectors comment. The old
ipa/banderwagon subdirectory was deleted in 5a1479b; banderwagon now
has a single canonical home at the top level of luxfi/crypto.

go.mod adds the indirect entries for go-verkle and go-ipa that the
rerouted test_helper graph now exercises. The luxfi-mirror replace
directives remain in place so all upstream go-ipa/go-verkle traffic
still flows through luxfi-maintained sources.

Build: go build ./... clean (one ld linker warning unrelated).
Tests: ./banderwagon/... ./ipa/... pass (7 ok, 2 no-test-files).

Pre-existing failure in ./verkle/ is unrelated: verkle_test.go
references BatchProof/VerifyBatch/ErrBatchLengthMismatch symbols that
were never implemented in the verkle package (separate gap, present on
main before this fix).
2026-04-28 01:54:51 -07:00
Hanzo AI af502dd5bc Bump go-verkle to luxfi-canonical module path
luxfi/go-verkle v0.2.3-luxfi declares module github.com/luxfi/go-verkle.
Drop the go.mod replace directive that mapped the old ethereum import
literal onto the luxfi mirror; switch the only consumer (verkle/verkle_test.go)
to the canonical luxfi import path.

Refs luxfi/go-verkle#233.
2026-04-28 01:19:02 -07:00
Hanzo AI f511ff6f39 merge: verkle-banderwagon-integrated-2026-04-27 2025-12-28 13:55:00 -08:00
Hanzo AI f371de541e merge: banderwagon-vanilla-2026-04-27 2025-12-28 13:40:00 -08:00
Hanzo AI 7032f46ceb feat(verkle): integrate luxfi/crypto/banderwagon canonical
Rewrite 10 import lines across 9 verkle/*.go files to point at
luxfi/crypto/{banderwagon,ipa,ipa/{ipa,common}} instead of
crate-crypto/go-ipa/*. Drops crate-crypto/go-ipa from go.mod.

verkle tests: 82 PASS / 4 SKIP / 2 FAIL (known-stale upstream fixtures
TestParseNodeEoA, TestParseNodeSingleSlot — pre-existing on
go-verkle@v0.2.2, unchanged baseline).

go build ./... clean.
2025-12-28 07:39:37 -08:00
Hanzo AI 483f6fe491 verkle: drop go-ethereum re-export, vendor real Go bodies
Replaces the prior `verkle/verkle.go` re-export shim (`type X =
upstream.X`, `var Fn = upstream.Fn` against `github.com/ethereum/go-verkle`)
with a full source vendor of `github.com/ethereum/go-verkle@v0.2.2` into
`/Users/z/work/lux/crypto/verkle/` under luxfi copyright. Every type and
function now has a concrete Go body in luxfi-owned files; no aliases
remain. Resolves the canonical-audit violation flagged in
CANONICAL_AUDIT.md (commit 9affea3).

Provenance:
  Upstream: github.com/ethereum/go-verkle@v0.2.2 (public domain / Unlicense)
  Per-file header notes vendor source and Lux Ecosystem License rebadge.

Files (13 source + 10 tests, ~7,900 LOC vendored):
  verkle/config.go, config_ipa.go, conversion.go, debug.go, doc.go,
  verkle/empty.go, encoding.go, hashednode.go, ipa.go, proof_ipa.go,
  verkle/proof_json.go, tree.go, unknown.go (+ matching _test.go)

Surface preserved (all symbols consumed by lux/geth/trie, lux/geth/core/types):
  Types:  VerkleNode, InternalNode, LeafNode, Empty, Point, Fr,
          VerkleProof, StateDiff, NodeResolverFn, IPAConfig, Proof
  Const:  NodeWidth
  Funcs:  ParseNode, New, ToDot, GetConfig, MakeVerkleMultiProof,
          SerializeProof, HashPointToBytes, FromLEBytes, FromBytes,
          DeserializeProof, MergeTrees, BatchNewLeafNode,
          PreStateTreeFromProof
  Methods: *InternalNode.{Insert,Commit,Hash,GetValuesAtStem,
           DeleteAtStem}, IPAConfig.CommitToPoly, ...

go.mod: drop direct require on github.com/ethereum/go-verkle; promote
        crate-crypto/go-ipa and davecgh/go-spew to direct (still pulled
        through banderwagon primitives — to be swapped to luxfi/crypto/ipa
        once the parallel banderwagon vendor lands at lux/crypto/banderwagon).

Tests (GOWORK=off go test ./verkle/ -count=1):
  82 PASS, 4 SKIP, 2 FAIL.
  TestParseNodeEoA and TestParseNodeSingleSlot fail identically against
  upstream go-verkle@v0.2.2 (verified) -- these are pre-existing upstream
  test fixtures gone stale; not caused by the vendor.

Consumer compatibility verified by external module replace+build
exercising every consumed symbol: ok.

Outstanding (tracked, not blocking):
  - Switch IPA primitives import from `crate-crypto/go-ipa/{banderwagon,
    common,ipa}` to `luxfi/crypto/ipa/*` once the banderwagon-vanilla
    branch lands. Done in this commit would conflict with the parallel
    work-in-progress.
  - Two upstream-stale test fixtures (TestParseNodeEoA,
    TestParseNodeSingleSlot) to be regenerated against current encoding
    in a follow-up.

Branch: verkle-vanilla-2026-04-27
2025-12-28 05:55:28 -08:00
Hanzo AI 35ee76360e go.mod: replace go-ipa and go-verkle with luxfi mirrors
Route github.com/crate-crypto/go-ipa and github.com/ethereum/go-verkle
through luxfi-maintained mirrors so all Lux crypto consumers converge on a
single canonical source. Pinned to luxfi/go-verkle v0.2.2 and
luxfi/go-ipa@d31adc04. See LUXFI-FORK.md in each fork for sync policy.

Tests verified: ./verkle/... and ./ipa/... pass.
2025-12-28 00:43:01 -08:00
Hanzo AI ecaca10cdb canonical Go entry: backend selector + batch GPU paths via lux/accel
luxfi/crypto becomes the single Go entry point for ALL Lux-family crypto.
Every public function in this module now dispatches between three
implementations through a runtime-selectable backend:

  - vanilla: pure-Go reference (always available)
  - cgo:     native binding (blst, libsecp256k1, ckzg) where present
  - gpu:     batch acceleration via github.com/luxfi/accel

The dispatcher reads LUX_CRYPTO_BACKEND (auto|vanilla|cgo|gpu); auto
picks the most capable backend the binary was compiled and linked with.

New canonical packages:
  backend/             runtime backend selector (env + programmatic)
  internal/gpuhost/    accel session lifecycle, single per-process
  keccak/              Keccak-256 with batch GPU dispatch
  sha256/              SHA-256 with batch GPU dispatch
  sha3/                SHA3 / SHAKE family
  ripemd160/           RIPEMD-160 (Bitcoin/Lux address derivation)
  ed25519/             Ed25519 with batch GPU verify
  bn254/               canonical alias for bn256 (matches FIPS naming)
  modexp/              canonical alias for bigmodexp
  evm256/              EIP-196/197 precompile ABI wrappers
  poseidon/            Poseidon2 hash via gnark-crypto
  pedersen/            Pedersen commitments over BN254
  ntt/                 Number-Theoretic Transform reference
  polymul/             negacyclic polynomial multiplication

Extended existing packages with batch GPU paths:
  bls/batch.go         BatchVerify routes through accel.BLSVerifyBatch
  mldsa/batch.go       BatchVerify (ML-DSA-65) via accel.DilithiumVerifyBatch
  mlkem/batch.go       BatchEncapsulate / BatchDecapsulate via Kyber kernels
  secp256k1/batch.go   BatchVerifySignature via accel.ECDSAVerifyBatch

GPU dispatch is gated on (a) backend.Default(), (b) batch size threshold,
and (c) accel.Available(). When any gate fails the call falls through to
the vanilla CPU path; output is byte-identical.

The legacy gpu/ stub is replaced with a thin probe surface (Available,
Backend, Devices, Version) that delegates to the same gpuhost session.

Tests show vanilla and gpu backends produce identical outputs across all
batch entry points (-race clean).

See AUDIT.md for the per-algorithm state matrix and honest gaps.
2025-12-27 19:30:33 -08:00
Hanzo AI f937139f29 fix: use luxfi/age instead of filippo.io/age
All encryption imports now use github.com/luxfi/age v1.4.0, the Lux
fork with native ML-KEM-768 + X25519 hybrid support.
2025-12-27 17:46:24 -08:00
Hanzo Dev 040dce5b0a feat: add verkle and bigmodexp re-export wrappers
Re-export github.com/ethereum/go-verkle and
github.com/ethereum/go-bigmodexpfix under luxfi/crypto namespace
so downstream packages (luxfi/geth) never import ethereum/* directly.
2025-12-27 14:44:09 -08:00
Hanzo Dev b01d9e9e7b feat: Go 1.26.1 crypto features + runtime/secret support
- Add secret/ package: wraps runtime/secret.Do() for secure key erasure
  when built with GOEXPERIMENT=runtimesecret, no-op stub otherwise
- Add encryption/hpke.go: HPKE encryption using Go 1.26 stdlib crypto/hpke
  with X25519 (classical) and ML-KEM-768+X25519 (post-quantum hybrid)
- Wrap BLS key generation (both CGO and pure Go) in secret.Do()
- Wrap HexToECDSA and LoadECDSA in secret.Do() for key byte cleanup
- Simplify random.go: crypto/rand.Read never errors in Go 1.26
- Update CI workflows to Go 1.26.1, add GOEXPERIMENT=runtimesecret job
- Update dependencies: circl 1.6.3, x/crypto 0.48.0, age 1.3.1
2025-12-27 13:26:02 -08:00
Hanzo Dev fbe2b4578e chore: bump Go 1.26.0 → 1.26.1
Fixes 5 stdlib CVEs (html/template, os, net/url, crypto/x509 x2).
2025-12-27 13:00:00 -08:00
Hanzo Dev eed5bc77f1 chore: update Go module dependencies 2025-12-27 12:33:57 -08:00
Hanzo Dev 97ab7bd21b fix: update luxfi/log to v1.4.1 (module path fix)
luxfi/log v1.3.0 declared its module path as luxfi/logger,
causing build failures in downstream consumers.
2025-12-27 06:55:28 -08:00
Zach Kelling 6b9d89bd22 fix: update luxfi/log to v1.3.1 and exclude ASM dirs from gosec
- luxfi/log v1.3.0 declared module as luxfi/logger, v1.3.1 fixes this
- Exclude bn256 and ipa/bandersnatch from gosec (ASM stubs cause panic)
2025-12-27 06:03:23 -08:00
Zach Kelling af49b0a2b6 chore: sync with node requirements 2025-12-27 04:19:14 -08:00
Zach Kelling f4d92f5ef9 fix: Go version 1.25.5 → 1.22, update bindings 2025-12-27 03:53:12 -08:00
Zach Kelling bd178f910b chore: update deps to latest 2025-12-27 03:01:07 -08:00
Zach Kelling 4d15ed700c move address/formatting into crypto 2025-12-27 02:35:05 -08:00
Zach Kelling 9bb37d2a91 refactor: update import path to github.com/luxfi/constants 2025-12-27 02:09:03 -08:00
Zach Kelling d034d6f439 chore: update gpu to v0.30.0
Updates github.com/luxfi/gpu to v0.30.0 which includes
ZK operations (Poseidon2, Merkle tree, commitments).
2025-12-27 01:16:58 -08:00
Zach Kelling 5b49b4b551 feat(hashing): add hashing package with SHA256/RIPEMD160
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
2025-12-26 23:58:52 -08:00
Zach Kelling 4b5676f742 fix: use metal tag for GPU files, pure Go is default 2025-12-26 21:48:40 -08:00
Zach Kelling 7b0ce8ca27 Remove dead code and consolidate GPU ZK operations
- Remove crypto/common/math/ (dead code, using luxfi/math instead)
- Consolidate gpu/zk.go to use unified luxfi/gpu package
- Delete platform-specific gpu/zk_metal.go in favor of unified approach
- Update bls/types.go with GPU bindings
- Update dependencies for luxfi/gpu
2025-12-26 20:56:36 -08:00
Zach Kelling 706f762ea6 feat(gpu): add NTT cache, worker pools, and BLS batch verification
- Add NTT cache with LRU eviction for twiddle factors
- Add worker pool for parallel GPU operations
- Add BLS batch signature verification
- Improve element operations for Bandersnatch
- Add comprehensive tests for GPU crypto operations
2025-12-26 16:10:11 -08:00
Zach Kelling abaf7655f9 fix(gpu): use luxgpu build tag for CGO bindings
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 ./...
2025-12-26 15:18:06 -08:00
Zach Kelling a3d4cd1b71 fix: exclude broken geth v1.16.1 module path mismatch
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.
2025-12-20 13:56:20 -08:00
Zach Kelling 6fe11f3e77 chore: remove local cache/utils, use external luxfi/cache package
- 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
2025-12-14 21:18:31 -08:00
Zach Kelling deca5e6954 Update dependencies to latest versions 2025-12-13 10:48:20 +00:00
Zach Kelling a9769373ca fix: resolve build errors and ensure crypto independence from geth
- 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)
2025-12-12 21:51:02 -08:00