From e4e03277b57041229bc406d71ec9fcaff79aebc8 Mon Sep 17 00:00:00 2001 From: Arthur Meyre Date: Sat, 15 Feb 2025 13:19:50 +0100 Subject: [PATCH] fix(shortint): fix CompressedModulusSwitchNoiseReductionKey generation - was using the wrong seeded encryption API resulting in garbage values when decompressing --- .../shortint/server_key/modulus_switch_noise_reduction.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tfhe/src/shortint/server_key/modulus_switch_noise_reduction.rs b/tfhe/src/shortint/server_key/modulus_switch_noise_reduction.rs index 42b4be147..aaa58b5a3 100644 --- a/tfhe/src/shortint/server_key/modulus_switch_noise_reduction.rs +++ b/tfhe/src/shortint/server_key/modulus_switch_noise_reduction.rs @@ -225,22 +225,22 @@ impl CompressedModulusSwitchNoiseReductionKey { // Parallelism allowed #[cfg(any(not(feature = "__wasm_api"), feature = "parallel-wasm-api"))] - par_encrypt_seeded_lwe_ciphertext_list_with_existing_generator( + par_encrypt_seeded_lwe_ciphertext_list( secret_key, &mut modulus_switch_zeros, &plaintext_list, lwe_noise_distribution, - &mut engine.encryption_generator, + &mut engine.seeder, ); // No parallelism allowed #[cfg(all(feature = "__wasm_api", not(feature = "parallel-wasm-api")))] - encrypt_seeded_lwe_ciphertext_list_with_existing_generator( + encrypt_seeded_lwe_ciphertext_list( secret_key, &mut modulus_switch_zeros, &plaintext_list, lwe_noise_distribution, - &mut engine.encryption_generator, + &mut engine.seeder, ); Self {