I have maybe a simple question but I haven't been able to find an answer through googling.
The question is as such:
Is $\ a × b^2 \bmod c $ the same as $\ (a \bmod c) × (b^2 \bmod c) $?
That's it. That's all I'm confused about.
Sorry if it seems a little simple...
answer:
$\ a × b^2 \bmod c = ((a \bmod c) × (b^2 \bmod c))\bmod c $
:)
If $a \equiv b$ and $c \equiv d$ then $ac \equiv bd$, where everything is modulo $n.$ This says that we can switch and multiply, or multiply and switch. So long as everything is modulo $n$ in the end you'll get the same result.
– user1390 May 26 '18 at 14:07