How to calculate the sum product of two matrices?

How to calculate the sum product of two matrices?
For example, X and Y are both matrices, how do I get Σ(X-Y)'(X-Y) in R?

Matrix multiplication can be done with %*% operator, i.e. X %*% Y.

"Sumproduct" is a term I'm familiar with from Excel, but in that case applies to vectors, not matricies. This can be done in R as sum(x * y)