encryptorion-lab / phantom-fhe

PhantomFHE: A CUDA-Accelerated Homomorphic Encryption Library
https://encryptorion-lab.gitbook.io/phantom-fhe/
GNU General Public License v3.0
80 stars 9 forks source link

`ntt_negacyclic_harvey` #4

Closed ttttonyhe closed 5 months ago

ttttonyhe commented 5 months ago

Hello,

Thank you for making PhantomFHE's API compatible with Microsoft SEAL. I'm trying to migrate a project that uses Microsoft SEAL to PhantomFHE, and was wondering if there's an equivalent function to SEAL's ntt_negacyclic_harvey that I can use in PhantomFHE? If not, is it possible to accomplish the same thing by using a combination of other functions provided by PhantomFHE?

Thank you!

D4rkCrypto commented 5 months ago

Yes, we adopt several optimizations for implementing NTT in Phantom. Actually we named it differently which is called NWT. You can look into test/nwt_test.cu to get detailed example and test for NTT. Also benchmark/nwt_bench.cu delivers benchmarking results for NTT. For example, when the param $N$ is large ($N \geq 2^{12}$), you can use nwt_2d_radix8_forward_inplace which is equivalent to ntt_negacyclic_harvey in SEAL and nwt_2d_radix8_backward_inplace with regard to inverse_ntt_negacyclic_harvey in SEAL.