我有以下代码:
byte[] S = new byte[256];
byte[] T = new byte[256];
for (int i = 0; i < 256; ++i) {
S[i] = (byte)i;
T[i] = 13;
}
int j = 0;
int i2 = 0;
while (i2 < 256) {
j = j + S[i2] + T[i2] & 255;
byte[] arrby = S;
int n2 = i2;
arrby[n2] = (byte)(arrby[n2] ^ S[j]);
byte[] arrby2 = S;
int n3 = j;
arrby2[n3] = (byte)(arrby2[n3] ^ S[i2]);
byte[] arrby3 = S;
int n4 = i2++;
arrby3[n4] = (byte)(arrby3[n4] ^ S[j]);
}
具有初始值的 S[] 数组:0,1,2,3,4,5...
当程序到达该行时:
arrby[n2] = (byte)(arrby[n2] ^ S[j]);
S[0] 将其值从“0”更改为“13”,我不明白为什么。什么在修改 S[0] 值?正如我所看到的,'^' 只是进行比较并更改 arrby[n2] 的值而不是 S[0] 的值