Indeed, this can be done by giving the same input to both inputs of the multiplication algorithm.
According to polynomial time reduction squaring can ultimately be logically reduced to what?
multiplication