u/BigPurpleBlobin r/FPGA • Recommends
On “Looking for an efficient way to square very large numbers”
https://en.wikipedia.org/wiki/Sch%C3%B6nhage%E2%80%93Strassen\_algorithm
"The **Schönhage–Strassen algorithm** is an asymptotically fast multiplication algorithm for large integers, published by Arnold Schönhage and Volker Strassen in 1971.^(\[1\)](https://en.wikipedia.org/wiki/Sch%C3%B6nhage%E2%80%93Strassen_algorithm#cite_note-sch%C3%B6nhage-1) It works by recursively applying fast Fourier transform (FFT) over the integers modulo 2n+1. The run-time bit complexity to multiply two *n*\-digit numbers using the algorithm is O(n⋅logn⋅loglogn) in big *O* notation."
[video