I'm emulating 128-bit arithmetic. At the moment I'm calculating $x^2$ by computing $x\cdot x$. What might be some alternative methods that aren't simply dressing up multiplication?
Base on the fact that:
If n is an even number $(n = 2m) \implies n^2 = 4m^2$
If n is an odd number $(n = 2m + 1) \implies n^2 = 4m^2 + 4m + 1$
And you can calculate $m$ by bitwise shifting right of $n$, calculate $4m$ (or $4m^2$) by bitwise shifting left.
So you can apply the recursion method to this process to establish the result with $O(\log n)$ time complexity.