Fastest multiplication algorithm for efficient exponentiation in C++? First I apologize if this question is better tailored for SO, but since I'm using the method for crypto stuff, I thought I'd ask anybody that might know here. Karatsuba algorithm does a pretty good job, but maybe there is something that works better.
It depends on the length of the inputs and characteristics of the target platform:


If inputs are short (at most around a thousand bits), try a Comba multiplication.
If inputs are short and your platform has a lot of registers, try a hybrid Comba multiplication.
If you have a multiply-accumulate instruction, give a shot at Schoolbook multiplication.
If inputs are larger, divide-and-conquer approaches (Karatsuba, Toom-Cook) start to become faster.