From 219c755a778523617dd20b0d23deaf0e112f3fca Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 21 Feb 2025 09:22:27 -0300 Subject: [PATCH] fix(gpu): fix wrong number of blocks used in cast --- tfhe/src/integer/gpu/server_key/radix/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tfhe/src/integer/gpu/server_key/radix/mod.rs b/tfhe/src/integer/gpu/server_key/radix/mod.rs index 40d53b2279..67b0c9e224 100644 --- a/tfhe/src/integer/gpu/server_key/radix/mod.rs +++ b/tfhe/src/integer/gpu/server_key/radix/mod.rs @@ -692,7 +692,7 @@ impl CudaServerKey { ciphertext_modulus, ); - let trimmed_ct_info = ct.as_ref().info.after_trim_radix_blocks_lsb(num_blocks); + let trimmed_ct_info = ct.as_ref().info.after_trim_radix_blocks_lsb(new_num_blocks); T::from(CudaRadixCiphertext::new(trimmed_ct_list, trimmed_ct_info)) } @@ -775,8 +775,7 @@ impl CudaServerKey { LweCiphertextCount(new_num_blocks), ciphertext_modulus, ); - - let trimmed_ct_info = ct.as_ref().info.after_trim_radix_blocks_msb(num_blocks); + let trimmed_ct_info = ct.as_ref().info.after_trim_radix_blocks_msb(new_num_blocks); T::from(CudaRadixCiphertext::new(trimmed_ct_list, trimmed_ct_info)) }