homenc / HElib

HElib is an open-source software library that implements homomorphic encryption. It supports the BGV scheme with bootstrapping and the Approximate Number CKKS scheme. HElib also includes optimizations for efficient homomorphic evaluation, focusing on effective use of ciphertext packing techniques and on the Gentry-Halevi-Smart optimizations.
https://homenc.github.io/HElib
Other
3.11k stars 759 forks source link

Fboemer/faster fwdntt #462

Closed fboemer closed 2 years ago

fboemer commented 2 years ago

Resolves some timing discrepancy between the FwdNTT and InverseNTT in the NTT benchmarks. In particular, the FwdNTT benchmark was calling an expensive conversion from NTL::ZZX to NTL::zz_pX, which took about 50us on the helib_fft_forward/hexl_F4_params benchmark.

This PR adds a FFT function using NTL::zz_pX, which avoids this overhead and is called by the pre-existing FFT conversion routines.

Now, with HEXL=ON, on ICX with clang-12, I'm seeing similar runtimes for the Fwd and Inv NTT, which is expected.

Screen Shot 2021-09-14 at 12 14 16 PM