4 x = x + state[i] + pKey[mod_16x8(i, iKeyLen)];
13 #define UCHAR unsigned char
14 #define USHORT unsigned short
16 #define PCHAR unsigned char *
18 #pragma disable_warning 85
20 UCHAR
mod_16x8(USHORT s16
, UCHAR i8
)
25 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
26 __xdata UCHAR state
[256];
29 void swap(PCHAR pa
, PCHAR pb
)
33 void RC4Init(PCHAR pKey
, UCHAR iKeyLen
)
47 x
= x
+ state
[i
] + pKey
[mod_16x8(i
, iKeyLen
)];
48 swap(&state
[i
], &state
[x
]);