diff --git a/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_classic.cu b/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_classic.cu index a77db81e19..bd5e1f33ec 100644 --- a/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_classic.cu +++ b/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_classic.cu @@ -656,6 +656,8 @@ void cuda_programmable_bootstrap_lwe_ciphertext_vector_64( uint32_t num_samples, uint32_t num_many_lut, uint32_t lut_stride) { if (base_log > 64) PANIC("Cuda error (classical PBS): base log should be <= 64") + if ((glwe_dimension + 1) * level_count > 8) + PANIC("Cuda error (multi-bit PBS): (k + 1)*l should be <= 8") pbs_buffer *buffer = (pbs_buffer *)mem_ptr; diff --git a/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_multibit.cu b/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_multibit.cu index b2a7f214e2..1610c12072 100644 --- a/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_multibit.cu +++ b/backends/tfhe-cuda-backend/cuda/src/pbs/programmable_bootstrap_multibit.cu @@ -220,6 +220,8 @@ void cuda_multi_bit_programmable_bootstrap_lwe_ciphertext_vector_64( if (base_log > 64) PANIC("Cuda error (multi-bit PBS): base log should be <= 64") + if ((glwe_dimension + 1) * level_count > 8) + PANIC("Cuda error (multi-bit PBS): (k + 1)*l should be <= 8") pbs_buffer *buffer = (pbs_buffer *)mem_ptr;