Time complexity for two multiplications modulo $p$ The time complexity of computing $MK\bmod P$ is $O((\log n)^2)$.  What is the time complexity of computing $MK^2\bmod P$? Is it $O(2(\log n)^2)$ or $O((\log n)^2)$?
$O(2(\log n)^2$ is exactly the same thing as $O((\log n)^2)$. This follows from the definition of $O()$.