Pollard's rho algorithm for logarithms: Difference between revisions

Content deleted Content added
Example: corrected the example which assumed the wrong oder for the group under observation
m Example: inserted some parentheses, needed because of C operator precedence
Line 61:
void new_xab(int& x, int& a, int& b){
switch(x%3){
case 0: x = x*x % N; a = a*2 % n; b = b*2 % n; break;
case 1: x = x*alpha % N; a = (a+1) % n; break;
case 2: x = x*beta % N; b = (b+1) % n; break;
}
}