The result in the loop was being reset each iteration; only the last element in the byte array was being checked for equality.
Still needs documentation.