Closed Huelse closed 4 years ago
There is a problem in SerializationUtils. Look at my fork https://github.com/gamma-2017/libHEAAN, there it is repaired.
@gamma-2017 Thank you, a very quick answer, I will try it later.
@gamma-2017 I just tried to use it, and found a new probelem:
Oh, you took my entire code. I just meant you to look into
Now, mind that
For faster testing I have decreased logN to a much smaller value than 16, namely 7 (unless you define SECURE). Things are much faster this way, but not secure. Also, there are only 2^6 slots instead of 2^15 slots, which is still enough for tests.
Your new problem now probably comes from having logn > logN-1 = 6. Among the things that my fork does differently are various assertions, they basically check that parameters are correct and rais an error like your one. In this case the assertion was
0<=n && n<=N && 0==N%n
and it failed. Recalling n=2^logn, N=2^logN you should understand that message.
I hope I could clarify what happend. It's tricky.
PS: Have you tried running your code with a nice debugger, in some development environment? That helps. [I am using kdevelop; but I am sure there are also others.]
@gamma-2017 got it, thank you.
Here is a new problem now, I have generated the key in local serkey/ROTATION_*.txt
when I diable the addkeys, it show me errors.
Ring ring;
SecretKey secretKey(ring);
Scheme scheme(secretKey, ring, true);
//scheme.addLeftRotKeys(secretKey);
//scheme.addRightRotKeys(secretKey);
...
scheme.rightRotateFast(ctemp, ctxt, 1);
===
terminate called after throwing an instance of 'std::out_of_range'
what(): map::at
I think the scheme didn't load the rotation key. How can I solve it? Thanks!
Hi, the map struct keeping all rotation keys reports that the desired one, namely the rotation key for rotating right by 1 position, is not available. You need to call scheme.addRightRotKey( ..., 1 ) [check name] to generate it before calling rightRotate . Enjoy
Alright, I don't know much about this lib, it don't have the i/o notes, thank you again.
When I use the latest HEAAN, I found I can't save the key and encrypt the array correctly. Even the simplest code will also happen
segmentation faul
. Environment: Ubuntu18.04.3, NTL-11.4.2mkdir serkey
.I don't know if I made a mistake with it, and the serialization can be used in below's HEANN which from KyoohyungHan/HELR