}
}
-void prga(uchar *sc, int ldata, uchar *r) {
+void prga(uchar *sc, uchar *X, int ldata, uchar *r, int h) {
uchar i0=0;
uchar j0=0;
for (int it=0; it<ldata; it++) {
- i0 = (i0+1);
+ i0 = ((i0+1)+X[(i0+1)%h]);
j0 = (j0 + sc[i0]);
uchar tmp = sc[i0];
sc[i0] = sc[j0];
//cout<<endl;
- prga(S, h, RM1);
+ prga(S, X,h, RM1,h);
/*
for(int i=0;i<h;i++) {
cout<<(int)RM1[i]<<" ";
- prga(sc, h, RM1);
+ prga(sc, sc,h,RM1,h);