This project demonstrates the Number Theoretic Transform (NTT) implementation using parameters similar to the Kyber Post-Quantum Cryptography scheme (
-
Parameter Settings: Uses core parameters relevant to Kyber, specifically
$N=256$ and$Q=3329$ . -
Algorithms Implemented:
-
Naive
$O(N^2)$ Multiplication: Serves as the performance baseline. -
NTT Scalar C++ Version (Scalar): Implements the
$O(N \log N)$ polynomial multiplication using standard C++ for the NTT and Inverse NTT stages. - NTT AVX2 Mixed Version (AVX2 Mix): Accelerates the Point-Wise Multiplication (BaseMul) stage using AVX2 intrinsics to demonstrate SIMD throughput. The NTT/INTT stages rely on the C++ scalar implementation.
-
Naive
-
Benchmarking: Uses the
__rdtsc()intrinsic for precise CPU cycle counting performance measurement.
The project uses CMake for building.
- A C++17 compatible compiler (e.g., GCC, Clang, MSVC).
- An x86-64 processor supporting AVX2 instructions (required for the AVX2 benchmark).
- CMake (version
$\ge 3.10$ ).
-
Clone the repository.
-
Navigate to the project root directory.
-
Build using CMake:
mkdir build cd build cmake .. make
Execute the generated test program ntt_test:
./ntt_test