7 Commits
Author SHA1 Message Date
Hanzo AI e5f37e2cfd deps: database v1.18.3 (drops zapdb/v4 transitive); ntt_simd updates; bench/ 2026-05-05 17:11:33 -07:00
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
Zach Kelling 1ed73f84d7 fix: restore FHE Go implementation files
Restore core FHE Go files that were removed during cleanup.
These are required for precompile/fhe to build.
2026-01-03 19:11:38 -08:00
Zach Kelling a4ab9dd4a9 Clean up: Move Go FHE implementation to lux/fhe
- Remove old Go FHE code (now in lux/fhe)
- Remove old Zama compatibility layers
- Update CI for TypeScript/JS SDK only
- This repo is now purely the @luxfhe npm package ecosystem
2026-01-02 10:53:28 -08:00
Zach Kelling 46e4f1d319 refactor: rename module from tfhe to fhe
- Rename module path github.com/luxfi/tfhe => github.com/luxfi/fhe
- Rename tfhe.go => fhe.go, tfhe_test.go => fhe_test.go
- Update all internal references from tfhe to fhe
- Update SDK bindings and documentation
2025-12-29 10:59:13 -08:00
Zach Kelling c68dea0a9f Initial commit
BSD-3-Clause-Research License: Pure Go TFHE implementation with
patent-pending innovations including deterministic FHE for blockchain
consensus, transaction-batch amortized bootstrapping, and parallel
bootstrapping with work-stealing scheduler.
2025-12-28 18:04:25 -08:00