(x,y)->(x,(x+y)%M)
I = state index x = I >> m; // top m bits, M = 2m y = I & mask; // bottom m bits, mask = M-1 = 0111..1 (m 1's) j = (x + y) % M; // classical addition J = (x << m) | j; // concatenate the bits tj = a[J]; // temporarily save original a[J] a[J] = a[I]; // update a[J]