1948 Commits
Author SHA1 Message Date
zeekayandHanzo Dev dfbcc8a7a4 Build on Go 1.27
Bumped the go directive to 1.27.1. Build, vet and the full test suite
are clean on that toolchain.

Co-authored-by: Hanzo Dev <[email protected]>
v7.1.7
2026-09-17 12:01:02 -07:00
zeekay 7203d3a3e1 every Hanzo dependency is the version npm serves
Ranges drift once nothing moves them: a caret that has not been rewritten
since it was written pins whatever was current that day, and an exact pin
cannot even take a patch. Both are updated here.

One line per package, so a surface reads the same components, the same
tokens and the same face as every other one.
2026-09-01 16:02:18 -07:00
zeekayandHanzo Dev 94cad2a365 the corporate name is Lux Industries Inc
Lux Partners Limited is not the entity behind this work. Every place the
old name stood — copyright lines, site footers, brand config, legal and
compliance text — now names the company that actually holds it.

lux.fund is the exception and is not renamed to match: that site belongs
to Lux Assets Management LLC, a different company, and it says so.

Two kinds of line were left for a person rather than rewritten. A dated
news item recording that Lux Partners Limited was established in the Isle
of Man is a historical fact, and renaming it would falsify the record. And
a sentence asserting that the company is domiciled in the Isle of Man is a
claim about a jurisdiction, not a name — an Inc or an LLC is not an Isle
of Man company, so swapping the name there would assert something untrue.

Co-authored-by: Hanzo Dev <[email protected]>
v7.1.6 v7.1.5
2026-08-28 13:02:19 -07:00
zeekay 26c2f6db55 fix(docs): load Zen through the css entry, which carries types 2026-08-23 15:04:13 -07:00
zeekay 365fdd47e6 feat(docs): serve Zen from @hanzo/font 2026-08-23 14:53:09 -07:00
zeekay e4ea36acc9 carry the github copy onto the forge
github.com held commits this host lacked, which refuses the mirror push
("fetch first") and stops github receiving anything at all. Merging rather
than overwriting, so the mirror is a fast-forward again and neither side's
work is dropped.
2026-08-20 21:55:19 -07:00
zeekay 28b0c65579 run on the native fleet
Adds .hanzo/workflows/cicd.yml calling the canonical pipeline and drops the
GitHub-hosted workflows it replaces. Lands here because this is where the repo
is written — git.hanzo.ai is upstream and github.com is its push mirror, so the
same change made on github.com never reaches the runner fleet.
2026-08-20 20:20:17 -07:00
zeekay 89a85a1d78 delete the GitHub-hosted workflows the native gate replaces
ci.yml ran static checks and the Go suite on ubuntu-latest; docs.yml built
docs/ and pushed it to GitHub Pages from two more ubuntu jobs. The suite now
runs in hanzo.yml on the git.hanzo.ai fleet. Nothing is lost with Pages: the
site was never enabled, so those uploads had no destination — when docs get a
home it is the static plane, declared here as site:.
2026-08-20 18:58:23 -07:00
zeekay 5e3758c5bf delete the GitHub-hosted workflows the native gate replaces
ci.yml ran static checks and the Go suite on ubuntu-latest; docs.yml built
docs/ and pushed it to GitHub Pages from two more ubuntu jobs. The suite now
runs in hanzo.yml on the git.hanzo.ai fleet. Nothing is lost with Pages: the
site was never enabled, so those uploads had no destination — when docs get a
home it is the static plane, declared here as site:.
2026-08-20 18:58:22 -07:00
zeekay 59dae90240 call the canonical pipeline
Seven lines of triggers; every knob is in hanzo.yml.
2026-08-20 18:58:14 -07:00
zeekay 91491bd8f1 gate lattice on its own Go suite, run on the native fleet
go build ./... then go test ./... -count=1 — 46 packages, ~25s from cold.
2026-08-20 18:58:13 -07:00
zeekayandHanzo Dev 83314279ba Revert "docs: shorten the consensus.go design note"
That commit re-added consensus.go, which the lattigo merge (78026c60) had
deliberately deleted. It was a never-compiling sketch referencing Network and
Node, neither of which exists here; deleting it was right and resurrecting it was
my error.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-29 16:45:26 -07:00
zeekayandHanzo Dev 59457ab0c4 docs: shorten the consensus.go design note
It is excluded from the build; the note only needs to say what the sketch is and
why it cannot compile.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-29 16:44:15 -07:00
zeekay 7e84e2bda2 chore(deps): go get -u ./...
Updated dependencies to latest minor versions via go get -u + go mod tidy.
2026-06-02 11:22:25 -07:00
zeekay 23aa92147b merge: security/readuint-slice-dos-2026-03-03 2026-06-01 16:25:16 -07:00
zeekayandGitHub f5236f52c6 security(buffer): bound ReadUintNSlice to prevent DoS via crafted Reader (#3)
ReadUint{16,32,64}Slice recurses on c[buffered:] without making progress
when the underlying Reader returns a partial Peek (buffered == 0) but no
error. An attacker-supplied wire prefix combined with a long destination
slice exhausts the goroutine stack on the destination chain.

Discovered by github.com/luxfi/warp/pulsar's FuzzPulseDeserialize
harness during the Mar-3 2026 PQ Consensus Architecture Freeze
(regression seed: testdata/fuzz/FuzzPulseDeserialize/ccdb090e0ca0007b).

Fix:
  - Replace recursion with an iterative loop (O(1) stack)
  - Detect zero-progress reads and return ErrZeroProgress
  - Add Read{Uint16,Uint32,Uint64}SliceBounded length-prefix-aware
    wrappers gated by MaxSliceLen() (default 1 MiB, configurable via
    LUX_LATTICE_MAX_UINT64_SLICE_LEN env var)
  - Regression tests for all three slice readers + happy path + bounded
    rejection
2026-05-29 20:31:16 -07:00
97ee1a7e87 feat(multiparty): serialization for ShamirPolynomial + Combiner active-set validation (#1)
* feat(multiparty): serialization for ShamirPolynomial + Combiner active-set validation

Closes the only multiparty/ type missing the serialization contract documented in
the package README (ShamirPolynomial), enabling parties to persist their threshold-share
generator polynomial across protocol sessions (proactive re-sharing, crash recovery,
offline distribution). Methods delegate to the underlying structs.Vector[ringqp.Poly]
to stay byte-equivalent with existing share types.

Also hardens Combiner.GenAdditiveShare: when an activesPoints entry isn't present in
the others set passed to NewCombiner, the current code panics inside MulRNSScalar
due to a nil RNSScalar map miss; this returns a typed error instead. Adds round-trip
serialization and negative-path tests under testThreshold.

* chore: gofmt 4 files flagged by static checks

Pure formatting (operator spacing, alignment) on:
- gpu/gpu.go
- gpu/gpu_test.go
- types/reduction_test.go
- types/trust_test.go

These were tripping `make checks` (`go fmt: problems in files`) on this
PR's static-check workflow. No semantic changes.

---------

Co-authored-by: Abhishek Krishna <[email protected]>
2026-05-19 11:31:21 -07:00
zeekayandGitHub 61e0232a05 Merge pull request #10 from luxfi/feat/lp-107-wire-package
LP-107 Phase 3 (cycle-free): lattice consumes luxfi/math/codec (refile of #6)
2026-05-17 10:21:13 -07:00
zeekay c649652286 LP-107 Phase 3 (cycle-free): lattice consumes luxfi/math/codec
wire/wire.go — lattice's wire-format hardening boundary. luxfi/math/
codec has no lattice imports so this is a safe one-way dependency.

LatticeConsensusWireLimits (4096 cap, 16 MiB frame) for Pulsar-class
data; LatticeFHEWireLimits (16384 cap, 32 MiB frame) for FHE-class.
ValidateUintSliceFrame routes the chosen Limits to math/codec.Reader.

Phase 3 inversion FULL form (lattice/ring delegating to luxfi/math/
ntt for the canonical NTT body) already landed in main via 26f52514
(modular_reduction shim). This wire/ package is the remaining cycle-
free portion not covered by that shim — codec hardening lives once
in luxfi/math/codec and is now reused uniformly across pulsar, lens,
fhe, AND lattice. The same lattice issue #4 attack input is rejected
identically by all four consumers.

Refiled from #6 (stale go.mod bump to math v1.3.0); main is already
on luxfi/math v1.4.1 (no go.mod change needed).

Tests:
* TestValidateUintSliceFrame_RejectsHugeLength — regression for
  lattice issue #4 attack input (70-trillion-element length).
* TestValidateUintSliceFrame_FHELimits_AcceptsLarger — confirms
  FHE limits accept 8192 (FHE cap 16384), consensus limits reject
  8192 (consensus cap 4096).

GOWORK=off go test ./wire/ → PASS
GOWORK=off go build ./...   → clean
2026-05-17 10:20:04 -07:00
zeekayandGitHub 922f1efd14 chore: bump Go toolchain to 1.26.3 (#9)
Pin Go version to 1.26.3 across go.mod, CI workflows, and Dockerfiles
for canonical alignment with the rest of the luxfi/* stack.
2026-05-16 16:43:46 -07:00
zeekayandGitHub 7d5ad37221 Merge pull request #8 from luxfi/chore/drop-math-replace-publish-1.4.1
go.mod: drop local-disk replace; pin luxfi/math v1.4.1
2026-05-16 16:29:17 -07:00
zeekay fba9f16a32 go.mod: drop local-disk replace; pin luxfi/math v1.4.1 (now published) 2026-05-16 16:29:01 -07:00
zeekayandGitHub c59a56b731 Merge pull request #5 from luxfi/fix/makefile-fmt-quoting
fix(ci): unblock make checks — quoting, gofmt, lint:ignore, no-stub policy
2026-05-16 16:18:43 -07:00
zeekayandGitHub f77860de4e Merge pull request #7 from luxfi/licensing/canonical-pointer
docs: add LICENSING.md pointer to canonical Lux IP strategy
2026-05-15 16:39:08 -07:00
zeekay ad62c812e6 docs: add LICENSING.md pointing at canonical Lux IP strategy
Single LICENSING.md file referencing the canonical three-tier IP and
licensing strategy at github.com/luxfi/.github/blob/main/profile/README.md.

LICENSE file is unchanged; this only adds a navigational pointer.
2026-05-15 16:39:01 -07:00
zeekay c340b3d0f6 go.mod: bump go directive to 1.26.3 (security advisory) 2026-05-12 21:30:16 -07:00
zeekay 445933fbb3 LLM.md: drop dated 'Last Updated' line 2026-05-05 12:30:56 -07:00
zeekay 241e161307 Pin luxfi/math v1.4.0; replace with local working tree
v2.0.0+incompatible was a placeholder; no v2 tag exists. Pinned to
v1.4.0 (current canonical). Replace points at the local math working
tree because lattice imports ntt/subring which lives in uncommitted
canonical-relocation work.
2026-05-05 10:13:37 -07:00
zeekay 88aeacf23e merge LP-107 Phase 3: ring/modular_reduction shim over math/ntt/canonical 2026-05-04 10:29:08 -07:00
zeekay 26f525141d LP-107 Phase 3: ring/modular_reduction is now a thin shim over math/ntt/canonical
LP-107 inverted the dependency: luxfi/math/ntt/canonical now OWNS the
canonical Montgomery / Barrett body. This package re-exports it so
downstream consumers (luxfi/pulsar, luxfi/fhe, luxfi/threshold,
luxfi/multiparty, luxfi/lattice/multiparty, luxfi/lattice/schemes,
...) see no source change.

Before: 205 lines of inline Montgomery / Barrett scalars.
After:  85 lines re-exporting canonical's MForm / IMForm / MRed /
        MRedLazy / BRedAdd / BRedAddLazy / GenMRedConstant /
        GenBRedConstant.

Tests:
  GOWORK=off go test -count=1 ./... → all packages PASS:
    ok  github.com/luxfi/lattice/v7/ring             0.558s
    ok  github.com/luxfi/lattice/v7/ring/ringqp      0.432s
    ok  github.com/luxfi/lattice/v7/multiparty       1.552s
    ok  github.com/luxfi/lattice/v7/multiparty/mpbgv 0.460s
    ok  github.com/luxfi/lattice/v7/multiparty/mpckks 2.018s
    ok  github.com/luxfi/lattice/v7/schemes/bgv      1.983s
    ok  github.com/luxfi/lattice/v7/schemes/ckks     2.276s
    ok  github.com/luxfi/lattice/v7/types            0.868s
    ok  github.com/luxfi/lattice/v7/examples/...     all green

go.mod adds github.com/luxfi/math dependency.

Subsequent commits will migrate the rest of ring/ntt.go,
ring/subring.go etc. to thin shims as well.
2026-05-04 10:26:59 -07:00
zeekay ae2f23dd35 fix(ci): unblock make checks — quoting, gofmt, lint:ignore, no-stub policy
Static-checks job has been failing on every PR (including #3) due to a
shell-interpolation bug in the Makefile + a build of accumulated lint
findings the bug had been hiding. Cleaned up end-to-end so make checks
runs green and PR #3 (security/readuint-slice-dos-2026-03-03) can land.

1. Makefile fmt-step: quote $$FMTOUT in `[ -z $$FMTOUT ]` test.
   Unquoted, multi-file go-fmt output word-splits and the test sees
   `[ -z FILE1 FILE2 ]` -> "/bin/sh: [: FILE2: unexpected operator".
   Same fix to the trailing `echo $$FMTOUT`.

2. go fmt sweep: gpu/gpu.go, gpu/gpu_test.go, types/reduction_test.go,
   types/trust_test.go had whitespace-only formatter findings that the
   crashing fmt-test step had been hiding.

3. ST1003 (mixed-case identifier): four wire-format-pinned consts in
   types/trust.go (TrustCpuGpuCompositeTEE / IOLevelCpu*) carry a
   //lint:ignore directive — their String() return values are part of
   the wire/log contract documented at line 80 ("do not rename"), so
   the Go-side identifiers must stay byte-aligned with the wire spelling.

4. ST1005 (capitalized error string): two error strings in gpu/gpu.go
   rephrased to lead with a noun ("ring degree N" / "modulus Q-1"
   instead of capital "N" / capital "Q") without changing semantics.

5. ST1000 (package comment): gpu/gpu_montgomery_*.go file header
   reformatted so the "Package gpu" line is the leading sentence.

6. G104 (unhandled errors): four `prng.Read(b)` call sites in gpu/gpu.go
   now `_, _ = prng.Read(b)` — the PRNG is keyed sampling output; read
   length is bounded by buffer length and a short read here is not a
   correctness issue.

7. G115 (int -> uint conversion): types/reduction.go switches `bitlen`
   to int (matches bits.Len64's return type, used only against literal
   small ints in the comparison ladder). gpu/gpu_montgomery_purego.go
   adds /* #nosec G115 */ on uint32(s.N) — s.N is validated >0 and
   bounded by ring degree above.

8. NO-STUB POLICY: gpu/gpu_montgomery_stub.go renamed to
   gpu/gpu_montgomery_purego.go and given a real pure-Go body that
   delegates to ring.SubRing.NTT / INTT (the canonical Go implementation
   in this repo). The "stub" name was misleading: there should never be
   a Lux Go file that returns "GPU unavailable" errors when the cgo+gpu
   build tag is unset — the pure-Go path is the canonical reference and
   always works. Output is byte-equal to the cgo+gpu path, identical
   semantics across build tags.

   Same rename for ring/ntt_simd_stub.go -> ring/ntt_simd_dispatch_purego.go
   with comment update: it's a dispatch hook (returns false to signal
   "use canonical scalar NTT below"), not an incomplete impl.

Verification:
* make checks: all 6 substeps PASS (go fmt / vet / goimports / staticcheck /
  govulncheck / gosec) on this branch.
* go test -count=1 ./...: all packages green; ring + ringqp + schemes/bgv
  + schemes/ckks + multiparty + utils/* all pass.
2026-05-04 08:37:27 -07:00
zeekay 3e5fd84d34 feat(blindrot): BatchEvaluate parallel API for N independent blind rotations
Fans N independent (*Evaluator).Evaluate calls across a goroutine pool
of GOMAXPROCS workers. Each worker owns a fresh NewEvaluator clone
because the receiver carries mutable scratch buffers (poolMod2N,
accumulator) and the package exposes no ShallowCopy. The BRK key set
is shared read-only.

Per-iteration output is byte-equal to a serial Evaluate call.

Measured 4.61x at N=16 on M1 Max P-cores with blindrot test params
(LogN=10/9, Q=0x7fff801). Geometry matches the 5.84x ceiling
documented in fhe/policy/PERFORMANCE.md section 4 at full bootstrap
params; the gap is the relative weight of per-worker NewEvaluator
allocation against the cheaper test bootstrap.

Tests:
- TestBatchEvaluate_ByteEqualSerial: N=16 byte-equal vs serial
- TestBatchEvaluate_Empty: nil in -> nil out
- TestBatchEvaluate_Single: N=1 equivalent to direct Evaluate
- TestBatchEvaluate_LengthMismatch: rejects mismatched len(testPolys)
- TestBatchEvaluate_RaceClean: passes -race
2026-04-27 14:32:11 -07:00
zeekay a43f4e3473 feat(types): trust + privacy enums for GPU runtime registry
Add ComputeTrustMode, ConfidentialIOLevel, and WorkloadPrivacyClass
single-byte enums plus String / Valid predicates to luxfi/lattice/v7/
types. These are the canonical Go definitions consumed by:

  - luxfi/mpc/pkg/registry      (worker / node capability records)
  - luxfi/mpc/pkg/attestation   (composite envelope claims)
  - luxcpp/lattice/.../trust    (byte-stable C++ mirror)

Tests pin the underlying integer values, monotonic ordering, and the
4-byte trustTriple cross-language byte image that the matching C++ test
re-creates via memcpy. Reference: LP-137-TRUST-REGISTRY.md.
2026-04-27 13:33:53 -07:00
zeekay 5d4473dfb8 feat(gpu): Lattigo-byte-equal Montgomery NTT dispatch path
Go-side surface for the Montgomery Metal NTT shipped in
luxcpp/lattice. New constructors:

- gpu.NewMontgomeryNTTContext(s *ring.SubRing): binds a SubRing to a
  GPU-resident NTT context, capturing RootsForward/RootsBackward/
  NInv/MRedConstant. Forward/Backward output is byte-equal to
  ring.SubRing.NTT/INTT for the same inputs.
- gpu.RegisterSubRing / LookupSubRing / UnregisterSubRing: per-SubRing
  registry so the Ring.NTT fast-path can route calls to GPU.
- gpu.SetNTTThreshold / NTTThreshold: tunable per-N crossover.

ring.SubRing now consults pluggable NTT dispatchers via
ring.SetGPUDispatchers (called from gpu/init). Default behaviour is
unchanged -- dispatcher returns false unless a SubRing was explicitly
registered AND the threshold is non-zero. Pure-Go path remains the
default.

Tests:
- TestMontgomery_ByteEqual_Forward: 1024 random vectors x N in
  {1024, 2048, 4096} byte-equal to ring.SubRing.NTT
- TestMontgomery_ByteEqual_Inverse: same for INTT
- TestMontgomery_RoundTrip: at N up to 8192
- TestBatchNTT_NoSegfault: previously-segfaulting (N=4096, B=128) now
  runs and produces byte-equal output to per-poly Go pure-Go.

Bench (M1 Max, benchtime=10x):
- N=4096 B=128 batched: 12.6 us per NTT (4.57x faster than
  Go pure-Go)
- N=4096 B=64 batched:  18.2 us per NTT (3.18x faster)
- Single-poly Metal remains slower than Go at all measured N
  (8-100x slower); single-poly dispatch is opt-in via threshold.

Also fixes a pre-existing bug in gpu.go pure-Go NewNTTContext:
ring.NewSubRing alone does not generate NTT constants; switched to
ring.NewRing which calls generateNTTConstants under the hood.
2026-04-27 13:00:23 -07:00
zeekay 6790a14536 feat(types): PolyDomain + NTTContext + ReductionBudget for FHE-GPU dispatch
LP-137-FHE-TYPING. Type-system foundation that prevents silent FHE
correctness failures at the kernel boundary — the architectural fix for
the #121 class of bug (Go Ring.NTT in Montgomery, Metal NTT in Barrett
standard form, dispatching with identical signatures).

New package github.com/luxfi/lattice/v7/types:

- PolyDomain (uint8 enum): Standard, Montgomery, NTTStandard, NTTMontgomery.
- NTTContext (48-byte struct): modulus, MontR, MontR2, QInv, N, ModulusID,
  TwiddleOffset, InputDomain, RootDomain, OutputDomain. Validate()
  rejects domain mismatches at dispatch.
- ReductionMode (uint8 enum) + ReductionBudget (24-byte struct): track
  lazy reduction op budgets. SafeBoundFor enforces 64/63/62/61-bit
  modulus caps for Strict/Lazy2/Lazy4/Lazy8.
- Sentinel errors: ErrDomainMismatch, ErrModulusZero, ErrNNotPowerOfTwo,
  ErrModulusTooLargeForLazy.

Layout is byte-stable across Go and C++ for cgo / shared-memory dispatch.
Verified by unsafe.Sizeof + offset assertions and a cross-language byte
image test (TestNTTContext_CrossLangByteImage) matching the C++ side
in luxcpp/lattice/test/types_test.cpp.

20 Go tests pass.
2026-04-27 12:47:26 -07:00
zeekay a0f60e9a4a feat(gpu): restore Metal/MLX cgo bridge with pkg-config linking
Restore gpu package after Feb deletion (2602685). Use pkg-config:
lux-lattice for the cgo LDFLAGS so the bridge picks up the installed
luxcpp/lattice shared library and headers — replaces the prior
hardcoded -L build/lib -llattice path that referenced a directory
that never existed and a library name (-llattice) that did not match
the actual file (libluxlattice.dylib).

Single-poly NTT/INTT/PolyMul/PolyAdd/PolySub/PolyScalarMul/sampling
all link and pass round-trip tests when built against the GPU-enabled
build (cmake -DWITH_GPU=ON) of luxcpp/lattice. Verified on M1 Max:

  $ go test -tags gpu -run TestGPUAvailable -v ./gpu/
  GPU Available: true, Backend: Metal (MLX)

Caveat: BatchNTT/BatchINTT SIGSEGV at every (N>=1024, B>=16) tested.
Pure-Go fallback (gpu.go) is the safe path until the C library batch
path is fixed in luxcpp/lattice.
2026-04-27 12:20:33 -07:00
zeekay 8c50b24c80 feat: deterministic key generation from seeded PRNG
Add NewEncryptorFromPRNG and NewKeyGeneratorFromEncryptor to support
consensus-safe FHE keygen where all validators must derive identical keys
from a shared seed.
2026-04-13 03:11:41 -07:00
zeekay 9a7cb0169f chore: update dependencies 2026-04-01 14:02:46 -07:00
zeekay f303ffce3c fix: cbdEta3 3-byte read for cross-boundary bits
When bitOff >= 3, 6 bits can span 3 bytes. Previously only read 2 bytes,
which would silently lose high bits and produce incorrect coefficients.
2026-03-22 20:34:40 -07:00
zeekay fa52b7ecb2 feat: SIMD NTT acceleration infrastructure (Go 1.26 GOEXPERIMENT=simd)
Add AVX2-accelerated NTT butterfly operations using Go 1.26's
simd/archsimd package. The SIMD path vectorizes Montgomery reduction
(MRedLazy) by decomposing 64x64->128 multiplies into 32-bit widening
multiplies via VPMULUDQ, processing 4 butterflies per vector operation.

- ring/ntt_simd.go: SIMD implementations of mredLazy4, mul64x4, and
  accelerated nttCoreLazyAccel/inttCoreLazyAccel for t>=8 stages
- ring/ntt_simd_stub.go: no-op stubs for non-SIMD builds
- ring/ntt_simd_test.go: correctness tests for mul64x4 and mredLazy4
  against scalar reference, plus NTT round-trip verification
- ring/ntt.go: dispatch to SIMD path when available (2 lines added)
- CI: add GOEXPERIMENT=simd test job on ubuntu (amd64)
2026-03-22 13:42:04 -07:00
zeekay eecbcadb05 fix: add nosec G602 annotations for safe slice access patterns 2026-03-22 13:27:20 -07:00
zeekay dc5b1bcf25 fix: remove hardcoded -go 1.24 from staticcheck (use module version) 2026-03-22 13:07:22 -07:00
zeekay 2d9da5a63f fix: add nosec annotations for intentional integer conversions (gosec G115) 2026-03-22 12:51:48 -07:00
zeekay 8ccf8f29ea fix: nosec annotation for constant-time ctLt (gosec G115) 2026-03-22 12:23:43 -07:00
zeekay 3c6513b646 style: gofmt alignment in sampler constants 2026-03-22 12:19:51 -07:00
zeekay 67e41dcb92 feat: add constant-time CBD sampler (NIST ML-KEM FIPS 203)
Add CenteredBinomial distribution sampler as a constant-time alternative
to the existing Gaussian sampler. Addresses timing side-channel (CV=0.376)
identified in Dragonfire security review F-001.

- New sampler_cbd.go: CBDSampler with optimized eta=2/3 paths
- Constant-time signed-to-modular conversion via ctLt() bitmask
- Integrated into NewSampler() factory and ParametersFromMap()
- 7 regression tests: range, distribution, timing, ReadAndAdd, AtLevel
2026-03-22 12:01:47 -07:00
zeekay d281f3269f chore: bump Go 1.26.0 → 1.26.1
Fixes 5 stdlib CVEs (html/template, os, net/url, crypto/x509 x2).
2026-03-12 01:09:04 -07:00
zeekay 6088daefa7 security(buffer): bound ReadUintNSlice to prevent DoS via crafted Reader
ReadUint{16,32,64}Slice recurses on c[buffered:] without making progress
when the underlying Reader returns a partial Peek (buffered == 0) but no
error. An attacker-supplied wire prefix combined with a long destination
slice exhausts the goroutine stack on the destination chain.

Discovered by github.com/luxfi/warp/pulsar's FuzzPulseDeserialize
harness during the Mar-3 2026 PQ Consensus Architecture Freeze
(regression seed: testdata/fuzz/FuzzPulseDeserialize/ccdb090e0ca0007b).

Fix:
  - Replace recursion with an iterative loop (O(1) stack)
  - Detect zero-progress reads and return ErrZeroProgress
  - Add Read{Uint16,Uint32,Uint64}SliceBounded length-prefix-aware
    wrappers gated by MaxSliceLen() (default 1 MiB, configurable via
    LUX_LATTICE_MAX_UINT64_SLICE_LEN env var)
  - Regression tests for all three slice readers + happy path + bounded
    rejection
2026-03-03 12:00:00 -08:00
zeekay 7c8ed2cea9 chore: update Go to 1.26 2026-03-03 05:04:48 -08:00
zeekay 574c8e0895 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	.github/workflows/ci.yml
#	go.mod
#	go.sum
2026-02-22 00:55:52 -08:00