Pollard's rho algorithm for logarithms: Difference between revisions

Content deleted Content added
Phraine (talk | contribs)
Line 53:
 
Consider, for example, the group generated by 2 modulo <math>N=1019</math> (the order of the group is <math>n=1018</math>, 2
generates the group of units modulo 1019). The algorithm is implemented by the following [[C++ (programming language)|C++]] program:
 
<source lang=cppc>
#include <stdio.h>
Line 73:
int x=1, a=0, b=0;
int X=x, A=a, B=b;
int i;
for( int i = 1; i < n; ++i ) {
new_xab( x, a, b );
new_xab( X, A, B ); new_xab( X, A, B );