Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 Task Two. Square and Multiply - Fast Exponentiation (2 marks) You are to implement fast.cpp or fast.java in this task, to implement the fast

image text in transcribed

2 Task Two. Square and Multiply - Fast Exponentiation (2 marks) You are to implement fast.cpp or fast.java in this task, to implement the fast exponentiation using the square and multiply technique as described in the lecture. That is, you need to compute: a (mod p) Your program needs to input three parameters, namely a, b and p. Then, you will need to do the following: Convert b into binary. Convert that binary to the S and X notation. Remove the first SX. Compute according to the sequence. The program must output each process one by one to the screen - not directly outputting the final result only. The number of steps must match the sequence of SX as identified above. Your implementation must be able to produce result (output) where the value of b is greater than 256 or a number that is at least 8 bits long. 2 Task Two. Square and Multiply - Fast Exponentiation (2 marks) You are to implement fast.cpp or fast.java in this task, to implement the fast exponentiation using the square and multiply technique as described in the lecture. That is, you need to compute: a (mod p) Your program needs to input three parameters, namely a, b and p. Then, you will need to do the following: Convert b into binary. Convert that binary to the S and X notation. Remove the first SX. Compute according to the sequence. The program must output each process one by one to the screen - not directly outputting the final result only. The number of steps must match the sequence of SX as identified above. Your implementation must be able to produce result (output) where the value of b is greater than 256 or a number that is at least 8 bits long

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions