int value larger then unsigned long
For my number theory class we need to implement a public key encryption program which I have done, however I'm runing into some problems when I try to use larger key values.
Basically this is the problem code
for(i = 1; i <= b; i++)
{
value = value * a;
while(value >= n)
{
value = value - n;
}
}
My problem is in the line
value = value * a;
Now as soon as I do that the number overflows and I get invalid results, before I can bring bring it down into range.
So my question is basically is the a variable larger then an unsigned long? Some of my class mates used java which has something called bigint, which is only limited by your ram. Is there anything like this with c, or at least a 64bit int value?
|