I use SEAL 2.3.1 and this is my parameter setting:
seal::EncryptionParameters parms;
parms.set_poly_modulus("1x^2048 + 1"); // n = 2048
parms.set_coeff_modulus(coeff_modulus_128(2048)); // q = 54-bit prime
parms.set_plain_modulus(1 << 8); // t = 256
seal::SEALContext context(parms);
And some Ciphertext encrypted1;
holding the number 5. The manual say that one can use the seal::Simulator class for reading the noise budget without the secret key. The only thing that I've found was this in the simulator.h
file.
/**
Creates a simulation of a ciphertext encrypted with the specified encryption
parameters and given invariant noise budget. The given noise budget must be
at least zero, and at most the significant bit count of the coefficient
modulus minus two.
@param[in] parms The encryption parameters
@param[in] noise_budget The invariant noise budget of the created ciphertext
@param[in] ciphertext_size The size of the created ciphertext
@throws std::invalid_argument if ciphertext_size is less than 2
@throws std::invalid_argument if noise_budget is not in the valid range
*/
Simulation(const EncryptionParameters &parms, int ciphertext_size,
int noise_budget);
I can set it with some other Ciphertext encrypted2
:
seal::Simulation(parms, encrypted2.size(), (context.total_coeff_modulus().significant_bit_count() - log2(context.poly_modulus().coeff_count() - 1) - log2(context.plain_modulus().value()));
But using this will only create a simulated Ciphertext without any real connection to the actual encrypted1
Ciphertext noise budget.
Is there a way to approximate the noise budget of encrypted1
without the secret key? This situations is important when I or someone else does some computation on externally stored Ciphertexts, e.g. in a cloud database and needs to check the noise budget server side without revealing the secret key.