This isn't a constant time algorithm. It can stop halfway through the loop if a byte in the middle differs. The time taken by the comparison must be independent of the inputs. In other words, it must always run through the entire loop, no matter what the bytes are.