If the log is perfectly cylindrical, then the largest square will have a diagonal that's the same length as the diameter of your circular cross section.

Since it's a square, the side lengths will be the same (x). Then we have by Pythagoras

So the dimensions of the largest square will be .