Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(tfhe): Allow CompactCiphertextList to store heterogeneous types #1123

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

tmontaigu
Copy link
Contributor

This refactors the integer's CompactCiphertextList to allow storing usngined, signed (not with necessarily the same number of blocks) and booleans in a single comapct list.

This is better as its more flexible and allows for better compression by not forcing to use a list per data type. This is especially interessing with zero-knowledge proofs as they are expensive to compute.

This also removes 'typed' CompactList and Comapct types from the hlapi.

@cla-bot cla-bot bot added the cla-signed label May 2, 2024
@tmontaigu tmontaigu force-pushed the tm/better-compact-list branch 4 times, most recently from c8993a1 to 762507b Compare May 3, 2024 15:28
@tmontaigu tmontaigu marked this pull request as ready for review May 6, 2024 08:08
@tmontaigu tmontaigu force-pushed the tm/better-compact-list branch 3 times, most recently from 75ef4d0 to 88fb777 Compare May 13, 2024 15:52
@zama-bot zama-bot removed the approved label May 16, 2024
@tmontaigu tmontaigu force-pushed the tm/better-compact-list branch 2 times, most recently from 599dcb1 to 2e90e06 Compare May 22, 2024 08:08
@tmontaigu tmontaigu force-pushed the tm/better-compact-list branch 4 times, most recently from c2046ee to b71527c Compare May 28, 2024 09:02
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question first : do we drop the compact ciphertext type entirely ?

it looks a bit less ergonomic to use, I was thinking that maybe a thin wrapper around the generic list could be of interest

tfhe/c_api_tests/test_high_level_compact_list.c Outdated Show resolved Hide resolved
tfhe/c_api_tests/test_high_level_integers.c Outdated Show resolved Hide resolved
tfhe/c_api_tests/test_high_level_integers.c Show resolved Hide resolved
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't gone in the very detailed

tfhe/src/c_api/high_level_api/compact_list.rs Show resolved Hide resolved
tfhe/src/c_api/high_level_api/mod.rs Outdated Show resolved Hide resolved
tfhe/src/high_level_api/booleans/tests.rs Show resolved Hide resolved
tfhe/src/high_level_api/compact_list.rs Show resolved Hide resolved
tfhe/src/high_level_api/integers/signed/mod.rs Outdated Show resolved Hide resolved
tfhe/src/integer/ciphertext/compact_list.rs Show resolved Hide resolved
tfhe/src/integer/ciphertext/compact_list.rs Show resolved Hide resolved
tfhe/src/integer/ciphertext/compact_list.rs Outdated Show resolved Hide resolved
tfhe/src/safe_deserialization.rs Show resolved Hide resolved
tfhe/src/shortint/public_key/compact.rs Outdated Show resolved Hide resolved
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot !

This refactors the integer's CompactCiphertextList to allow storing
unsigned, signed (without necessarily the same number of blocks) and
booleans in a single comapct list.

This is better as its more flexible and allows for better compression
by not forcing to use a list per data type. This is especially
interessing with zero-knowledge proofs as they are expensive to compute.

This also adds the ability to pack integer blocks by using the carry
space, but makes the expansion require a ServerKey to split blocks
via PBS.

BREAKING CHANGE: expand method from CompactCiphertextList returns a
                 CiphertextExpander
BREAKING CHANGE: Removes 'typed' CompactList and Compact types from the hlapi
                 (e.g. CompactFheUintList/CompactFheUintX)
@tmontaigu tmontaigu merged commit 3f9c1b0 into main Jun 6, 2024
41 checks passed
@tmontaigu tmontaigu deleted the tm/better-compact-list branch June 6, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants