title: rsa algorithm in openmp
body: <p>I am trying to parallize RSA algorithm with the help of repeated square and multiply method in openmp.
  code is as follow:</p>
  
  <pre><code>long long unsigned int mod_exp(int base,int exp,int n)
  {
      long long unsigned int i,pow1=1,pow2=1,pow3=1,pow4=1,pow=1,pow5=1;
      int exp1=exp/4; 
      int id;
  
      for(i=0;i&lt;exp1;i++)
          pow1=(pow1*base)%n;
  
      for(i=0;i&lt;exp1;i++)
          pow2=(pow2*base)%n;
  
      for(i=0;i&lt;exp1;i++)
          pow3=(pow3*base)%n;
  
      for(i=0;i&lt;exp1;i++)
          pow4=(pow4*base)%n;
  
      for(i=0;i&lt;1;i++)
          pow5=(pow5*base)%n;
      pow=pow1*pow2*pow3*pow4*pow5;
  
      pow=pow%n;
      return pow;
  } 
  </code></pre>
  
  <p>just with #pragma omp for i am unable to find get the correct output.
  kindly help</p>