I am writing to get some help setting parameter values in the rust implementation of the TFHE library. Specifically, we are trying to increase the mod q value in the TFHE library. However, we are unable to do so. We have tried to change the value of q in the librarys mod.rs file. In the mod.rs file in line 357, we have seen the i64 implementation of BITS, but changing there, we are staying the same. So, can you please help and suggest where and which file to change to set the proper value of q changed? Also, are we doing it correctly? If not, where can we find the file to change the value of mod q? Thanks for your help.
No this is not the correct way to change the q
, to change the q, you have to change the ciphertext_modulus
of your Lwe entities. q is represented by the CiphertextModulus type (and also the data type used to store lwe elements (u32 vs u64 vs u128))
So to have q larger than 2^64, you have to use u128 to store the data and specify the ciphetext_modulus (e.g. CiphertextModulus::<u128>::new_native()
, to have a modulus of 2^128 or CiphertextModulus::<u128>::try_new(some_mod_value).unwrap()
for something completely custom)
let lwe = allocate_and_encrypt_new_lwe_ciphertext(
&lwe_secret_key,
plaintext,
lwe_noise_distribution,
ciphertext_modulus,
&mut encryption_generator,
);
Thanks for the reply. I was wrong to say I was using the TFHE library because I figured out that I was using concrete core in the background. I don’t know if both of them are the same, but I have not seen any function with the mentioned signature, which I figured out is present in the TFHE_core. So my question is: How to change mod q in the concrete core because most functions say there is no implementation available for u128?