Skip to content

Conversation

@nsarlin-zama
Copy link
Contributor

@nsarlin-zama nsarlin-zama commented Nov 27, 2025

PR content/description

modswitched expansion type info was stored into the CiphertextConformanceParams, which meant that we had to provide this information even for ciphertexts that were not compressed. This PR adds dedicated types for modswitched ciphertexts conformance params.


This change is Reviewable

@cla-bot cla-bot bot added the cla-signed label Nov 27, 2025
@nsarlin-zama nsarlin-zama force-pushed the ns/chore/compressed_modswitched_conformance branch from 1343ae9 to ad33cd3 Compare November 27, 2025 15:48
Copy link
Contributor

@mayeul-zama mayeul-zama left a comment

Choose a reason for hiding this comment

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

@mayeul-zama reviewed 20 of 20 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @IceTDrinker and @tmontaigu)


tfhe/src/core_crypto/entities/compressed_modulus_switched_multi_bit_lwe_ciphertext.rs line 541 at r1 (raw file):

                .as_ref()
                .is_none_or(|packed_diffs| packed_diffs.is_conformant(&lwe_dim))
            && *lwe_dimension == ct_params.lwe_dim

Could also destructure ct_params


tfhe/src/core_crypto/entities/compressed_modulus_switched_lwe_ciphertext.rs line 150 at r1 (raw file):

{
    pub ct_params: LweCiphertextConformanceParams<Scalar>,
    pub ms_decompression_method: MsDecompressionType,

"Type" vs "method", would be clearer to use only one name
I have no personal preference


tfhe/src/core_crypto/entities/compressed_modulus_switched_lwe_ciphertext.rs line 168 at r1 (raw file):

        let CompressedModulusSwitchedLweCiphertextConformanceParams {
            ct_params,

Could also destructure ct_params


tfhe/src/high_level_api/integers/unsigned/compressed.rs line 226 at r1 (raw file):

);

impl CompressedRadixCiphertextConformanceParams {}

To remove


tfhe/src/shortint/ciphertext/compressed_modulus_switched_ciphertext.rs line 86 at r1 (raw file):

        } = self;

        compressed_modulus_switched_lwe_ciphertext.is_conformant(&param.ct_params)

Not really releveant to this PR

param could be destructured

I don't know how time consuming it would be to make sure we follow this pattern in all conformance code, maybe not so much

@nsarlin-zama nsarlin-zama force-pushed the ns/chore/compressed_modswitched_conformance branch from ad33cd3 to 6908188 Compare November 28, 2025 09:04
Copy link
Contributor Author

@nsarlin-zama nsarlin-zama left a comment

Choose a reason for hiding this comment

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

Reviewable status: 11 of 23 files reviewed, 5 unresolved discussions (waiting on @IceTDrinker, @mayeul-zama, and @tmontaigu)


tfhe/src/core_crypto/entities/compressed_modulus_switched_lwe_ciphertext.rs line 150 at r1 (raw file):

Previously, mayeul-zama wrote…

"Type" vs "method", would be clearer to use only one name
I have no personal preference

done


tfhe/src/core_crypto/entities/compressed_modulus_switched_lwe_ciphertext.rs line 168 at r1 (raw file):

Previously, mayeul-zama wrote…

Could also destructure ct_params

done


tfhe/src/core_crypto/entities/compressed_modulus_switched_multi_bit_lwe_ciphertext.rs line 541 at r1 (raw file):

Previously, mayeul-zama wrote…

Could also destructure ct_params

done


tfhe/src/high_level_api/integers/unsigned/compressed.rs line 226 at r1 (raw file):

Previously, mayeul-zama wrote…

To remove

done


tfhe/src/shortint/ciphertext/compressed_modulus_switched_ciphertext.rs line 86 at r1 (raw file):

Previously, mayeul-zama wrote…

Not really releveant to this PR

param could be destructured

I don't know how time consuming it would be to make sure we follow this pattern in all conformance code, maybe not so much

done, required a small refacto to remove an unused field

Copy link
Contributor

@mayeul-zama mayeul-zama left a comment

Choose a reason for hiding this comment

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

:lgtm:

Thanks!

@mayeul-zama reviewed 4 of 4 files at r2, 8 of 8 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @IceTDrinker and @tmontaigu)

@nsarlin-zama nsarlin-zama force-pushed the ns/chore/compressed_modswitched_conformance branch from 6908188 to 66a05cb Compare November 28, 2025 09:48
@zama-bot zama-bot removed the approved label Nov 28, 2025
@nsarlin-zama nsarlin-zama force-pushed the ns/chore/compressed_modswitched_conformance branch from 66a05cb to 9e626f6 Compare November 28, 2025 12:57
@zama-bot zama-bot removed the approved label Nov 28, 2025
Copy link
Contributor

@mayeul-zama mayeul-zama left a comment

Choose a reason for hiding this comment

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

@mayeul-zama reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @IceTDrinker and @tmontaigu)

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.

3 participants