##### Differences

This shows you the differences between two versions of the page.

 cs-312:project-1 [2015/01/13 23:46]ringger [Instructions] cs-312:project-1 [2015/01/14 21:21]ringger [Implementation Notes] Both sides previous revision Previous revision 2015/01/26 15:21 ringger [Report] 2015/01/14 21:21 ringger [Implementation Notes] 2015/01/13 23:46 ringger [Instructions] 2015/01/13 23:46 ringger [Instructions] 2015/01/12 14:55 ringger [Implementation Notes] 2015/01/12 14:53 ringger [Implementation Notes] 2015/01/12 14:52 ringger [Implementation Notes] 2015/01/12 14:30 ringger [Implementation Notes] 2015/01/12 14:28 ringger [Implementation Notes] 2015/01/12 14:26 ringger [Implementation Notes] 2015/01/12 14:26 ringger [Implementation Notes] 2015/01/12 14:25 ringger 2015/01/12 07:47 ringger [Report] 2015/01/12 07:47 ringger [Implementation Notes] 2015/01/12 07:45 ringger [Implementation Notes] 2015/01/12 07:43 ringger 2015/01/12 07:41 ringger 2014/12/31 16:21 ringger 2014/12/31 15:08 ringger created 2015/01/26 15:21 ringger [Report] 2015/01/14 21:21 ringger [Implementation Notes] 2015/01/13 23:46 ringger [Instructions] 2015/01/13 23:46 ringger [Instructions] 2015/01/12 14:55 ringger [Implementation Notes] 2015/01/12 14:53 ringger [Implementation Notes] 2015/01/12 14:52 ringger [Implementation Notes] 2015/01/12 14:30 ringger [Implementation Notes] 2015/01/12 14:28 ringger [Implementation Notes] 2015/01/12 14:26 ringger [Implementation Notes] 2015/01/12 14:26 ringger [Implementation Notes] 2015/01/12 14:25 ringger 2015/01/12 07:47 ringger [Report] 2015/01/12 07:47 ringger [Implementation Notes] 2015/01/12 07:45 ringger [Implementation Notes] 2015/01/12 07:43 ringger 2015/01/12 07:41 ringger 2014/12/31 16:21 ringger 2014/12/31 15:08 ringger created Last revision Both sides next revision Line 56: Line 56: ** Here, the <​tt>​length​ of the number you are testing ($N$) is assumed to be measured in bits.  Use <​tt>​BigInteger.Log(N,​ 2)+1​ and round up to compute the number of bits needed to represent $N$. ** Here, the <​tt>​length​ of the number you are testing ($N$) is assumed to be measured in bits.  Use <​tt>​BigInteger.Log(N,​ 2)+1​ and round up to compute the number of bits needed to represent $N$. ** Once you have computed your random number (let's call it $a$) using that code snippet, make sure it is in the proper range (a value between $1$ and $N-1$ (inclusive)),​ as required by the contrapositive of Fermat'​s little theorem. ​ If it does not, then discard it and draw another one until you do.  In particular, also be sure that your chosen random number is not $0$ ($a=0$ is not a legitimate value for the contrapositive of Fermat'​s little theorem.) ** Once you have computed your random number (let's call it $a$) using that code snippet, make sure it is in the proper range (a value between $1$ and $N-1$ (inclusive)),​ as required by the contrapositive of Fermat'​s little theorem. ​ If it does not, then discard it and draw another one until you do.  In particular, also be sure that your chosen random number is not $0$ ($a=0$ is not a legitimate value for the contrapositive of Fermat'​s little theorem.) + * You may '''​not'''​ use library functions to compute modular exponentiation such as <​tt>​BigInteger.modPow()​. The point is for you to gain insight into the modular exponentiation algorithm itself. * You may '''​not'''​ use library functions to compute modular exponentiation such as <​tt>​BigInteger.modPow()​. The point is for you to gain insight into the modular exponentiation algorithm itself. ** That said, you could certainly check your answer against <​tt>​modPow()'​s result. ** That said, you could certainly check your answer against <​tt>​modPow()'​s result.