segmentation error while using mpz_powm in a loop
I am writing a decryption program and i am using GMP library...
The following code gives the error....
mpz_t bigbody,encbody,decbody,n,d,e;
mpz_init(bigbody);
mpz_init(decbody);
while(i<noOfBlocks)
{
strncpy(substring, data_buffer + lower, upper);
*(substring+308)='\0';
lower=upper;
upper=upper+308;
i++;
mpz_set_str(bigbody,substring,10);
//size=len;
mpz_powm (decbody, bigbody, d, n);
}
At mpz_powm i get segmentation error when the loop runs second time.. 1st time it runs properly
|