When rsa key gen fail we now print the error code
Update thread.c

Replaced int_pow with bitshifts. It seemed unnecessary to use a function to compute powers of two, when a simple bitshift assignment would do. Tested the change on Mac OS X Snow Leopard with apple gcc-4.2, and I had no problems.
Update math.h

getting rid of unnecesary function.
Update math.c

getting rid of int_pow, unnecessary.