Sunscreen icon indicating copy to clipboard operation
Sunscreen copied to clipboard

Support trivial encryptions

Open samtay opened this issue 1 year ago • 0 comments

We can make valid ciphertexts where the sampled $u, e_1, e_2$ are all set to zero. This would allow for fhe_var! created variables to be legitimate Cipher nodes while still being deterministic, and allow us to remove the Indeterminate, Stage, etc. types from crate::types::intern::fhe_program_node (added in #272).

It looks like this would require factoring seal::util::rlwe::encrypt_zero_asymmetric to support accepting these values, rather than always generating them via parms.random_generator()->create();.

Additionally, we should ensure that SEAL_THROW_ON_TRANSPARENT_CIPHERTEXT is set to false, since there are a number of checks to ensure that these values are not zero. E.g. here.

However, it would be good to expose that is_transparent() method and call it in the Cipher::output implementation as a safeguard for the user not to return transparent ciphertexts from an FHE program.

samtay avatar Jul 03 '23 15:07 samtay