Two linear time algorithms are presented. One for determining, for eve
ry position in a given square matrix, the longest prefix of a given pa
ttern (also a square matrix) that occurs at that position and one for
computing all square covers of a given two-dimensional square matrix.