In his answer to this question, John Feminella says:
It's possible to do this sub-quadratically if you get really fancy, by representing each integer as a bit vector and performing a fast Fourier transform, but that's beyond the scope of this answer.
What is the asymptotically optimal way of solving the problem described in that question?