160 Commits
Author SHA1 Message Date
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
zeekay eaf864890e feat: release v7.0.0 with GPU acceleration and module update
- Update module path to github.com/luxfi/lattice/v7
- Add GPU acceleration with Metal (macOS) and CUDA backends
- Enhance threshold FHE operations
- Revert to vanilla Apache 2.0 license (remove tfhe)
- Update Go version to 1.25.5
- Merge upstream lattigo improvements
2025-12-30 15:37:37 -08:00
zeekay 5b912f170d Fix formatting issues in test files 2025-08-06 21:42:16 -05:00
zeekay 96a611356a Update to latest v6 2025-08-06 20:21:56 -05:00
zeekay 78026c60eb Merge in latest updates from lattigo 2025-08-06 20:09:12 -05:00
zeekay bd8c210383 Update package name 2025-08-06 19:52:38 -05:00
lehugueni 16a7d54bc7 style: apply feedback from pr 2025-06-20 16:36:48 +02:00
lehugueni 70c936ba51 refactor: add separate pool structs 2025-06-19 16:58:07 +02:00
lehugueni c23239019a refactor: remove pools logic for higher-level structs 2025-04-24 09:39:08 +02:00
lehugueni 5988b070bd Merge branch 'uint64-syncpool' into ts-sampling 2025-02-20 16:20:36 +01:00
lehugueni b7dc806728 Merge branch 'main' into uint64-syncpool 2025-02-20 16:17:28 +01:00
lehugueni de88f6e273 refactor: make keyedprng thread-safe, restrict usage + add warning 2025-02-20 15:07:30 +01:00
lehugueni a03d1a9f70 feat: make samplers thread-safe + thread safe prng in encryptor 2025-01-27 13:35:28 +01:00
Jean-Philippe Bossuat b2686e2dd6 Applied suggested changes 2025-01-21 09:40:37 +01:00
Jean-Philippe Bossuat 6d33e84fcb Cleared all instances of G115 2025-01-21 09:15:17 +01:00
lehugueni 52927eef36 refactor: keep only BuffFromUintPool and cleanup 2025-01-16 11:07:19 +01:00
lehugueni 202c004aeb bufferpool uint64 in ring 2024-12-12 14:26:08 +01:00
lehugueni 7f7ca137da change generic 2024-12-11 15:40:06 +01:00
lehugueni e56814b820 freelist + benchmarking 2024-12-03 10:41:56 +01:00
lehugueni c991147dbb use interface+generic 2024-11-29 14:58:21 +01:00
771d3cf042 applying lattigo-e patch
CHANGELOG:
- Update of `PrecisionStats` in `ckks/precision.go`:
  - precision/error stats computed as log2 of min/max/average/...
  - fields renamed (`MinPrecision` -> `MINLog2Prec`, `MaxPrecision` -> `MAXLog2Prec`, ...)
  - `rlwe.Scale` has a `.Log2()` method
- Update of `mod1.Parameters` fields (made public, some removed)
- Improvement of the relinearization key-generation protocol (reduce the degree of the shares)
- Serialisation of bootstrapping keys
- Lower noise incurred by `ModUp`
- Evaluation keys can be compressed (public element `a` can be generated from a seed)
- More doc formatting
- Fix various bugs:
  - `ShallowCopy` of the CKKS bootstrapping evaluator and BFV evaluator not deep enough.
  - PSI example failing
  - Incorrect reset of pointer in uniform sampler
  - Error when doing inverse NTT with small degree
  - Mod1Evaluator changes the input ciphertext

Co-authored-by: Andrea Caforio <[email protected]>
Co-authored-by: Jean-Philippe Bossuat <[email protected]>
2024-10-07 11:46:55 +02:00
Andrea Caforio 2fdadd379d Merge pull request #492 from tuneinsight/he-collapse
v6.0.0
2024-08-06 14:46:08 +02:00
Andrea Caforio 04177a2f97 adapt changelog to v6 2024-08-06 12:04:33 +02:00
Andrea Caforio 84f4bafd5f repackage mod1
Additionally, move the cleartext cosine approximation to the utils
package.
2024-08-05 10:27:20 +02:00
Andrea Caforio 0159ba363e bump go version to 1.22 and use slices std library package 2024-06-05 09:44:14 +02:00
Romain BouyéandJean-Philippe Bossuat 0e9956c303 Fix #457 utils.MaxSlice and utils.MinSlice and add tests for slices utils
Co-authored-by: Jean-Philippe Bossuat <[email protected]>
2024-05-07 14:38:42 +02:00
Jean-Philippe Bossuat b3a92621bc updated imports to v5 2023-11-14 19:15:38 +01:00
Jean-Philippe Bossuat bb488dce8a [hefloat/bootstrapping]: fixed high precision bootstrapping 2023-11-08 16:46:16 +01:00
c44961c43d Update utils/structs/map.go
Co-authored-by: Boris Flesch <[email protected]>
2023-10-30 15:05:54 +01:00
66210e695f Update utils/structs/vector.go
Co-authored-by: Boris Flesch <[email protected]>
2023-10-30 15:05:46 +01:00
65b465cc52 Update utils/structs/vector.go
Co-authored-by: Boris Flesch <[email protected]>
2023-10-30 15:05:37 +01:00
ed01c462a3 Update utils/structs/matrix.go
Co-authored-by: Boris Flesch <[email protected]>
2023-10-30 15:05:26 +01:00
2a82021922 Update utils/structs/matrix.go
Co-authored-by: Boris Flesch <[email protected]>
2023-10-30 15:04:04 +01:00
b7047e96b4 Update utils/buffer/reader.go
Co-authored-by: Boris Flesch <[email protected]>
2023-10-30 15:03:54 +01:00
5473c026f5 Update utils/buffer/reader.go
Co-authored-by: Boris Flesch <[email protected]>
2023-10-30 15:03:46 +01:00
4e8d944918 Update utils/buffer/reader.go
Co-authored-by: Boris Flesch <[email protected]>
2023-10-30 15:03:36 +01:00
Jean-Philippe Bossuat 977213c53e [bgv]: added tests for IsBatched = false 2023-10-27 10:53:44 +02:00
Jean-Philippe Bossuat 0aa8ecbd45 [utils/sampling]: removed panics & removed PRNG in ckks.Encoder 2023-10-27 10:48:41 +02:00
Jean-Philippe Bossuat b4cb5ee7db [utils/factorization]: updated tests 2023-10-27 10:06:15 +02:00
Romain Bouyé 5e983f2119 [utils/factorization]: add tests for IsPrime and GetFactors 2023-10-26 22:28:29 +02:00
Jean-Philippe Bossuat cdb0f9d79f review suggestions 2023-10-25 17:56:21 +02:00
7cfc40d7de Update utils/bignum/complex.go
Co-authored-by: Thity <[email protected]>
2023-10-25 17:47:24 +02:00
03cdeaa2b0 Update utils/bignum/minimax_approximation.go
Co-authored-by: Thity <[email protected]>
2023-10-25 17:47:10 +02:00
4a9277ab8f Update utils/bignum/complex.go
Co-authored-by: Thity <[email protected]>
2023-10-25 17:46:46 +02:00
Jean-Philippe Bossuat d34e178a39 [all]: made insecure test parameters private & added comment 2023-10-13 14:52:15 +02:00
Jean-Philippe Bossuat 1dc4d5eeca [gosec]: added small comments on nopsec exceptions 2023-10-13 14:38:42 +02:00
Romain Bouyé 78da8bff1d Typo fixes on v5 pass 2023-10-13 00:14:52 +02:00
Jean-Philippe Bossuat b791305ecc staticcheck 2023-10-05 14:05:40 +02:00
Jean-Philippe Bossuat bc6d3244d0 [utils/buffer]: added equality checks
[ring.Poly]: removed .Buff (not needed anymore)
2023-10-05 14:03:17 +02:00
Jean-Philippe Bossuat da9c308ad7 [utils/structs]: expanded support for floats and integers. 2023-10-05 11:22:36 +02:00