Setting the FractionalEncoder in SEAL 2.3.1

132 views Asked by At

I'm using this parameter setting:

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

With this encoder FractionalEncoder encoder(context.plain_modulus(), context.poly_modulus(), A, B, C); using A=512, B=128 and C=2

If I understood correctly then the setting of A and B depend on the size of n which means that A + B <= 2048 must hold, correct?

What is the general rule when deciding the size of A and B using the poly_modulus, coeff_modulis and plain_modulus setting above? Since choosing to small values don't use the full potential of the Plaintext size. My guess is that A should be increased because B is only for the precision of the fractional part.

1

There are 1 answers

7
hao chen On

A and B depends on how much precision you need and how complicated is the computation: larger A and B would make the encryption more precise, and they will also make the allowed multiplicative depth smaller. The latter is one of the reasons why the fractional encoder does not perform very well. Depending on your task, you might want to stay tuned and use the next release (SEAL 3.0) which contains a new encoding method.