Commit Graph

110 Commits

Author SHA1 Message Date
Thomas Montaigu
d7e08204e5 feat(all): add seeded public encryption for compact lists
This allows to create CompactCiphertextList and
ProvenCompactCiphertextList using a seed, so that the
encryption can be reproduced

* Follows NIST submission:
 - Create XofSeed from some seed bytes
 - Then init a NoiseRandomGenerator from the XofSeed
 - Use the gnerator to do the public encryption
 - When a zk proof is needed, for each chunk create the seed for the
   zk-proof by taking the next 16 bytes of noise_random_generator.
   This is custom to tfhe-rs as NIST submission does not cover this case
* JS API + tests included
* Backward compatibility tests

Backward compatibility tests are included, as since this produces seeded
data, we need to be able to guarantee backward compatibility.
2026-03-17 00:16:20 +01:00
Nicolas Sarlin
1c4d8577ed chore(wasm-par-mq): add js fmt 2026-03-12 14:50:57 +01:00
Nicolas Sarlin
7e1a6ed081 chore(wasm-par-mq): simplify deployment, remove init url params 2026-03-12 14:50:57 +01:00
Arthur Meyre
62831cffd6 chore: add backward compatibility data 2026-03-10 18:52:50 +01:00
Thomas Montaigu
748dac511c fix(csprng)!: start from TableIndex::FIRST and not SECOND
Now that the csprng can start from FIRST, we make it
start from FIRST.

Other changes are:
1) Using std::ops::Bound as the type of the bound/end in AesCtrGenerator
and State makes it more explicit for the caller what bound it uses
(Excluded, Included, Unbounded).

2) add proper overflow check in skip_bytes/check_fork

Without these overflow checks the state would wrap, it could lead to
misuses

This means by default data generated from previous versions
is not compatible with newer versions unless explicitely constructed
with the correct AesCtrParams (starting at SECOND).

This is fine for compressed data generated by tfhe-rs thanks
to the versionning system.

The test-vectors had to be regenerated as they did change
Backward data for xof has also been regenerated, as its was only added
in main branch (not release) thus data is considered not stable yet
Added a full server key to the backward data that uses this new generator
2026-03-10 10:43:34 +01:00
Nicolas Sarlin
4f6e917ee2 chore(wasm-par-mq): use postcard2 2026-03-06 10:40:24 +01:00
Nicolas Sarlin
84a2cc97be chore: add wasm_par_mq crate for unsafe coop wasm parallelism 2026-03-04 09:25:03 +01:00
Thomas Montaigu
acf0ae3f66 refactor(all): make CompressionSeed store SeedKind + TableIndex
* This changes allows to use compression seeds for which the initial seed
  is a XofSeed. Also storing a TableIndex allows to use the same generator
  to generate multiple Seeded entities as it's needed for CompressionXofKeySet.

* Add some PartialEq derives and a test to make sure expanding a
  CompressedXofKeySet via its specific method (which is written as the
  NIST document specifies, using one generator seeded at the beginning)
  or using the method of CompressedServerKey (i.e each entity that
  needs to be decompressed re-seeds its own generator) yields
  matching results.

Backward data is regenerated because the CompressionSeed changed, but it
is ok as the previous changes were not in production yet
2026-03-03 10:15:42 +01:00
Arthur Meyre
2584edbaac chore: update links to .org 2026-03-02 17:56:29 +01:00
Arthur Meyre
89c34f209c chore: make sure backward compat crates are formatted
- update fmt targets to be configurable
- group fmt, check_fmt and fmt_internal to make it easier to maintain
2026-03-02 16:26:27 +01:00
Theo Souchon
856fceed23 chore(lint): add new rules around versionize_dispatch_enum 2026-02-26 11:41:54 +01:00
Thomas Montaigu
1f513f82c2 chore(backward_compatibility): add CompressedXofKeySet 2026-02-24 12:58:21 +01:00
Theo Souchon
8affbdbf92 chore(ci): add wrong variant order lint and setup multi dylint rules
Co-authored-by: Nicolas Sarlin <nicolas.sarlin@zama.ai>
2026-02-19 15:58:29 +01:00
Arthur Meyre
61550c6405 chore: bump TFHE-rs to 1.6.0 2026-01-16 14:34:40 +01:00
Nicolas Sarlin
70a0021cbf chore: fix bincode dependency version 2026-01-02 18:57:32 +01:00
Arthur Meyre
63b46c3b99 chore: bump tfhe-versionable to 0.7 since the MSRV was changed 2025-12-11 13:12:36 +01:00
Nicolas Sarlin
212b925b5e chore: use rust-toolchain.toml for default toolchain 2025-11-26 11:28:21 +01:00
Nicolas Sarlin
bf2e9ef504 chore(backward): each data generation crate has its own workspace 2025-11-26 11:28:21 +01:00
Nicolas Sarlin
edb435bd46 chore: update msrv to 1.91.1 2025-11-20 09:29:37 +01:00
Nicolas Sarlin
83b82091bd chore: use common msrv for the workspace
Since cargo commands create a lock using the smallest msrv in the workspace, it
can prevent getting up-to-date dependencies
2025-10-31 09:31:43 +01:00
Nicolas Sarlin
b8fd0e4240 chore: bump tfhe-versionable to 0.6.3 and tfhe-zk-pok to 0.8.0 2025-10-30 16:53:36 +01:00
Nicolas Sarlin
aff5b7f0c6 chore(backward): add data for the new zk proof 2025-10-30 16:53:36 +01:00
Nicolas Sarlin
bcb1356b76 fix(versionable): handle #[default] in Versionize types 2025-10-30 16:53:36 +01:00
Mayeul@Zama
54626cab6d refactor(shortint): use ShortintBootstrappingKey in DecompressionKey 2025-10-30 16:52:44 +01:00
Mayeul@Zama
859d5e4e1f chore: add backward multi bit decompression keys 2025-10-24 09:28:17 +02:00
Mayeul@Zama
92dcd38e30 chore: add decompression_grouping_factor to TestCompressionParameterSet 2025-10-24 09:28:17 +02:00
Nicolas Sarlin
2cdc804670 chore(backward): backward compat data targeted generation 2025-10-17 12:43:13 +02:00
Arthur Meyre
21b6863c5d chore: update dedup tool to be smarter when finding already aliased params
- keep the alias if found
- update the imports if all items are found to be aliases
2025-10-16 15:23:36 +02:00
Arthur Meyre
20a91337c1 chore: prepare v1.5 2025-10-16 15:23:36 +02:00
Thomas Montaigu
3b9eb360c1 chore(backward): regenerate KVStore backward data
This is because now that the KVstore uses a BTreeMap
which is a sorted collection, the serialization of the data
is deterministic
2025-10-14 17:04:13 +02:00
Nicolas Sarlin
516789bd5d chore(backward): add data for ks32 noise squashing server key 2025-10-09 14:03:21 +02:00
Nicolas Sarlin
241685fccc chore(backward): add data for ks32 client key, server key and ct 2025-10-08 10:27:06 +02:00
Thomas Montaigu
e739f43ec5 chore: add CompressedKVStore backward compat tests 2025-10-07 16:36:36 +02:00
Arthur Meyre
0f4f8dd755 chore(versionable): bump version to 0.6.2 2025-09-23 21:03:30 +02:00
Nicolas Sarlin
70e1828c58 chore(backward): add backward compat tests for rerand 2025-09-22 14:02:41 +02:00
Nicolas Sarlin
4a73b7bb4b fix(versionable): use full type path in proc macro
This avoids name clashes if user re-defines the type
2025-09-19 16:03:56 +02:00
Nicolas Sarlin
d88caff6dd fix(ci): fix serde root crate in tfhe-lints 2025-09-15 15:18:58 +02:00
Nicolas Sarlin
34743ea304 fix(backward): badly generated backward data 2025-08-28 17:54:59 +02:00
Nicolas Sarlin
677da3855e chore(ci): update dylint 2025-08-28 08:41:48 +02:00
Nicolas Sarlin
fa48444611 chore(ci): update toolchain to nightly-2025-08-26 2025-08-28 08:41:48 +02:00
tmontaigu
d389ea67a1 refactor!: Use NonZero<T> in DataKind
Change the type used to store a block count in
DataKind to NonZero. This makes it impossible to store
'empty' kinds such as DataKind::Unsigned(0), DataKind::Signed(0).

Also, when deserializing, if the count is zero and error will be
returned, adding an additional layer of sanitization.
2025-08-21 16:18:28 +02:00
Nicolas Sarlin
afd628c7b9 doc(backward): explain how to pull backward compat data 2025-08-14 11:56:16 +02:00
Mayeul@Zama
4909a8ef0e chore(backward): add data for multibit noise squashing 2025-08-14 11:56:16 +02:00
Mayeul@Zama
c8a9105953 chore(backward): add multi bit support 2025-08-14 11:56:16 +02:00
Nicolas Sarlin
0aaadf04d9 chore(versionable): bump version to 0.6.1 2025-08-11 16:49:27 +02:00
Nicolas Sarlin
54c6b9e50a feat(versionable): impl Versionize for Btree{Map, Set} 2025-08-11 13:47:27 +02:00
Arthur Meyre
a63207af9e chore(ci): add MSRV build to check we are compliant with what we announce
- have to downgrade param_dedup edition as 1.84 cannot handle 2024 in a
workspace
2025-08-08 18:06:29 +02:00
Nicolas Sarlin
57cbab9fe1 chore(backward): integrate backward compat data
Code is taken from
59a6179831

Adapted to make ci work
2025-07-07 13:10:55 +02:00
David Testé
a96970e8c3 chore: update clap dependency version to 4.5.30 2025-05-13 10:35:51 +02:00
Arthur Meyre
d05ee42629 chore: add param_dedup to alias redundant parameter defs across versions 2025-05-08 09:30:36 +02:00