2

I have tested a lot of combinations with integer numbers and it seems like we can say that $y^2 \bmod n$ equals $((y \bmod n)^2) \bmod n$.

I can't find any resource that acknowledges this. Is my statement correct? If no, what are the corner cases, if yes, can you explain why?

Housy
  • 123

1 Answers1

1

yes, it is true. Modulo $n$ is just remainder when you divide by $n$, thus write $$y=nq+r \implies y \mod n=r , \text{where}\ 0\le r <n\\ y^2=nq'+r^2 \implies y^2\mod n=r^2, $$ where $q'=q^2+2qr$