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.46k stars 694 forks source link

Inconsistent results with insufficient multiplicative depth #684

Open hyerinshelly opened 3 months ago

hyerinshelly commented 3 months ago

Hello,

I am encountering some unexpected behavior while performing operations with insufficient multiplicative depth specified by coeff_modulus. I would like to report these cases and seek guidance from your team regarding their implications.

Q1: Inconsistent results under insufficient multiplicative depth I'm aware that giving insufficient level is considered an invalid use case, thus not expected to yield correct results. However, when I generated and executed such cases in real, I noticed inconsistencies in the outcomes. Some cases return correct outputs, while others yield unexpected results. Please refer to Example 1 - 3 below for clarification.

Considering the observed inconsistencies, I propose terminating such operations with an exception, like std::invalid_argument, which is commonly used for handling invalid parameter sets. I would appreciate your thoughts on this suggestion.

Q2: Random outputs from one program (with insufficient multiplicative depth) Furthermore, I also observed instances where executing certain operations with insufficient multiplicative depth resulted in random outputs. For instance, in Example 4 below, the operation alternates between returning expected outputs and producing unpredictable results. These unexpected outputs vary with each execution. I seek clarification on whether such behavior is expected or if there are specific environment settings I should check. Any insights or instructions regarding this observation would greatly aid my understanding.

Thank you for your attention and dedication to addressing this issue.

Examples

Here's the example code that I used: