HElib icon indicating copy to clipboard operation
HElib copied to clipboard

About segmentation errors in the 'rotate()' function

Open Luidy opened this issue 7 years ago • 6 comments

Hello. I am running and using 'Test_General.cpp'. I wanted to use a higher value of 'nslots'. However, there were no other parameter values ​​to recommend. So I used the value of the 's' variable in the parameter value that you suggested. ('s' variable is minimum number of slots [ default=0 , I used 300])

There was no problem with the other operators, but using the 'rotate()' function caused a segmentation error. How can I solve this problem?

I'll wait for your answer. Thank you.

Luidy avatar Nov 14 '18 14:11 Luidy

what command line arguments did you use when getting segfault?

shaih avatar Nov 14 '18 18:11 shaih

I used this command. ea.rotate(ctxt1, 1);

Luidy avatar Nov 15 '18 02:11 Luidy

no, which command-line parameter you used (m, L, c, etc.)?

shaih avatar Nov 15 '18 20:11 shaih

I used this parameters. R=1 p=2 r=1 d=1 c=2 k=80 L=0 s=0 repeat=1 chosen_m=1

Luidy avatar Nov 16 '18 02:11 Luidy

So if I want to use 2,000 slots, how can I set the parameter value?

Luidy avatar Nov 19 '18 16:11 Luidy

running with chosen_m= will result in using that value for the underlying cyclotomic ring. (So chosen_m=1 is not a valid choice, of course it should give you a meaningful error message rather than crashing, I'll try to fix it sometime soon.)

If you need >= 2000 slots with p=2, you can use m=65537, which will give you 2048 slots.

Getting exactly 2000 slots is harder, you need to find value of m such that phi(m)/ord_m(2)=2000, where ord_m(2) is the order of 2 in the multiplicative group modulo m, i.e. the smallest number e>0 such that 2^e = 1 mod m. I don't know of any value that works. If you can work with plaintext space p>2 then there should be more options (but again I don't really know what you could use).

shaih avatar Nov 19 '18 17:11 shaih