dwu4 / fhe-si

Implementation of Brakerski's leveled homomorphic encryption system
GNU General Public License v3.0
41 stars 12 forks source link

`generator` parameter #2

Closed joshlk closed 7 years ago

joshlk commented 7 years ago

Hi David,

I've been reading through your paper Using Homomorphic Encryption for Large Scale Statistical Analysis and working through your code. When executing the executables such as ./tests/Test_Statistics_x a generator parameter is required. I am currently unsure what this is? In the paper, you go into detail for optimal values for N, log(q), p1 and pn and Batch Size but you don't mention the generator parameter so I think I'm missing something.

Whenever I change the generator parameter I get this error:

$tests/Test_AddMul_x 80 23 3
Test_AddMul_x: PlaintextSpace.cpp:103: void PlaintextSpace::ReorderSlots(std::vector<unsigned int>&):
Assertion `factorsP.size() == perm.size()' failed.

What is this alluding to? Any help would be much appreciated! By the way, thank you for contributing to the knowledge of humanity! Don't underestimate its importance.

dwu4 commented 7 years ago

The generator parameter refers to a generator of the group (Z/(p-1)Z)*.

You can compute a generator using something like WolframAlpha (using the PrimitiveRoot command). For instance, for p = 23, you can find a generator by computing PrimitiveRoot[22] = 13.

Please feel free to ping me if you have additional questions!