Note: this assignment is worth twice as much as a typical assignment, and you have two "academic weeks" to complete it. You are encouraged to work with a partner on this assignment. Your partner need not have the same preceptor. You and your partner will submit one program and you will receive the same grade. However, EACH of you must submit a readme file. The warmup section worth 10 points; the final submission is worth 30 points. Note that the warmup does not require any specific knowledge of the RSA cryptosystem.


Warmup Requirements

The following functions should be implemented in xp.c:

XPinitDecimal() XPshowDecimal() XPadd() XPrand() XPisOdd() XPgreater() XPless() XPeq() XPsub()

The following functions should be implemented in xp.c in your final submission, but are optional for the warmup:

XPmul() XPdiv() XPmod() XPrsa()

Checking Your Work and Hints

  • Some hints on getting started are available here.

  • The directory ftp.cs.princeton.edu/pub/cs126/rsa-warmup contains files that will be useful for the warmup portion of this assignment.

  • Check your work continuously as you go along. Test each function thoroughly before continuing on with the next task or you will regret it. Be sure to test your function with extreme cases (near 0 or near the overflow tolerance). It is a good idea to check the input to each function, and make sure, for example, that you don't attempt to multiply two 2N-digit integers since this would overflow the data type.

  • We supply a number of debugging clients to assist you in testing and debugging your code. Use them (or your own) often.

  • Note: you only need to handle nonnegative integers.

  • Submission and readme
  • Submit the following files via the Course Submission System:
    readme.txt  (both submit)
    xp.c        (1 partner submits) 
    XP.h        (same partner submits)
    
    Do not use different file names. Be sure to submit XP.h, and set the number of decimal digits to 40. You will lose significant points if your source files include xp.h instead of XP.h since our automated grading scripts will test your implementation with our client programs.

  • The readme file should contain the following information. Here is a template readme file.

  • Name, precept number, partner's name and precept number.



  • Kevin Wayne