Commit Graph
97 Commits
Author SHA1 Message Date
Hanzo AI 0a10cdc0c6 security: fix FHE encryptor panic and NTT timing side-channel
F13: Add EncryptSafe(bool) (*Ciphertext, error) that returns errors instead of
panicking. Existing Encrypt(bool) is preserved but deprecated -- it now calls
EncryptSafe internally.

F07: Remove data-dependent branch (if hi == 0) from mulModBarrett. Always
execute the full 128-bit reduction path to eliminate timing side-channel.
2026-04-07 17:40:11 -07:00
Hanzo AI 3c6afe682a fix: replace composite PN11QP54 modulus, fix findPrimitiveRoot to check all prime factors
Bug 1: PN11QP54 used 0x3FFFFFFFFFC0001 which factors as 67*1447*6571*452444119.
Replaced with 0x3FFFFFFFFED001 (prime, 54-bit, Q ≡ 1 mod 4096).

Bug 2: findPrimitiveRoot only checked g^((Q-1)/2) != 1 but must check
g^((Q-1)/p) != 1 for ALL prime factors p of Q-1. Added primeFactors()
to compute distinct prime factors.

Also fixed: div128 overflow for Q > 32 bits (now uses math/bits.Div64),
mulModBarrett correctness for large Q, and INTTInPlace twiddle indexing.
2026-04-07 16:51:18 -07:00
Hanzo AI 4995827ce0 docs: README — architecture, primitives, usage 2026-04-07 09:42:42 -07:00
Hanzo AI 94a4332b52 feat: C FFI + Rust bindings (libluxfhe) 2026-04-04 12:45:53 -07:00
Hanzo AI 03be1b4356 feat: 7 FHE demo programs (dark pool, compliance, MM, auction, voting, NAV, proof) 2026-04-01 17:54:53 -07:00
Hanzo AI 7712c0c314 feat: fhed uses encrypted ZapDB for key material storage
Replace flat-file key storage (secret.key, public.key, bootstrap.key)
with encrypted ZapDB (ChaCha20-Poly1305). All FHE key material is now
stored in a single encrypted database at <dataDir>/zapdb/.

New pkg/store package wraps luxfi/database/encdb for:
- Secret/public/bootstrap key storage (encrypted at rest)
- Ciphertext cache by content hash
- Metadata storage

New --password flag (or FHED_PASSWORD env) for ZapDB encryption.
Both standard and threshold modes use ZapDB.
2026-04-01 16:49:44 -07:00
Hanzo AI 1fe442207d chore: symlink AGENTS.md and CLAUDE.md to LLM.md
Canonical project context lives in LLM.md. Symlinks ensure
agentic coding tools (agent, Cursor, etc.) find context
automatically regardless of which filename they look for.
2026-04-01 14:08:39 -07:00
Hanzo Dev 39344267fc 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:08:22 -07:00
Hanzo Dev 67d8386e9a chore: update Go module dependencies 2026-03-03 11:31:01 -08:00
Zach Kelling 6097ab3461 fix: use published mdns v0.1.0 and remove local replace directive 2026-02-20 21:15:54 -08:00
Zach Kelling 93a2cd9e55 chore: standardize LLM.md/CLAUDE.md convention 2026-02-17 19:05:20 -08:00
Zach Kelling 961c42e204 feat: add FHE example apps for all Pars PIPs
- data-seal: Verifiable Data Integrity Seal (PIP-0010/LP-0535)
  FHE-encrypted tamper-proof sealing with Public/ZK/Private modes,
  batch sealing, homomorphic verification

- content-provenance: AI & Media Content Provenance (PIP-0011/LP-7110)
  Model manifests, output attestation via homomorphic comparison,
  media derivation DAGs

- encrypted-crdt: Encrypted CRDT (PIP-0013/LP-6500)
  LWW-Register with FHE values, OR-Set with tag-based add/remove,
  Lamport timestamp conflict resolution, deterministic merge

- shadow-governance: Shadow Government Protocol (PIP-7010)
  Anonymous ministries, encrypted voting with homomorphic tallying,
  nullifier-based anti-fraud, quorum enforcement

Each example includes Solidity contracts, Hardhat tests, CLI tasks,
and README linking to corresponding PIP and LP specifications.
2026-02-13 14:16:46 -08:00
Zach Kelling b6f42849c1 feat: add FHE example applications for sealing, voting, media auth, provenance, CRDTs, and statistics
Six production-ready example applications demonstrating the FHE library:
- cmd/seal: document integrity sealing with encrypted verification
- cmd/vote: encrypted voting system with threshold tallying
- cmd/mediaseal: media content authentication with FHE
- cmd/provenance: AI model provenance tracking with encrypted attestation
- cmd/crdt: encrypted LWW-Register for fheCRDT architectures (LP-6500)
- cmd/stats: secure multiparty statistics over encrypted data

Also pins luxfi/mdns to v0.1.0 and excludes compiled binaries from git.
2026-02-13 12:44:18 -08:00
Zach Kelling 148b20c2c7 refactor: convert to Go bindings only
Remove all submodules and non-Go content.
JS SDKs, plugins, templates, and examples live in their own repos.

Kept:
- Go FHE library (*.go)
- cmd/, pkg/, internal/
- docs/, bin/
2026-01-27 14:41:31 -08:00
Zach Kelling 83c0c3be91 rebrand: final cleanup Zama/Fhenix → Lux/LuxFHE
- Update all submodule references
- Fix ml/extensions LICENSE
- Fix ml/torus-ml CONTRIBUTING and Dockerfiles
- Fix sdk/relayer relayer URL
- Fix proto/decryption-oracle go.mod
- Rename fhevm-suite assets to Lux
- Update fhevm-suite LICENSE
2026-01-27 14:16:17 -08:00
Zach Kelling b10a38e0b7 Update all submodules: Zama/Fhenix → Lux/LuxFHE rebrand
Submodules updated:
- examples/smart-wallet: Fhenix → LuxFHE
- examples/kuhn-poker: Fhenix → LuxFHE
- plugins/remix: Zama → Lux
- templates/vue: Zama → Lux
- templates/nuxt: Fhenix → LuxFHE
- templates/foundry: Fhenix → LuxFHE
- templates/miniapp: Fhenix → LuxFHE
- mocks/foundry: Fhenix → LuxFHE
- js/permit: Fhenix → LuxFHE
2026-01-27 10:51:58 -08:00
Zach Kelling 71df92cb9e Rebrand: Remove Zama/Fhenix references
- plugins/remix: Zama → Lux CSS classes and URLs
- templates/vue: Zama → Lux URLs
- templates/foundry: fhenix → luxfhe remappings
- templates/nuxt,miniapp: fhenix → luxfhe
- js/permit: fhenixjs → luxfhejs
- mocks/foundry: fhenix → luxfhe remappings
- scripts/flatten-repos.sh: fhenixprotocol → luxfhe
- ml/torus-ml: Update spelling dictionary
2026-01-27 10:50:30 -08:00
Zach Kelling 467cf87ac2 Rebrand: Zama → Lux in scripts and docs
- Update GitHub org refs (zama-ai → luxfhe)
- Update PyPI URLs (pypi.zama.ai → pypi.lux.network)
- Update company name in docs
2026-01-27 10:35:11 -08:00
Zach Kelling fe4963bd12 Rebrand: Zama → Lux in TestTorusMLX
- Update copyright headers
- Update bundle identifiers
- Update API URLs
2026-01-27 10:34:48 -08:00
Zach Kelling c5dd14493e Complete Concrete→Torus rebrand
- Update migrate-zama.sh script
- Update ml/torus-ml submodule
- Update ios-demo submodule
2026-01-26 20:58:37 -08:00
Zach Kelling 9f7326f9c4 Complete Concrete→Torus rebrand in all files
- Update all requirements.txt files
- Update all GitHub workflow files
- Update Makefile and federated_learning/Makefile
- Update script files (shell scripts)
- Update deps_licenses files
- Rename raw_cml examples to raw_tml
2026-01-26 20:58:18 -08:00
Zach Kelling 2d521b827f Update ios-demo submodule (docs rebrand) 2026-01-26 20:53:05 -08:00
Zach Kelling 80590865fb Rebrand: ConcreteML → TorusML
- Rename TestConcretMLX/ to TestTorusMLX/
- Update rust/src/lib_python.rs module name
- Update WASM test imports
- Update CI workflow references
- Update Makefile targets
2026-01-26 20:50:15 -08:00
Zach Kelling 9b81ae13ef Rename CiphertextFormat.CONCRETE to TORUS 2026-01-26 18:43:04 -08:00
Zach Kelling 61d6b39157 Fix all remaining Concrete references in Python and docs 2026-01-26 18:41:32 -08:00
Zach Kelling dbcce73c7e Fix remaining Concrete → Torus references 2026-01-26 18:40:19 -08:00
Zach Kelling 0d5006ac29 Complete concrete → torus rename across all files 2026-01-26 18:39:19 -08:00
Zach Kelling e04b987975 Complete Torus ML rebrand - update all Python imports, docs, and file names 2026-01-26 18:38:13 -08:00
Zach Kelling ad6624eb92 Update biometrics to use torus-numpy 2026-01-26 18:36:17 -08:00
Zach Kelling 79f3069091 Rename Concrete ML to Torus ML 2026-01-26 18:35:22 -08:00
Zach Kelling c6df5cc9be Update contact email to fhe@lux.network 2026-01-26 18:27:03 -08:00
Zach Kelling 994fb86204 Update pyproject description to Lux FHE 2026-01-26 18:24:31 -08:00
Zach Kelling b304242857 Fix tfhe dependency URL to luxfhe org 2026-01-26 18:20:10 -08:00
Zach Kelling 9f1a8eea55 Update all submodules with Lux FHE rebrand 2026-01-26 18:18:07 -08:00
Zach Kelling 113f06f946 Clean up legacy references in documentation
- Update docs to use Lux FHE terminology
- Clean test suite documentation
- Update ML extension references
2026-01-26 17:57:15 -08:00
Zach Kelling 78ac6fd6f1 Remove legacy PDFs, link to external archives 2026-01-25 14:19:24 -08:00
Zach Kelling 0c84af1ad6 Clean remaining legacy references from test suite 2026-01-25 14:02:41 -08:00
Zach Kelling e7d662e158 Complete Lux FHE rebrand 2026-01-25 13:58:30 -08:00
Zach Kelling ad788e042a Add ThresholdRNG for threshold randomness 2026-01-25 10:05:32 -08:00
Zach Kelling d363a39c83 chore: update go version to 1.25.5 2026-01-10 04:31:19 -08:00
Zach Kelling 124355c468 fix: Go version 1.25.5 → 1.22, add decryption oracle 2026-01-10 00:06:37 -08:00
Zach Kelling 45d13e71cf refactor: update imports to github.com/luxfi/constants 2026-01-08 19:36:50 -08:00
Zach Kelling 38eaad9d56 refactor(gpu): remove luxgpu build tag, use cgo only
- Remove luxgpu build tag requirement - just cgo is sufficient
- Add ArangeInt and ToSlice generic functions to fhe_ops.go
- Fix ToSlice to use correct C API (lux_gpu_tensor_data takes output buffer)
- Update imports to include unsafe package and string.h header
- Merge unique functions from tfhe_ops_cgo.go into fhe_ops.go

When CGO_ENABLED=1, all lux C++ libs from ~/work/luxcpp are used.
No special tags needed.
2026-01-05 22:08:01 -08:00
Zach Kelling b44e2dd524 fix(gpu): remove duplicate tfhe_ops_cgo.go and cleanup fhe_ops.go
- Removed tfhe_ops_cgo.go which duplicated functions from fhe_ops.go
- Removed unused 'unsafe' import from fhe_ops.go
- Both files had the same tensor operations causing redefinition errors

This enables clean CGO builds with GPU acceleration for FHE operations.
2026-01-05 16:48:55 -08:00
Zach Kelling a115dbbd60 feat(gpu): add TFHE-specific GPU operations
Add tfhe_ops_cgo.go with accelerated operations:
- Remainder: element-wise modulo
- Floor: element-wise floor
- Slice: tensor slicing with start/stop
- Other TFHE-specific ops for bootstrapping

Requires lux-gpu library (pkg-config: lux-gpu)
2026-01-05 11:08:58 -08:00
Zach Kelling 11fe737a8f feat(gpu): add AddScalar, SubScalar, and encryptScalar methods
- AddScalar: add scalar constant to encrypted integer
- SubScalar: subtract scalar constant from encrypted integer
- encryptScalar: create encrypted integer from plaintext scalar
2026-01-05 06:46:56 -08:00
Zach Kelling 058c84f6ba feat(gpu): add missing FHE methods for precompile compatibility
- Add BitwiseNot for Integer type (bitwise NOT)
- Add Neg for Integer (two's complement negation: ~x + 1)
- Add MulScalar for Integer (scalar multiplication via addition)
- Add SerializePublicKey/DeserializePublicKey (bootstrap key serialization)
- Add helper functions encryptedOneFrom/encryptedZeroFrom using XOR trick
- Fix NOT calls to not expect error return (NOT is free operation)
2026-01-05 06:44:36 -08:00
Zach Kelling 0a97f26c71 feat(gpu): add comprehensive FHE operations and lux_gpu_* API
- Add Integer type with full arithmetic operations (Add, Sub, comparisons)
- Add bitwise operations (AND, OR, XOR, NOT, NAND, NOR) with lowercase aliases
- Add shift operations (Shl, Shr) using XOR(x,x)=0 trick for encrypted zeros
- Add CastTo for bit-width conversion
- Add Min, Max, Select operations
- Rewrite fhe_ops.go to use unified lux_gpu_* C API
- Add fhe_types_cgo.go with CGO tensor types
- Add fhe_stub.go for non-CGO builds
- Skip public key encryption test (TFHE uses secret key encryption)
2026-01-05 06:39:22 -08:00
Zach Kelling 04c2e2de31 refactor: use standard cgo/!cgo build tags 2026-01-04 14:38:47 -08:00
Zach Kelling 3675b37845 fix: update GPU build tags and reorganize CGO files
- Move tfhe_bridge.cpp/h to cgo/ subdirectory
- Change fhe_ops.go to use luxgpu tag (opt-in for GPU)
- Change fhe_test.go to use luxgpu tag
- Ensure pure Go fallback works for both CGO=0 and CGO=1
2026-01-04 13:42:26 -08:00