microsoft / SEAL

Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
https://www.microsoft.com/en-us/research/group/cryptography-research/
MIT License
3.62k stars 711 forks source link

How can I configure `SEAL_CIPHERTEXT_SIZE_MAX`? #654

Open ppppbamzy opened 1 year ago

ppppbamzy commented 1 year ago

In here SEAL_CIPHERTEXT_SIZE_MAX is fixed to be 16 while a check is followed on whether it is greater than 0x100000000ULL / SEAL_POLY_MOD_DEGREE_MAX, where the latter can be at least 2^15 (way too larger than 16!):

// Upper bound on the size of a ciphertext (cannot exceed 2^32 / poly_modulus_degree)
#define SEAL_CIPHERTEXT_SIZE_MAX 16
#if SEAL_CIPHERTEXT_SIZE_MAX > 0x100000000ULL / SEAL_POLY_MOD_DEGREE_MAX
#error "SEAL_CIPHERTEXT_SIZE_MAX is too large"
#endif

My question is:

  1. Why SEAL_CIPHERTEXT_SIZE_MAX cannot be configured before building and why the current bound of ciphertext size is so small?
  2. Why do a static comparison on fixed (constant) values?