Question: The square-and-multiply algorithm for modular exponentiation - preliminaries for next week. Present an algorithm that for given input N[2n],x[N], and e [2m] computes xe rem

The square-and-multiply algorithm for modular exponentiation - preliminaries for next week. Present an algorithm that for given input N[2n],x[N], and e [2m] computes xe rem N in time O(mM(n)), where two at-most-n-bit integers can be multiplied in time O(M(n)). Carefully justify the running time of your algorithm. Hints: Recall that we can divide (compute quotient and remainder) two at-mostn-bit integers in time O(M(n)). You may want to precompute x20remN,x21 rem N, x22 rem N, and so forth, by repeated modular squaring, and then multiply. Observe that m is an upper bound on the bit-length of e, which means that O(mM(n)) is a rather limited time budget compared with, say, O(eM(n))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
