Question: 2. (20 pts) We saw that we can make modular exponentiation more tractable using a binary representation of our exponent. E.?., 513 mod 7- 58.54.51

2. (20 pts) We saw that we can make modular exponentiation more tractable using a binary representation of our exponent. E.?., 513 mod 7- 58.54.51 mod 7 (58 mod 7) (54 mod 7)(51 mod 7) mod 7 4-2-5 mod 7 40 mod 7 5 Implement fast modular exponentiation in a function that takes three parameters: modExp (m,base,exp) Your function should return base P mod m. Note that you must utilize the binary representation of your exponent to receive full credit. That is, if your function just returns (base * *exp)%m, you will lose points
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
