The following is a checklist which provides a summary of the assignment. This is meant only as a supplement; please read the original assignment description.
[Michael 4/16] WARNING: BigNum_rem(x,y) will crash if you call it when y=0. So our advice is not to ask for the remainder of a number when divided by zero. (We would offer to fix BigNum_rem to produce a nicer error message, but C also crashes if you try to evaluate (x%y) when y=0.)
[Michael 4/13] Programming Platforms: The bignum.o
and libgmp.a files which we are providing you for this
assignment depend very much on what language you are using and on the
architecture type of the machine you are using. The default files we
have provided are for those programming in C, running on a Sun machine
with solaris (such as the arizona machines).
We will be as helpful as possible in providing similar versions of
these files for any other environment you are using. Of course we
cannot make any promises for the promptness of meeting requests, so
please do not expect to mail us Sunday afternoon and have new files
installed.
In this regard, for those programming in C++ on the Sun machines,
files have now been added in the
/u/cs226/prog8_files/C++/SunOS/ directory. Any other
architectures we add will be placed somewhere in the
prog8_files directory.
[Michael 4/13] The values of c and x0 are to be chosen independently. (the fact that our one example happen to have c=x0 should be viewed as a coincidence)
[Michael 4/12] Please notice that most of the arithmetic functions in the ADT definitions of bignum.h return a new BigNum object which you are responsible for freeing when done. At first, you can probably get away with never freeing them and just leaving the wasted space sitting around, but as you try to factor larger and larger numbers, all of this space usage may haunt you.
[Michael 4/11] There is no need to copy the files
bignum.o and libgmp.a into your own directory (this
is a waste of space). Simply compile with a command such as
cc yourcode.c ~cs226/prog8_files/bignum.o
~cs226/prog8_files/libgmp.a
(or else use symbolic links if you know how).
[Michael 4/9] There were (originally) two typos in the assignment. The correct function to iterate is f(x)=(x*x+c) (mod N). Also, Euclid's algorithm is based on recursively finding the gcd of b and a%b.
[Michael 4/8] For those working in Java, there is a builtin library BigInt which can handle multiple precision integer arithmetic.