benchNTT provides high-performance CPU implementations of 128-bit cryptographic kernels, specifically number theoretic transforms (NTTs) and basic linear algebra subprograms (BLAS) operations. The kernels are implemented using scalar, AVX2, and AVX-512 instructions. For more details, please refer to our paper.
Related GPU work is available in our MoMA repository.
One of the following compilers is required:
The build system supports multiple compilers and architectures:
ICX required for best performance.
make blas-intel # Build and run BLAS benchmarks
make ntt-intel # Build and run NTT benchmarksAOCC required for best performance.
make blas-amd # Build and run BLAS benchmarks
make ntt-amd # Build and run NTT benchmarksGCC required.
make blas # Build and run BLAS benchmarks
make ntt # Build and run NTT benchmarksNote I: If your CPU does not support AVX2 or AVX-512, you can comment out the corresponding build targets (see
BLAS_TARGETSandNTT_TARGETS) in theMakefileto build only the supported implementations.
Note II: You can also use
make allto build and run all targets with GCC. Always runmake cleanbefore switching compilers.
For accurate benchmarking, please ensure that no other processes are competing for CPU resources. Running benchmarks on dedicated machines (e.g., via SSH) and taking multiple measurements is recommended to minimize noise.
benchntt (this repository)
│ README.md (this file)
│ Makefile
│ ...
│
└────benchmark
│ │ run_ntt.sh
│
└────data
│ │ x_1024.txt
│ │ ver_1024.txt
│ │ ...
│
└────src
│ blas_avx512.c
│ ntt_avx512.c
| ...
benchmark: Bash script for benchmarking different NTT sizes.data: Verification data for NTT and BLAS operations.src: Scalar, AVX2, and AVX-512 implementations of NTT and BLAS operations.
Distributed under the SPIRAL License. For more details, please refer to the LICENSE file.