int ind1,ind2;
- for(int a=0;a<h2;a++) {
+ for(int a=0;a<h2;a+=4) {
X[a]=Sbox1[a&0xFF]; //Warning according to the size of h2, we can be outsize of Sbox1[a]
+ X[a+1]=Sbox1[(a+1)&0xFF];
+ X[a+2]=Sbox1[(a+2)&0xFF];
+ X[a+3]=Sbox1[(a+3)&0xFF];
}
for(int a=0;a<h2;a+=4) {
- X[a]=X[Sbox1[a]];
- X[a+1]=X[Sbox1[a+1]];
- X[a+2]=X[Sbox1[a+2]];
- X[a+3]=X[Sbox1[a+3]];
+ X[a]=Sbox1[X[a]];
+ X[a+1]=Sbox1[X[a+1]];
+ X[a+2]=Sbox1[X[a+2]];
+ X[a+3]=Sbox1[X[a+3]];
}
-