LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-07-2009, 12:23 PM   #1
shrims4u
LQ Newbie
 
Registered: May 2009
Posts: 1

Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange error using grep in a while loop anil3 Linux - General 4 03-30-2009 04:09 AM
error: ‘for’ loop initial declaration nasim751 Programming 3 06-07-2008 11:31 AM
error: ‘for’ loop initial declaration nasim751 Linux - Software 2 06-07-2008 06:35 AM
Nested-double loop error Harry Seldon Programming 3 05-06-2006 06:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration