The util.C file contains functions which are called from shor.C. Many of the functions are written to avoid overflow when calculating functions in which there are intermediate steps which may have large values. For example while factoring 15, x255 mod 15 is calculated, but the modular exponentiation function in util.C calculates it in such a manner that x255 need not be explicitly calculated. I have commented these helper functions in the code itself.