Home >Backend Development >C++ >How Can I Optimize My Number Theoretic Transform (NTT) and Modular Arithmetic for Fast Squaring of Very Large Numbers?
Modular arithmetics and NTT (finite field DFT) optimizations
Problem: I wanted to use NTT for fast squaring (see Fast bignum square computation), but the result is slow even for really big numbers .. more than 12000 bits.
So my question is:
This is my (already optimized) source code in C for NTT (it's complete and 100% working in C whitout any need for third-party libs and should also be thread-safe. Beware the source array is used as a temporary!!!, Also it cannot transform the array to itself).
The above is the detailed content of How Can I Optimize My Number Theoretic Transform (NTT) and Modular Arithmetic for Fast Squaring of Very Large Numbers?. For more information, please follow other related articles on the PHP Chinese website!