Indeed, this can be done by giving the same input to both inputs of the multiplication algorithm.
What would need to remain constant in a multiplication algorithm to produce the same outcome whether multiplying or squaring two integers?  
input